Comparing Twitter API’s user lookup endpoints

The v2 user lookup endpoints will replace the standard v1.1 GET users/lookup and GET users/show endpoints, as well as the Labs user lookup endpoints. If you have code, apps, or tools that use one of these versions of the user 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.
  • Tweets and user data objects - The Twitter API v2 introduces a completely new design for encoding Tweet and user objects in JSON. Any code that parses v1.1 standard JSON payloads will need to be updated to work with the new formats.


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

Description

Standard v1.1

Labs

Twitter API v2

 

HTTP methods supported

GET GET GET  

Host domain

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

Endpoint path

/1.1/users/show.json /1.1/users/lookup.json

/labs/2/users

/labs/2/users/:id

/labs/2/users/by

/labs/2/users/by/:username

/2/users

/2/users/:id

/2/users/by

/2/users/by/:username

 

Authentication

OAuth 1.0a User Context

OAuth 1.0a User Context

OAuth 2.0 Bearer Token

OAuth 1.0a User Context

OAuth 2.0 Bearer Token

 

Default request rate limits

900 requests per 15 min (per user)

/show - 900 requests per 15 min (per app)
/lookup - 300 requests per 15 min (per app)

900 requests per 15 min

900 requests per 15 min (per user)

300 requests per 15 min (per app)

 

Maximum Tweets per response 

/show -  1

/lookup - 100

100

100

 

Tweet JSON format

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

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

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 annotations fields    
Supports requesting new metrics fields    
Supports the conversation_id field      

Was this document helpful?

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.