The latest version of the X API v2 is a big deal. As such, we’ve broken this migration section into a few partitions:Documentation Index
Fetch the complete documentation index at: https://docs.x.com/llms.txt
Use this file to discover all available pages before exploring further.
| What’s new with X API v2 | Learn about the new endpoints and functionality that we’ve released to X API v2. |
|---|---|
| Ready to migrate? | Get started with your migration with a set of guides and instructions. |
| Data format migration guide | Learn how to rework your data parsers that previously worked with the standard v1.1, and enterprise data formats. |
| X API endpoint map | See how standard v1.1, and enterprise endpoints map to the new X API v2 endpoints. |
What is the X API v2?
The X API v2 is now the primary X API, and is where product investment and innovation are focused. We’ve partnered with developers to build the next generation of the X API to better serve our diverse community of developers. Based on developer feedback, we’ve re-built the API to better serve a broader collection of needs, introduced new features and endpoints, and improved upon the developer experience. The X API v2 is now the primary X API, and is where product investment and innovation are focused. Over the past few years, we partnered with developers and re-built the API to better serve a broader collection of needs, introduce new features and endpoints, and improve upon the developer experience. We are committed to continuing to build an open developer platform, and are excited to see what you build with the X API v2.Why migrate?
The X API v2 is built with a modern and more sustainable foundation and includes both improved replacement endpoints for the standard v1.1, and enterprise products, but also net-new functionality. We strongly encourage customers of legacy APIs (v1.1, and enterprise) to begin to migrate to v2 as we do intend to deprecate them eventually. Use the X API to listen to and analyze the public conversation, engage with people on X, and innovate. In this section, we will discuss the endpoints and functionality.V2 endpoints
You can see a full list of v2 endpoints and their pre-v2 equivalent via the following guide: While most of the endpoints in X API v2 are replacements, we have introduced several new endpoints. Here are several examples of new endpoints that we’ve released to v2:- Spaces endpoints to help people get more out of X Spaces, and to allow developers to help shape the future of audio conversations.
- Hide replies, which allows you to build tools that help limit the impact of abusive, distracting, or misleading replies at scale.
- New Lists endpoints that allow you to pin and unpin Lists, or look up someone’s pinned Lists.
- New batch compliance endpoints that allow you to ensure your stored user and Tweet data is in compliance.
New Functionality
X API v2 also includes new features that will help you find more value with the X API. A lot of what is new has been driven by your feedback and includes certain features that were reserved for enterprise customers previously. Some of the improvements to the API include:- A consistent design across endpoints
- The ability to specify which fields and objects return in the response payload
- New and more detailed data objects
- Receive and filter data with new contextual information powered by Tweet annotations
- Access to new metrics
- Easily identify and filter for conversations that belong to a reply thread
- Advanced functionality and increased access to data for academic researchers
- Recovery and redundancy functionality for streaming endpoints
- Easily return counts of Tweets that match a query
- Support for Edit Tweets
- High confidence spam filtering
- Shortened URLs are fully unwound for more effective filtering and 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 search Tweets, Tweet counts, and filtered stream
- OpenAPI spec to build new libraries & more transparently track changes
Discover New and Updated Response Objects
The following six data objects are available with the v2 endpoints:| Object | Description |
|---|---|
| Tweet | The Tweet object has a long list of root-level fields, such as id, text, and created_at. Tweet objects are also the parent object to several child objects including user, media, poll, and place. |
| User | The user object contains X user account metadata describing the referenced user. |
| Spaces | The Space object consists of fields such |