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. |
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 as state , host_id , is_ticketed , and even lang . |
Lists | The List object contains basic information about the requested list including description , member_count , and owner_id . |
Media | If a Tweet contains media (such as images), then the media object can be requested using the media.fields parameter and includes fields such as the media_key , type , url , preview_image_url , and more. |
Poll | A poll included in a Tweet is not a primary object on any endpoint, but can be found and expanded in the Tweet object. |
Place | The place object consists of fields such as place_id , geo object, country_code , and more. This information can be used to identify Tweets and study Tweets by location. |
id
and text
fields as its default.
If you would like to retrieve additional fields with your request, you will have to use the fields and expansions parameters. The expansions parameter enables you to retrieve related data objects such as a user’s pinned Tweet or a media object, while the field operators enable you to request specific fields within returned objects beyond the defaults.
Here is a full list of expansions that you can request with the different X API v2 endpoints:
Object / Resource | Available Expansions |
---|---|
Tweets | author_id , edit_history_tweet_ids , entities.mentions.username , in_reply_to_user_id , referenced_tweets.id , referenced_tweets.id.author_id , attachments.poll_ids , attachments.media_keys , geo.place_id |
Users | pinned_tweet_id |
Spaces | invited_user_ids , speaker_ids , creator_id , host_ids , topic_ids |
Object | Available Metrics | Public Metrics | Private Metrics | Organic Metrics | Promoted Metrics |
---|---|---|---|---|---|
tweets | retweet_count | ✔️ | ✔️ | ✔️ | |
quote_count | ✔️ | ||||
like_count | ✔️ | ✔️ | ✔️ | ||
reply_count | ✔️ | ✔️ | ✔️ | ||
impression_count | ✔️ | ✔️ | ✔️ | ||
url_profile_clicks | ✔️ | ✔️ | ✔️ | ||
url_link_clicks | ✔️ | ✔️ | ✔️ | ||
user | follower_count | ✔️ | |||
user | following_count | ✔️ | |||
media | view_count | ✔️ | |||
media | playback_0_count | ✔️ | |||
space | participant_count | ✔️ |