Comparing Twitter API’s follows endpoints

This page has two different sections for the two endpoint groups that read and write follows data:

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

 

Follows lookup

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.

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  

 

Manage follows

The v2 manage follows endpoints will replace the standard v1.1 POST friendships/create and POST friendships/destroy endpoints.

The following tables compare the standard v1.1 and Twitter API v2 create follow endpoints:

Follow a user

Description Standard v1.1 Twitter API v2
HTTP methods supported POST POST
Host domain https://api.twitter.com https://api.twitter.com
Endpoint path /1.1/friendships/create.json /2/users/:id/following
Authentication OAuth 1.0a User Context OAuth 1.0a User Context
Default request rate limits 50 requests per 15 min 50 requests per 15 min
Maximum daily operations per users 400 400
Maximum daily operations per app 1000 1000

 

Unfollow a user

The following tables compare the standard v1.1 and Twitter API v2 delete follow endpoints:

Description Standard v1.1 Twitter API v2
HTTP methods supported POST DELETE
Host domain https://api.twitter.com https://api.twitter.com
Endpoint path /1.1/friendships/destroy.json /2/users/:source_user_id/following/:target_user_id
Authentication OAuth 1.0a User Context OAuth 1.0a User Context
Default request rate limits 15 requests per 15 min (per user) 50 requests per 15 min (per user)
Maximum daily operations per app None 500
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.