Tweets and Users v2

Please note:

We recently released new Tweet lookup and user lookup endpoints into Twitter API v2: Early Access.

Learn more about the new functionality at the following links:


Interested in exploring Labs?
The endpoints we release in Labs are previews of tools that may be released more broadly in the future, but will likely undergo changes before then. We encourage you to take that into consideration as you explore. Before getting started, please read more about Twitter Developer Labs.
 

Frequently asked questions

The FAQ content is divided into two sections:

 

Retrieve Tweet

What is the difference between the Labs GET /tweets functionality and the v1.1 GET statuses/lookup and GET statuses/show/:id endpoints?

We have a page in our documentation that explains the general differences between the older endpoints and the Labs endpoints. The Labs GET /tweets function is different in several key ways:

  • Returns a completely new JSON rendering of a Tweet from v1.1
  • Adds support for objects like Polls, where applicable
  • Allows you to request only the fields you need via the fields query parameter
  • Adds support for Tweet-specific expansions, like the option to get the full Tweet object for referenced Tweets in one request
     

What are the differences between this endpoint and the existing Search APIs?

The Labs GET /tweets endpoint is mean to hydrate a set of Tweets IDs that you pass through with your request, allowing you to see all of the metadata associated with those Tweets.

The existing Recent search preview allows you to build a search query using a set of filtering operators to find related Tweets.
 

Are there any situations that would prevent me from requesting a specific Tweet with this endpoint?

If you are using OAuth 1.0a user context to make your request, then GET /tweets requests will not return a Tweet in the following situations:

  • If the author of a tweet has blocked the requesting user
  • If the author has a protected account and the requesting user is not following the author

If you are using OAuth2.0 Bearer Token to make your request, then GET /tweets requests will not return a Tweet in the following situations:

 

How do I receive the entire Tweets data object, similar to what the v1 detailed format returned?

When making your request to the GET /tweets endpoint, use the following URI, making sure to replace the Tweet ID with your preferred Tweet:

  https://api.twitter.com/labs/2/tweets?ids=1229841859612200960&tweet.fields=author_id,created_at,entities,geo,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,referenced_tweets,source,withheld&expansions=attachments.media_keys,attachments.poll_ids,geo.place_id,in_reply_to_user_id,referenced_tweets.id,referenced_tweets.id.author_id&media.fields=duration_ms,height,media_key,preview_image_url,type,url,width&poll.fields=duration_minutes,end_datetime,voting_status&user.fields=created_at,description,entities,location,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld



How do I request non-public metrics of another user's Tweet?

You will need to use Oauth 1.0a user context and the access tokens must represent the user who owns the Tweet.


Retrieve user

What is the difference between the Labs GET /users functionality and the older v1.1 GET users/lookup and GET users/show endpoints?

Please see our documentation that explains the general differences between the older endpoints and the Labs endpoints. The Labs GET /users function is different in several key ways:

  • Returns a completely new JSON rendering of a Tweet from v1.1
  • Allows you to request only the fields you need via the fields query parameter
  • Adds support for user-specific expansions, like the option to get the full or partial User object for referenced Tweets in one request

 

 

Additional resources

  • Get started building with our quick start guides.
  • Check out our API reference to learn more about what’s available.
  • Give feedback on Twitter Developer Labs.
  • Tell us about your experience using the Twitter Developer Labs endpoints by filling out this survey.

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.