Twitter API v2: Early Access

What's new with v2?

We’re building a new Twitter API with a modern and more sustainable foundation as well as an improved developer experience. The first endpoints are now available within Early Access, and enable you to listen to and analyze the public conversation. Additional endpoints, features, and access levels will be released soon!

The functionality available within Early Access is production-ready and supported for use at scale. We intend for this new v2 Twitter API to replace the v1.1 standard, premium, and enterprise APIs in the future. For more detail about our plans for the new Twitter API, visit our “Guide to the future”.

New features

Ability to specify fields Pick and choose which data fields you receive in your response with our new fields functionality.
 
New and more detailed data objects

We’ve added additional data fields and objects to our responses, and are allowing you to request the following related objects to return directly in the related Tweet or user object:

  • Mentioned accounts in Tweets
  • Quoted and replied-to Tweets
  • Places tagged to Tweet
  • Media attached to Tweets
  • Current poll results and poll options in Tweets
  • The pinned-Tweet for an account
     
Advanced metrics return in Tweets More easily understand the performance of Tweets from directly within your payload by requesting both public and private Tweet metrics including impressions, video views, user profile and URL clicks, some of which are separated into an organic and promoted context.
 
Insights on Tweet topics with annotations When using search Tweets or filtered stream, you can now filter by topic using our entity and context operators. We’ve also provided these topics within the Tweet payload to help with analysis.
 
Improved conversation tracking Make it easier to identify a Tweet as part of a conversation thread when using recent search and Tweet lookup
 


In addition to the above features, we’ve also released the following functionality:

  • High confidence spam filtering
  • Shortened URLs are fully unwound for easier URL analysis
  • Simplified JSON response objects by removing deprecated fields and modernizing labels
  • Return of 100% of matching public and available Tweets in search queries
  • Streaming "rules" so you can make changes without dropping connections
  • More expressive query language for filtered stream and search
  • OpenAPI spec to build new libraries & more transparently track changes
  • API support for new features and endpoints more quickly as our platform evolves to meet the needs of developers, researchers, businesses, and people using Twitter.

 

Updated endpoints

Tweet lookup Look up Tweets by ID.
User lookup Look up users by name or ID.
Recent search Query the most recent seven days of Tweets, and receive full-fidelity responses with this first release of our search Tweets functionality.
Filtered stream Filter the complete stream of real-time public Tweets.
Sampled stream Stream a sample of new Tweets as they are published, across ~1% of all public Tweets in real-time.
Hide replies Hides or unhides a reply to a Tweet.

Explore what's possible with our tutorials

Measure Tweet performance

Build a simple tool to understand how users’ Tweets are performing in the world.

Stream Tweets in realtime

Surface and stream Tweets and conversations as they happen.

Analyze past conversations

Search for topics or keywords and analyze the related conversation.

 

Listen for important events

Listen for important events and trigger actions like notifications.

Explore a user's Tweets

Retrieve and explore a user’s timeline of Tweets from the last seven days.

Analyze the sentiment of Tweets

Learn how to analyze the sentiment of your Tweet timeline.

Tools and libraries

Check out Twitter-built and community-built tools and libraries that you can use to speed up integration, optimize usage, avoid bugs, and troubleshoot issues.

Migrate to Twitter API v2

Interested in migrating your current integration to the new version of the Twitter API? Check out our migration hub for resources that will help you move to the Twitter API v2. You can also access migration guides for each endpoint listed in the new v2 endpoint sections.

Learn more about what the future of the Twitter API looks like by reading our guide.

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.