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 Twitter API v2 is in development and serves adequate access for the majority of developers on the platform. While elevated levels of access are coming soon, developers in need of higher levels of access can explore our the standard v1.1, premium v1.1, and enterprise APIs.

For more detail about our plans for the new Twitter API, visit our “Guide to the future”.

New features

Ability to request specific objects and  fields Pick and choose which data you receive in your response with our new fields and expansions 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. We've also added the abliity to determine whether conversation reply settings have been set for a Tweet with the Tweet field reply_settings.
 
Academic Research product track This specialized product track for researchers grants free access to full-archive search and other v2 endpoints released to date. It also includes a significantly higher monthly Tweet cap, and enhanced features and functionality to get more precise and complete data for analyzing the public conversation.


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
  • Recovery and redundancy functionality for our streaming endpoints
  • 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

Tweets Tweet lookup Look up Tweets by ID.
Manage Tweets Endpoints that enable you to Tweet or delete a Tweet.
Search Tweets

Query the most recent seven days or the full-archive of Tweets, and receive a full-fidelity response.

The full-archive search endpoint is currently only available via the Academic Research product track.

Tweet counts

Retrieve a count of Tweets from either the last seven days or from the full-archive that matches a query.

The full-archive Tweet counts endpoint is currently only available via the Academic Research product track.

Timelines Retrieve a timeline of either the Tweets composed by a specified Twitter account, or the mentions of a specified Twitter account.
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.
Retweets Retrieve a list of accounts that have Retweeted a Tweet, or Retweet or undo a Retweet of a Tweet.
Likes Retrieve a list of users who liked a Tweet, retrieve a list of Tweets that a user has liked, or like and unlike a Tweet.
Hide replies Hide or unhide a reply to a Tweet.
Users User lookup Look up users by name or ID.
Follows Retrieve an account's followers, retrieve a list of who an account is following, or follow and unfollow a user.
Blocks Retrieve a list of users that an account has blocked, or block and unblock a user.
Mutes Retrieve a list of users that an account has muted, or mute and unmute a user
Spaces Lookup Spaces Lookup a Space using IDs or a creator's username
Search Spaces Search for a Space using a keyword
Compliance Batch compliance Batch upload dataset to understand what action is needed to ensure that your datasets reflect the current state of the content on Twitter.

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.

 

Step-by-step guide to make your first request

Make your first request to v2 of the Twitter API using recent search.

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.

Need help?

Visit our support section, where you can find troubleshooting tips, contact details, live API status monitor, and other helpful information that can help you understand how to overcome any obstacle.

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

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