Standard v1.1 compared to Twitter API v2

If you have been working with the standard v1.1 followers/ids, v1.1 followers/list, v1.1 friends/ids, or v1.1 friends/list endpoints, the goal of this guide is to help you understand the similarities and differences between the standard and Twitter API v2 follows lookup endpoints.

  • Similarities
    • Authentication
  • Differences
    • Users per request limits
    • Endpoint URLs
    • App and Project requirements
    • Request parameters
    • New JSON format

       

Similarities

Authentication

Both the standard v1.1 and Twitter API v2 follows lookup endpoints accept either OAuth 1.0a User Context and OAuth 2.0 Bearer Token. Therefore, if you were previously using one of the standard v1.1 follows lookup endpoints, you can continue using the same authentication method if you migrate to the Twitter API v2 version. 

Depending on your authentication library/package of choice, Bearer Token authentication is probably the easiest way to get started and can be set with a simple request header. To learn how to generate a Bearer Token, see this OAuth 2.0 Bearer Token guide
 

Users per request limits

The standard v1.1 endpoints allows you to return up to 5000 users per request. The new v2 endpoints allows you to return up to 1000 users per request. To return a full 1000 users, you will need to pass max_results=1000 as a query parameter; you can then pass the next_token returned in the response payload to the pagination_token query parameter in your next request.

 

Differences

Endpoint URLs

  • Standard v1.1 endpoints:
    • https://api.twitter.com/1.1/followers/ids.json
      (list of user IDs who are followers of the specified user)
    • https://api.twitter.com/1.1/followers/list.json
      (list of users who are followers of the specified user)
    • https://api.twitter.com/1.1/friends/ids.json
      (list of user IDs the specified user is following)
    • https://api.twitter.com/1.1/friends/list.json
      (list of users the specified user is following)
  • Twitter API v2 endpoint:
    • https://api.twitter.com/2/users/:id/followers
      (list of users who are followers of the the specified user ID)
    • https://api.twitter.com/2/users/:id/following
      (list of users the specified user ID is following)
 

App and Project requirements

The Twitter API v2 endpoints require that you use credentials from a developer App that is associated to a Project when authenticating your requests. All Twitter API v1.1 endpoints can use credentials from standalone Apps or Apps associated with a project.

Request parameters

The following standard v1.1 request parameters accepted two request query parameters (user_id or screen_name). The Twitter API v2 only accepts the numerical user ID, and it must be passed as part of the endpoint path.

One of the biggest differences between standard v1.1 and Twitter API v2 endpoint versions is how you select which fields return in your payload. For the standard endpoints, there are several parameters that you could use to identify which fields or sets of fields would return in the payload, while the Twitter API v2 version simplifies these different parameters into fields and expansions
 

New JSON format

Twitter API v2 is introducing new JSON designs for the objects returned by the APIs, including Tweet and user objects.

  • At the JSON root level, the standard endpoints return user objects in a statuses array, while Twitter API v2 returns a data array. 
  • Instead of referring to Retweeted and Quoted "statuses", Twitter API v2 JSON refers to Retweeted and Quoted Tweets. Many legacy and deprecated fields, such as contributors and user.translator_type are being removed. 
  • Instead of using both favorites (in Tweet object) and favourites (in user object), Twitter API v2 uses the term like
  • Twitter is adopting the convention that JSON values with no value (for example, null) are not written to the payload. Tweet and user attributes are only included if they have a non-null values. 
     

In addition to the changes that we made to our new JSON format, we also introduced a new set of fields to the Tweet object including the following:

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.