Comparing Twitter API’s follows lookup endpoints

The v2 follows lookup endpoints will replace the standard v1.1 followers/ids, v1.1 followers/list, v1.1 friends/ids, and v1.1 friends/list endpoints. If you have code, apps, or tools that use one of these versions of the follows lookup endpoints, and are considering migrating to the newer Twitter API v2 endpoint, then this set of guides is for you. 

These guides will focus on the following areas:

  • API request parameters - The Twitter API v2 endpoint introduces a new set of request parameters. While some parameters will be familiar, especially for those integrating with Labs, there are many important differences such as the introduction of the fields and expansions parameters.
  • New JSON format - Twitter API v2 introduces a completely new JSON format. Any code that parses v1.1 standard, premium, and enterprise JSON payloads will need to be updated to work with the new formats.
  • App and Project requirements - To access the Twitter API v2, you will need to use credentials from a developer App that is associated with a Project


The following tables compare the various types of follows lookup endpoints:
 

Description

Standard v1.1

Twitter API v2

HTTP methods supported

GET GET

Host domain

https://api.twitter.com https://api.twitter.com

Endpoint path

/1.1/friends/ids.json

/1.1/friends/list.json

/1.1/followers/ids.json

/1.1/followers/list.json

/2/users/:id/following

/2/users/:id/followers

Authentication

OAuth 1.0a User Context

OAuth 2.0 Bearer Token

OAuth 1.0a User Context

OAuth 2.0 Bearer Token

Default request rate limits

15 requests per 15 min (per user)

15 requests per 15 min (per app)

15 requests per 15 min (per user)

15 requests per 15 min (per app)

Maximum users per response 

GET friends/id & GET followers/id return a maximum of 5000 users IDs per page.


GET friends/list & GET followers/list return a maximum of 200 user objects per page.

1000 user objects per page

Pagination

Token returns in a next_cursor field, which can then be passed as the value to the cursor parameter to return the next page of results.

Token returns in a next_token field, which can then be passed as the value to the token parameter to return the next page of results.

The v2 payload also delivers a previous_token field, which can also be passed with the pagination_token parameter to return the previous page of results.



JSON format

Native (soon to be referred to as 'legacy')

Twitter API v2 (determined by fields and expansions request parameters, not backward-compatible with v1.1 formats)

Supports selecting which fields return in the payload

 

Supports the Tweet annotations fields  
Supports requesting new metrics fields  
Supports the conversation_id field  
Requires the use of credentials from a developer App associated with a project  

Was this document helpful?

Thank you

Thank you for the feedback. We’re really glad we could help!

Thank you for the feedback. How could we improve this document?

Thank you for the feedback. Your comments will help us improve our documents in the future.