Retweets
Retweeting is one of the core features people use to engage in the public conversation on X. With the Retweets lookup endpoints, you can see a list of accounts that Retweeted a given POst. In addition, the new manage Retweets endpoints allow you to Retweet a Post or undo a Retweet.
Introduction
Account setup
To access these endpoints, you will need:
- An approved developer account.
- To authenticate using the keys and tokens from a developer App that is located within a Project.
Learn more about getting access to the X API v2 endpoints in our getting started guide.
Retweets lookup
With the Retweets lookup endpoint, you can retrieve a list of accounts that have Retweeted a Post. For this endpoint, pagination tokens will be provided for paging through large sets of results in batches of up to 100 users.
You can authenticate these endpoints with either OAuth 1.0a User Context, [OAuth 2.0 App-Only](https://developer.twitter.com(/resources/fundamentals/authentication#app-only-authentication-and-oauth-2-0-bearer-token), or OAuth 2.0 Authorization Code with PKCE.
Retweets of Me
The Reposts of Me lookup allows you to see which of your own Posts have been shared by others.
This provides users with insight into which of their Posts are being shared and resonating with their audience, which can help facilitate more targeted interactions and content strategy adjustments.
You can authenticate these endpoints with either either OAuth 1.0a User Context or OAuth 2.0 Authorization Code with PKCE.
Manage Retweets
The manage Retweets endpoints enable you to Retweet or undo a Retweet of a specified Post on behalf of an authenticated account. For this endpoint group, there are two methods available POST and DELETE. The POST method allows you to Retweet a Post, and the DELETE method will enable you to undo a Retweet of a given Post.
Since you are making requests on behalf of a user, you must authenticate these endpoints with either OAuth 1.0a User Context or OAuth 2.0 Authorization Code with PKCE, and utilize the user Access Tokens associated with the user you are making the request on behalf of. You can generate this user Access Token using the 3-legged OAuth flow (OAuth 1.0a) or using the Authorization Code with PKCE grant flow) (OAuth 2.0). You can Retweet a Post from your account or an account of an authenticated user. With both endpoints, there is a user rate limit of 50 requests per 15 minutes per endpoint.
Quick start
Getting started with the Retweets lookup endpoint
This quick start guide will help you make your first request to the Retweets lookup endpoint using Postman. If you would like to see sample code in different languages, please visit our X API v2 sample code GitHub repository.
Prerequisites
To complete this guide, you will need to have a set of keys and tokens to authenticate your request. You can generate these keys and tokens by following these steps:
- Sign up for a developer account and receive approval.
- Create a Project and an associated developer App in the developer portal.
- Navigate to your App’s “Keys and tokens” page to generate the required credentials. Make sure to save all credentials in a secure location.
Steps to build a Retweets lookup request
Step one: Start with a tool or library
There are several different tools, code examples, and libraries that you can use to make a request to this endpoint, but we will use the Postman tool here to simplify the process.
To load the X API v2 Postman collection into your environment, please click on the following button:
Once you have the X API v2 collection loaded in Postman, navigate to the “Retweets” folder and select “Retweeted by.”
Step two: Authenticate your request
To properly make a request to the X API, you need to verify that you have permission. To do so, this endpoint requires you to authenticate your request with either OAuth 2.0 App-Only, OAuth 2.0 Authorization Code with PKCE, or OAuth 1.0a User Context authentication methods.
For simplicity’s sake, we will utilize OAuth 2.0 App-Only with this request, but you will need to use one of the other authentication methods if you’d like to request private metrics or Retweets.
To utilize OAuth 2.0 App-Only, you must add your keys and tokens, specifically theApp Access Token (also known as the App-only Bearer Token) to Postman. You can do this by selecting the environment named “X API v2” in the top-right corner of Postman and adding your keys and tokens to the “initial value” and “current value” fields (by clicking the eye icon next to the environment dropdown).
These variables will automatically be pulled into the request’s authorization tab if you’ve done this correctly.
Step three: Specify a Post
With this endpoint, you must specify the Post ID that you want to get Retweeting users of. You can find the ID of a Post by navigating to that Post on X and pulling the numerical code at the end of the URL. For example, the following URL’s Post ID is 1354143047324299264.
https://twitter.com/TwitterDev/status/1354143047324299264
In Postman, navigate to the “Params” tab and enter this username into the “Value” column of the id path variable (at the bottom of the section), making sure to not include any spaces before or after usernames.
Key | Value |
id | The Post ID you want to get the Reweeting users of |
Step four: Identify and specify which fields you would like to retrieve
If you click the “Send” button after step three, you will receive the default user object fields in your response: id, name, and username.
If you would like to receive additional fields beyond id, name, and username, you will have to specify those fields in your request with the fields and/or expansions parameters.
For this exercise, we will request three additional sets of fields from different objects:
- The additional user.created_at field in the primary user objects.
- The associated pinned Posts’ object’s default fields for the returned users: id and text.
- The additional tweet.created_at field in the associated Post objects.
In Postman, navigate to the “Params” tab and add the following key:value pair to the “Query Params” table:
Key | Value | Returned fields |
user.fields | created_at | user.created_at |
expansions | pinned_tweet_id | tweet.id, tweet.text |
tweet.fields | created_at | tweet.created_at |
You should now see the following URL next to the “Send” button:
https://api.x.com/2/tweets/1354143047324299264/retweeted_by?user.fields=created_at&expansions=pinned_tweet_id&tweet.fields=created_at
Step five: Make your request and review your response
Once you have everything set up, hit the “Send” button and you will receive a similar response to the following example response:
Getting started with the manage Retweets endpoints
This quick start guide will help you make your first request to the manage Retweets endpoints using Postman.
If you would like to see sample code in different languages, please visit our X API v2 sample code GitHub repository.
Prerequisites
To complete this guide, you will need to have a set of keys and tokens to authenticate your request. You can generate these keys and tokens by following these steps:
- Sign up for a developer account and receive approval.
- Create a Project and an associated developer App in the developer portal.
- Navigate to your App’s “Keys and tokens” page to generate the required credentials. Make sure to save all credentials in a secure location.
Steps to build a manage Retweets request
Step one: Start with a tool or library
There are several different tools, code examples, and libraries that you can use to make a request to this endpoint, but we are going to use the Postman tool here to simplify the process.
To load the X API v2 Postman collection into your environment, please click on the following button:
Once you have the X API v2 collection loaded in Postman, navigate to the “Retweets” folder, and select “Retweet a Post”.
Step two: Authenticate your request
To properly make a request to the X API, you need to verify that you have permission. To do so with this endpoint, you must authenticate your request using either OAuth 1.0a User Context or OAuth 2.0 Authorization Code with PKCE.
In this example, we are going to use OAuth 1.0a User Context.
You must add your keys and tokens – specifically your API Key, API Secret Key, OAuth 1.0a user Access Token, and OAuth 1.0a user Access Token Secret – to Postman. You can do this by selecting the environment named “X API v2” in the top-right corner of Postman and adding your keys and tokens to the “initial value” and “current value” fields (by clicking the eye icon next to the environment dropdown).
These variables will automatically be pulled into the request’s authorization tab if you’ve done this correctly.
Step three: Specify which Post you are going to Retweet
Manage Retweets endpoints require two IDs: one for the user who wishes to Retweet or undo a Retweet and the id of the Post.
The user’s ID must correspond to the authenticating user’s ID, meaning that you must pass the Access Tokens associated with the user ID when authenticating your request. In this case, you can specify the ID belonging to your own user. You can find your ID in two ways:
- Using the user lookup by username endpoint, you can pass a username and receive the id field.
- Looking at your Access Token, you will find that the numeric part is your user ID.
You also must specify a Post that you want to Retweet. You can find the Post ID by navigating to X.com and clicking on a Post and then looking in the URL. For example, the following URL’s Post ID is 1228393702244134912.
https://twitter.com/TwitterDev/status/1228393702244134912
In Postman, navigate to the “Params” tab, and enter your ID into the “Value” column of the id path variable. and enter the ID of the Post you wish to Retweet as the value for thetweet_id parameter. Be sure not to include any spaces before or after any ID.
Key | Value |
id | (your user ID) |
tweet_id | (the ID of the Tweet you want to Retweet) |
If you click the “Send” button, you will receive a response object containing the status of the relationship:
- If you receive a “retweeted”: true, then the id is successfully Retweeting the tweet_id.
Step four: Make your request and review your response
Once you have everything set up, hit the “Send” button and you will receive the following response:
If you receive a "retweeted": true
has successfully Retweeted the tweet_id
If you wish to undo a Retweet by the same user you can use the request entitled “Undo a Retweet”, which is also found in the “Retweets” folder of the X API v2 collection loaded in Postman. The id
should be your user ID and source_tweet_id
should be the Post ID to undo the Retweet of. You will not have to add this as a JSON body so you will want to make sure that you add in the requisite query params for id and source_tweet_id
.
On a successful undoing of a Retweet, you will receive a similar response to the following example:
Retweets of Me
The Reposts of Me lookup allows you to see which of your own Posts have been shared by others.
This provides users with insight into which of their Posts are being shared and resonating with their audience, which can help facilitate more targeted interactions and content strategy adjustments.
Authentication
Since you are making requests on behalf of a user, you must authenticate these endpoints with either OAuth 1.0a User Context or OAuth 2.0 Authorization Code with PKCE, and utilize the user Access Tokens associated with the user you are making the request on behalf of. You can generate this user Access Token using the 3-legged OAuth flow (OAuth 1.0a) or using the Authorization Code with PKCE grant flow (OAuth 2.0).
Making a request
Once a user has authenticated with your app, you can call the Retweets of Me API on behalf of user as shown below:
If the request is successful, you should see the JSON response as shown below:
Integration guide
This page contains information on several tools and key concepts that you should be aware of as you integrate the Retweet endpoints into your system. We’ve broken the page into a couple of different sections:
- Helpful tools
- Key Concepts
- Authentication
- Developer portal, Projects, and Apps
- Rate limits
- Fields and expansions
Helpful tools
Before we dive into some key concepts that will help you integrate this endpoint, we recommend that you become familiar with:
Postman
Postman is a great tool that you can use to test out an endpoint. Each Postman request includes every path and body parameter to help you quickly understand what is available to you. To learn more about our Postman collections, please visit our “Using Postman” page.
Code samples
Interested in getting set up with this endpoint with some code in your preferred coding language? We’ve got a handful of different code samples available that you can use as a starting point on our Github page.
Third-party libraries
Take advantage of one of our communities’ third-party libraries to help you get started. You can find a library that works with the v2 endpoints by looking for the proper version tag.
Key concepts
Authentication
All X API v2 endpoints require for you to authenticate your requests with a set of credentials, also known as keys and tokens.
You can use either OAuth 1.0a User Context or OAuth 2.0 Bearer Token to authenticate your requests to the Retweets lookup endpoint.
The manage Retweets endpoints require the use of OAuth 1.0a User Context, which means that you must use a set of API keys and user access tokens to make a successful request. The access tokens must be associated with the user that you are making the request on behalf of. If you would like to generate a set of access tokens for another user, they must authorize or authenticate your App using the 3-legged OAuth flow.
Please note that OAuth 1.0a can be tricky to use. If you are not familiar with this authentication method, we recommend that you use a library to properly authenticate your requests.
Please note
If you are requesting the following fields, OAuth 1.0a User Context is required:
- tweet.fields.non_public_metrics
- tweet.fields.promoted_metrics
- tweet.fields.organic_metrics
- media.fields.non_public_metrics
- media.fields.promoted_metrics
- media.fields.organic_metrics
Developer portal, Projects, and developer Apps
To retrieve a set of authentication credentials that will work with the X API v2 endpoints, you must sign up for a developer account, set up a Project within that account, and created a developer App within that Project. You can then find your keys and tokens within your developer App.
Rate limits
Every day, many thousands of developers make requests to the X API. To help manage the sheer volume of these requests, rate limits are placed on each endpoint that limits the number of requests that you can make on behalf of your app or on behalf of an authenticated user.
The manage Retweets endpoints are limited to 50 requests per 15 min (per user). Additionally, for the POST endpoint, you are limited to 300 requests per 3-hour window (per user, per app).
With the Retweets lookup endpoint, you are limited to 75 requests per 15-min window. Additionally, only the 100 most recent Retweeting users will be returned by this endpoint.
Fields and expansions
The X API v2 allows users to select exactly which data they want to return from the API using a set of tools called fields and expansions. The expansion parameter allows you to expand objects referenced in the payload. For example, this endpoint allows you to pull the following expansions:
- attachments.poll_ids
- attachments.media_keys
- author_id, entities.mentions.username
- geo.place_id
- in_reply_to_user_id,
- referenced_tweets.id,
- referenced_tweets.id.author_id
The fields parameter allows you to select exactly which fields within the different data objects you would like to receive. These endpoints delivers Post objects primarily. By default, the Post object returns the id and text fields. To receive additional fields such as tweet.created_at or tweet.entities, you will have to specifically request those using a fields parameter. Some important fields that you may want to consider using in your integration are our poll data, metrics, Post annotations, and conversation ID fields.
We’ve added a guide on how to use fields and expansions together to our X API v2 data dictionary.
Comparing X API’s Retweets endpoints
Retweets lookup
The v2 Retweets lookup endpoint will replace the standard v1.1 GET statuses/retweets/:id and v1.1 GET statuses/retweets/:ids endpoints.
The following tables compare the standard v1.1 and X API v2 Retweets endpoints:
Description | Standard v1.1 | X API v2 |
---|---|---|
HTTP methods supported | GET | GET |
Host domain | https://api.x.com | https://api.x.com |
Endpoint path | /1.1/retweeters/id.json/1.1/retweets/ids.json | /2/users/:id/retweeted_by |
Authentication | OAuth 1.0a User Context | OAuth 2.0 Bearer Token OAuth 1.0a User Context |
Default request rate limits | 75 requests per 15 min | 75 requests per 15 min (per App) 75 requests per 15 min (per user) |
Data format | Standard v1.1 format | X API v2 format (determined by fields and expansions request parameters, not backward-compatible with v1.1 formats) To learn more about how to migrate from the Standard v1.1 format to the X API v2 format, please visit our data formats migration guide. |
Requires the use of credentials from a developer App that is associated with a Project | ✔️ |
Manage Retweets
The following tables compare the standard v1.1 and X API v2 undo Retweet endpoint:
Retweet a Post
Description | Standard v1.1 | X API v2 |
---|---|---|
HTTP methods supported | POST | POST |
Host domain | https://api.x.com | https://api.x.com |
Endpoint path | /1.1/statuses/retweet/:id.json | /2/users/:id/retweets |
Authentication | OAuth 1.0a User Context | OAuth 1.0a User Context |
Default request rate limits | None 300 requests per 3-hour window (per user, per app). This is shared with the POST Tweet endpoint | 50 requests per 15 min (per user) 300 requests per 3-hour window (per user, per app). This is shared with the POST Tweet endpoint for manage Posts. |
Requires the use of credentials from a developer App that is associated with a Project | ✔️ |
Undo a Retweet
The following tables compare the standard v1.1 and X API v2 undo Retweet endpoint:
Description | Standard v1.1 | X API v2 |
---|---|---|
HTTP methods supported | POST | DELETE |
Host domain | https://api.x.com | https://api.x.com |
Endpoint path | /1.1/statuses/unretweet/:id.json | /2/users/:id/retweets/:source_tweet_id |
Authentication | OAuth 1.0a User Context | OAuth 1.0a User Context |
Default request rate limits | None | 50 requests per 15 min (per user) |
Requires the use of credentials from a developer App that is associated with a Project | ✔️ |
Other migration resources
Retweets lookup: Standard v1.1 to X API v2
Manage Retweets: Standard v1.1 to X API v2
Retweets
Retweets lookup: Standard v1.1 compared to X API v2
If you have been working with the standard v1.1 v1.1 GET statuses/retweets/:id, v1.1 GET statuses/retweets/:ids, the goal of this guide is to help you understand the similarities and differences between the standard v1.1 and X API v2 Retweets lookup endpoints.
- Similarities
- Authentiation
- Users per request limits
- Differences
-
Endpoint URLs
-
Request limitations
-
App and Project requirements
-
Response data format
-
Request parameters
-
Similarities
Authentication
Both the standard v1.1 and X API v2 Retweets lookup endpoints (v1.1 GET statuses/retweets/:id and v1.1 GET statuses/retweeters/:ids) use OAuth 1.0a User Context or OAuth 2.0 Bearer Token.
Users per request limits
For both v1.1 and v2 GET endpoints the max number of users that will be returned by the Retweets lookup endpoint is 100 users. For the v2 Retweets lookup endpoint, there is no pagination token being passed, by default we give out 100 users and that’s the max that is returned.
Differences
Endpoint URLs
- Standard v1.1 endpoints:
- https://api.x.com/1.1/statuses/retweets/:id.json
(Returns a collection of the 100 most recent Retweets of the Post specified by the
id
parameter) https://api.x.com/1.1/statuses/retweeters/ids.json
(Returns a collection of up to 100 user IDs belonging to users who have Retweeted the Post specified by theid
parameter)
- https://api.x.com/1.1/statuses/retweets/:id.json
(Returns a collection of the 100 most recent Retweets of the Post specified by the
- X API v2 endpoint:
- https://api.x.com/2/tweets/:id/retweeted_by (Returns a list of accounts who have Retweeted a given Post)
App and Project requirements
The X API v2 endpoints require that you use credentials from a developer App that is associated with a Project when authenticating your requests. All X API v1.1 endpoints can use credentials from standalone Apps or Apps associated with a project.
Response data format
One of the biggest differences between standard v1.1 and X API v2 endpoint versions is how you select which fields return in your payload.
For the standard endpoints, you receive many of the response fields by default, and then have the option to use parameters to identify which fields or sets of fields should return in the payload.
The X API v2 version only delivers the user id , name, and username fields by default. To request any additional fields or objects, you wil need to use the fields and expansions parameters. Any user fields that you request from this endpoint will return in the primary user object. Any expanded Post object and fields will return in an includes object within your response. You can then match any expanded objects back to the user object by matching the IDs located in both the user and the expanded Post object.
We encourage you to read more about these new parameters in their respective guides, or by reading our guide on how to use fields and expansions.
We have also put together a data format migration guide which can help you map standard v1.1 fields to the newer v2 fields. This guide will also provide you the specific expansion and field parameter that you will need to pass with your v2 request to return specific fields.
In addition to the changes in how you request certain fields, X API v2 is also introducing new JSON designs for the objects returned by the APIs, including Post and user objects.
- At the JSON root level, the standard endpoints return Post objects in a statuses array, while X API v2 returns a data array.
- Instead of referring to Retweeted and Quoted “statuses”, X API v2 JSON refers to Retweeted and Quoted Tweets. Many legacy and deprecated fields, such as contributors and user.translator_type are being removed.
- Instead of using both favorites (in Post object) and favourites (in user object), X API v2 uses the term like.
- X is adopting the convention that JSON values with no value (for example, null) are not written to the payload. Post and user attributes are only included if they have a non-null values.
We also introduced a new set of fields to the Post object including the following:
- A conversation_id field
- Two new annotations fields, including context and entities
- Several new metrics fields
- A new reply_setting field, which shows you who can reply to a given Post
Request parameters
The following standard v1.1 request parameters accepted two request query parameters (user_id or screen_name). The X API v2 only accepts the numerical user ID, and it must be passed as part of the endpoint path.
Manage Retweets: Standard v1.1 compared to X API v2
If you have been working with the standard v1.1 POST statuses/retweet/:id, and POST statuses/unretweet/:id endpoints, the goal of this guide is to help you understand the similarities and differences between the standard and X API v2 Retweets endpoints.
- Similarities
- Authentication
- Differences
- Endpoint URLs and HTTP methods
- Request limitations
- App and Project requirements
- Request parameters
Similarities
Authentication
Both the standard v1.1 and X API v2 manage Retweets (POST statuses/retweet/:id, and POST statuses/unretweet/:id) endpoints use OAuth 1.0a User Context. Therefore, if you were previously using one of the standard v1.1 Retweets lookup endpoints, you can continue using the same authentication method if you migrate to the X API v2 version.
Differences
Endpoint URLs and HTTP methods
- Standard v1.1 endpoints:
- https://api.x.com/1.1/statuses/retweet/:id.json (Retweets a Post. Returns the original Post with Retweet details embedded)
- https://api.x.com/1.1/statuses/unretweet/:id.json (Undo a Retweet. Returns the original Post with Retweet details embedded)
- X API v2 endpoint:
- https://api.x.com/2/tweets/:id/retweets (Retweets a given Post)
- https://api.x.com/2/users/:id/retweets/:source\_tweet\_id (Undo a Retweet of a given Post)
App and Project requirements
The X API v2 endpoints require that you use credentials from a developer App that is associated to a Project when authenticating your requests. All X API v1.1 endpoints can use credentials from standalone Apps or Apps associated with a Project.
Request parameters
The following standard v1.1 request parameters accepted two request query parameters (user_id or screen_name). The X API v2 only accepts the numerical user ID, and it must be passed as part of the endpoint path.
Standard v1.1 | X API v2 |
---|---|
id | id |
includes_entities | No equivalent |
Please note that the Standard v1.1 parameters are passed as query parameters, whereas the X API v2 parameters are passed as body parameters for the POST endpoint or path parameters for the DELETE endpoint.
Also, an id of the user Retweeting a Post is not required when using the standard v1.1 endpoints since the Access Tokens passed with OAuth 1.0a User Context infer which user is initiating the Retweet/undoing a Retweet.
API reference index
For the complete API reference, select an endpoint from the list:
Retweets lookup
Users who have Retweeted a Post | [GET /2/tweets/:id/retweeted_by]/x-api/x-api-v2/tweets/retweets#get-2-tweets-id-retweeted-by) |
Retweets of a Post | GET /2/tweets/:id/retweets |
Manage Retweets
Allows a user ID to Retweet a Post | [POST /2/users/:id/retweets](/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets) |
Allows a user ID to undo a Retweet | [DELETE /2/users/:id/retweets/:source_tweet_id](/en/docs/twitter-api/tweets/retweets/api-reference/delete-users-id-retweets-tweet_id) |
GET /2/tweets/:id/retweeted_by
Allows you to get information about who has Retweeted a Tweet.
Endpoint URL
https://api.x.com/2/tweets/:id/retweeted_by
Authentication and rate limits
Authentication methods supported by this endpoint | OAuth 2.0 Authorization Code with PKCE OAuth 1.0a is also available for this endpoint. OAuth 2.0 App-only |
Rate limit | App rate limit (Application-only): 75 requests per 15-minute window shared among all users of your app User rate limit (User context): 75 requests per 15-minute window per each authenticated user |
OAuth 2.0 scopes required by this endpoint
tweet.read users.read |
Learn more about OAuth 2.0 Authorization Code with PKCE |
Path parameters
Name | Type | Description |
---|---|---|
id Required | string | Tweet ID of the Tweet to request Retweeting users of. |
Query parameters
Name | Type | Description |
---|---|---|
expansions Optional | enum (pinned_tweet_id ) | Expansions enable you to request additional data objects that relate to the originally returned users. The ID that represents the expanded data object will be included directly in the user data object, but the expanded object metadata will be returned within the includes response object, and will also include the ID so that you can match this data object to the original Tweet object. At this time, the only expansion available to endpoints that primarily return user objects is expansions=pinned_tweet_id . You will find the expanded Tweet data object living in the includes response object. |
max_results Optional | integer | The maximum number of results to be returned per page. This can be a number between 1 and 100. By default, each page will return 100 results. |
pagination_token Optional | string | Used to request the next page of results if all results weren’t returned with the latest request, or to go back to the previous page of results. To return the next page, pass the next_token returned in your previous response. To go back one page, pass the previous_token returned in your previous response. |
tweet.fields Optional | enum (attachments , author_id , context_annotations , conversation_id , created_at , edit_controls , entities , geo , id , in_reply_to_user_id , lang , non_public_metrics , public_metrics , organic_metrics , promoted_metrics , possibly_sensitive , referenced_tweets , reply_settings , source , text , withheld ) | This fields parameter enables you to select which specific Tweet fields will deliver in each returned pinned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. The Tweet fields will only return if the user has a pinned Tweet and if you’ve also included the expansions=pinned_tweet_id query parameter in your request. While the referenced Tweet ID will be located in the original Tweet object, you will find this ID and all additional Tweet fields in the includes data object. |
user.fields Optional | enum (created_at , description , entities , id , location , most_recent_tweet_id , name , pinned_tweet_id , profile_image_url , protected , public_metrics , url , username , verified , verified_type , withheld ) | This fields parameter enables you to select which specific user fields will deliver with each returned users objects. Specify the desired fields in a comma-separated list without spaces between commas and fields. These specified user fields will display directly in the user data objects. |
Example code with offical SDKs
Example responses
Response fields
Name | Type | Description |
---|---|---|
id Default | string | Unique identifier of this user. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. |
name Default | string | The friendly name of this user, as shown on their profile. |
username Default | string | The Twitter handle (screen name) of this user. |
created_at | date (ISO 8601) | Creation time of this account. To return this field, add user.fields=created_at in the request’s query parameter. |
protected | boolean | Indicates if this user has chosen to protect their Tweets (in other words, if this user’s Tweets are private). To return this field, add user.fields=protected in the request’s query parameter. |
withheld | object | Contains withholding details for withheld content. To return this field, add user.fields=withheld in the request’s query parameter. |
withheld.country_codes | array | Provides a list of countries where this user is not available. To return this field, add user.fields=withheld.country_codes in the request’s query parameter. |
withheld.scope | enum (tweet , user ) | Indicates whether the content being withheld is a Tweet or a user (this API will return user ). To return this field, add user.fields=withheld.scope in the request’s query parameter. |
location | string | The location specified in the user’s profile, if the user provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries. To return this field, add user.fields=location in the request’s query parameter. |
url | string | The URL specified in the user’s profile, if present. To return this field, add user.fields=url in the request’s query parameter. |
description | string | The text of this user’s profile description (also known as bio), if the user provided one. To return this field, add user.fields=description in the request’s query parameter. |
verified | boolean | Indicate if this user is a verified Twitter user. To return this field, add user.fields=verified in the request’s query parameter. |
entities | object | This object and its children fields contain details about text that has a special meaning in the user’s description. To return this field, add user.fields=entities in the request’s query parameter. |
entities.url | array | Contains details about the user’s profile website. |
entities.url.urls | array | Contains details about the user’s profile website. |
entities.url.urls.start | integer | The start position (zero-based) of the recognized user’s profile website. All start indices are inclusive. |
entities.url.urls.end | integer | The end position (zero-based) of the recognized user’s profile website. This end index is exclusive. |
entities.url.urls.url | string | The URL in the format entered by the user. |
entities.url.urls.expanded_url | string | The fully resolved URL. |
entities.url.urls.display_url | string | The URL as displayed in the user’s profile. |
entities.description | array | Contains details about URLs, Hashtags, Cashtags, or mentions located within a user’s description. |
entities.description.urls | array | Contains details about any URLs included in the user’s description. |
entities.description.urls.start | integer | The start position (zero-based) of the recognized URL in the user’s description. All start indices are inclusive. |
entities.description.urls.end | integer | The end position (zero-based) of the recognized URL in the user’s description. This end index is exclusive. |
entities.description.urls.url | string | The URL in the format entered by the user. |
entities.description.urls.expanded_url | string | The fully resolved URL. |
entities.description.urls.display_url | string | The URL as displayed in the user’s description. |
entities.description.hashtags | array | Contains details about text recognized as a Hashtag. |
entities.description.hashtags.start | integer | The start position (zero-based) of the recognized Hashtag within the Tweet. All start indices are inclusive. |
entities.description.hashtags.end | integer | The end position (zero-based) of the recognized Hashtag within the Tweet. This end index is exclusive. |
entities.description.hashtags.hashtag | string | The text of the Hashtag. |
entities.description.mentions | array | Contains details about text recognized as a user mention. |
entities.description.mentions.start | integer | The start position (zero-based) of the recognized user mention within the Tweet. All start indices are inclusive. |
entities.description.mentions.end | integer | The end position (zero-based) of the recognized user mention within the Tweet. This end index is exclusive. |
entities.description.mentions.username | string | The part of text recognized as a user mention. |
entities.description.cashtags | array | Contains details about text recognized as a Cashtag. |
entities.description.cashtags.start | integer | The start position (zero-based) of the recognized Cashtag within the Tweet. All start indices are inclusive. |
entities.description.cashtags.end | integer | The end position (zero-based) of the recognized Cashtag within the Tweet. This end index is exclusive. |
entities.description.cashtags.cashtag | string | The text of the Cashtag. |
profile_image_url | string | The URL to the profile image for this user, as shown on the user’s profile. |
public_metrics | object | Contains details about activity for this user. |
public_metrics.followers_count | integer | Number of users who follow this user. |
public_metrics.following_count | integer | Number of users this user is following. |
public_metrics.tweet_count | integer | Number of Tweets (including Retweets) posted by this user. |
public_metrics.listed_count | integer | Number of lists that include this user. |
pinned_tweet_id | string | Unique identifier of this user’s pinned Tweet. You can obtain the expanded object in includes.tweets by adding expansions=pinned_tweet_id in the request’s query parameter. |
includes.tweets | array | When including the expansions=pinned_tweet_id parameter, this includes the pinned Tweets attached to the returned users’ profiles in the form of Tweet objects with their default fields and any additional fields requested using the tweet.fields parameter, assuming there is a referenced Tweet present in the returned Tweet(s). |
errors | object | Contains details about errors that affected any of the requested users. See Status codes and error messages for more details. |
POST /2/users/:id/retweets
Causes the user ID identified in the path parameter to Retweet the target Tweet.
Endpoint URL
https://api.x.com/2/users/:id/retweets
Authentication and rate limits
Authentication methods supported by this endpoint | OAuth 2.0 Authorization Code with PKCE OAuth 1.0a is also available for this endpoint. |
Rate limit | User rate limit (User context): 50 requests per 15-minute window per each authenticated user |
OAuth 2.0 scopes required by this endpoint
tweet.read tweet.write users.read |
Learn more about OAuth 2.0 Authorization Code with PKCE |
Path parameters
Name | Type | Description |
---|---|---|
id Required | string | The user ID who you are Retweeting a Tweet on behalf of. It must match your own user ID or that of an authenticating user, meaning that you must pass the Access Tokens) associated with the user ID when authenticating your request. |
JSON body parameters
Name | Type | Description |
---|---|---|
tweet_id Required | string | The ID of the Tweet that you would like the user id to Retweet. |
Example code with offical SDKs
Example responses
Response fields
Name | Type | Description |
---|---|---|
retweeted | boolean | Indicates whether the user Retweets the specified Tweet as a result of this request. |
DELETE /2/users/:id/retweets/:source_tweet_id
Allows a user or authenticated user ID to remove the Retweet of a Tweet.
The request succeeds with no action when the user sends a request to a user they’re not Retweeting the Tweet or have already removed the Retweet of.
Build request with API Explorer ❯
Endpoint URL
https://api.x.com/2/users/:id/retweets/:source_tweet_id
Authentication and rate limits
Authentication methods supported by this endpoint | OAuth 2.0 Authorization Code with PKCE OAuth 1.0a is also available for this endpoint. |
Rate limit | User rate limit (User context): 50 requests per 15-minute window per each authenticated user |
OAuth 2.0 scopes required by this endpoint
tweet.read tweet.write users.read |
Learn more about OAuth 2.0 Authorization Code with PKCE |
Path parameters
Name | Type | Description |
---|---|---|
id Required | string | The user ID who you are removing a the Retweet of a Tweet on behalf of. It must match your own user ID or that of an authenticating user, meaning that you must pass the Access Tokens) associated with the user ID when authenticating your request. |
source_tweet_id Required | string | The ID of the Tweet that you would like the id to remove the Retweet of. |
Example code with offical SDKs
Example responses
Response fields
Name | Type | Description |
---|---|---|
retweeted | boolean | Indicates whether the user has removed the Retweet of the specified Tweet as a result of this request. The returned value is false for a successful unretweet request. |
GET /2/tweets/:id/retweets
Returns the Retweets for a given Tweet ID.
Endpoint URL
https://api.x.com/2/tweets/:id/retweets
Authentication and rate limits
Authentication methods supported by this endpoint | OAuth 2.0 Authorization Code with PKCE OAuth 1.0a is also available for this endpoint. OAuth 2.0 App-only |
Rate limit | App rate limit (Application-only): 75 requests per 15-minute window shared among all users of your app User rate limit (User context): 75 requests per 15-minute window per each authenticated user |
OAuth 2.0 scopes required by this endpoint
tweet.read users.read |
Learn more about OAuth 2.0 Authorization Code with PKCE |
Path parameters
Name | Type | Description |
---|---|---|
id Required | string | Unique identifier of the Tweet. |
Query parameters
Name | Type | Description |
---|---|---|
expansions Optional | enum (attachments.poll_ids , attachments.media_keys , author_id , edit_history_tweet_ids , entities.mentions.username , geo.place_id , in_reply_to_user_id , referenced_tweets.id , referenced_tweets.id.author_id ) | Expansions enable you to request additional data objects that relate to the originally returned Tweets. Submit a list of desired expansions in a comma-separated list without spaces. The ID that represents the expanded data object will be included directly in the Tweet data object, but the expanded object metadata will be returned within the includes response object, and will also include the ID so that you can match this data object to the original Tweet object. The following data objects can be expanded using this parameter: * The Tweet author’s user object * The user object of the Tweet’s author that the original Tweet is responding to * Any mentioned users’ object * Any referenced Tweets’ author’s user object * Attached media’s object * Attached poll’s object * Attached place’s object * Any referenced Tweets’ object (this includes Tweet objects for previous versions of an edited Tweet) |
max_results Optional | integer | Specifies the number of Tweets to try and retrieve, up to a maximum of 100 per distinct request. By default, 100 results are returned if this parameter is not supplied. The minimum permitted value is 5. It is possible to receive less than the max_results per request throughout the pagination process. |
media.fields Optional | enum (duration_ms , height , media_key , preview_image_url , type , url , width , public_metrics , non_public_metrics , organic_metrics , promoted_metrics , alt_text , variants ) | This fields parameter enables you to select which specific media fields will deliver in each returned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. The Tweet will only return media fields if the Tweet contains media and if you’ve also included the expansions=attachments.media_keys query parameter in your request. While the media ID will be located in the Tweet object, you will find this ID and all additional media fields in the includes data object. |
place.fields Optional | enum (contained_within , country , country_code , full_name , geo , id , name , place_type ) | This fields parameter enables you to select which specific place fields will deliver in each returned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. The Tweet will only return place fields if the Tweet contains a place and if you’ve also included the expansions=geo.place_id query parameter in your request. While the place ID will be located in the Tweet object, you will find this ID and all additional place fields in the includes data object. |
poll.fields Optional | enum (duration_minutes , end_datetime , id , options , voting_status ) | This fields parameter enables you to select which specific poll fields will deliver in each returned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. The Tweet will only return poll fields if the Tweet contains a poll and if you’ve also included the expansions=attachments.poll_ids query parameter in your request. While the poll ID will be located in the Tweet object, you will find this ID and all additional poll fields in the includes data object. |
tweet.fields Optional | enum (attachments , author_id , context_annotations , conversation_id , created_at , edit_controls , entities , geo , id , in_reply_to_user_id , lang , non_public_metrics , public_metrics , organic_metrics , promoted_metrics , possibly_sensitive , referenced_tweets , reply_settings , source , text , withheld ) | This fields parameter enables you to select which specific Tweet fields will deliver in each returned Tweet object. Specify the desired fields in a comma-separated list without spaces between commas and fields. You can also pass the expansions=referenced_tweets.id expansion to return the specified fields for both the original Tweet and any included referenced Tweets. The requested Tweet fields will display in both the original Tweet data object, as well as in the referenced Tweet expanded data object that will be located in the includes data object. |
user.fields Optional | enum (created_at , description , entities , id , location , most_recent_tweet_id , name , pinned_tweet_id , profile_image_url , protected , public_metrics , url , username , verified , verified_type , withheld ) | This fields parameter enables you to select which specific user fields will deliver in each returned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. While the user ID will be located in the original Tweet object, you will find this ID and all additional user fields in the includes data object. You must also pass one of the user expansions to return the desired user fields: * expansions=author_id * expansions=entities.mentions.username * expansions=in_reply_to_user_id * expansions=referenced_tweets.id.author_id |
Example code with offical SDKs
Example responses
Response fields
Name | Type | Description |
---|---|---|
id Default | string | Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. |
text Default | string | The content of the Tweet. To return this field, add tweet.fields=text in the request’s query parameter. |
created_at | date (ISO 8601) | Creation time of the Tweet. To return this field, add tweet.fields=created_at in the request’s query parameter. |
author_id | string | Unique identifier of this user. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. You can obtain the expanded object in includes.users by adding expansions=author_id in the request’s query parameter. |
edit_history_tweet_ids Default | array | Unique identifiers indicating all versions of an edited Tweet. For Tweets with no edits, there will be one ID. For Tweets with an edit history, there will be multiple IDs, arranged in ascending order reflecting the order of edit, with the most recent version in the last position of the array. |
edit_controls | object | Indicates if a Tweet is eligible for edit, how long it is editable for, and the number of remaining edits. The is_edit_eligible field indicates if a Tweet was eligible for edit when published. This field is not dynamic and won’t toggle from True to False when a Tweet reaches its editable time limit, or maximum number of edits. The following Tweet features will cause this field to be false:* Tweet is promoted * Tweet has a poll * Tweet is a non-self-thread reply * Tweet is a Retweet (note that Quote Tweets are eligible for edit) * Tweet is nullcast * Community Tweet * Superfollow Tweet * Collaborative Tweet { <br/> "edit_controls": { <br/> "is_edit_eligible": true, <br/> "editable_until": "2022-08-21 09:35:20.311", <br/> "edits_remaining": 4 <br/> } <br/>} <br/> Editable Tweets can be edited for the first 30 minutes after creation and can be edited up to five times. To return this field, add tweet.fields=edit_controls in the request’s query parameter. |
conversation_id | string | The Tweet ID of the original Tweet of the conversation (which includes direct replies, replies of replies). To return this field, add tweet.fields=conversation_id in the request’s query parameter. |
note_tweet | object | Information about Tweets with more than 280 characters. To return this field, add tweet.fields=note_tweet in the request’s query parameter. |
in_reply_to_user_id | string | If this Tweet is a Reply, indicates the user ID of the parent Tweet’s author. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. You can obtain the expanded object in includes.users by adding expansions=in_reply_to_user_id in the request’s query parameter. |
referenced_tweets | array | A list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Retweet with comment (also known as Quoted Tweet) or a Reply, it will include the related Tweet referenced to by its parent. To return this field, add tweet.fields=referenced_tweets in the request’s query parameter. |
referenced_tweets.type | enum (retweeted , quoted , replied_to ) | Indicates the type of relationship between this Tweet and the Tweet returned in the response: retweeted (this Tweet is a Retweet), quoted (a Retweet with comment, also known as Quoted Tweet), or replied_to (this Tweet is a reply). |
referenced_tweets.id | string | The unique identifier of the referenced Tweet. You can obtain the expanded object in includes.tweets by adding expansions=referenced_tweets.id in the request’s query parameter. |
attachments | object | Specifies the type of attachments (if any) present in this Tweet. To return this field, add tweet.fields=attachments in the request’s query parameter. |
attachments.media_keys | array | List of unique identifiers of media attached to this Tweet. These identifiers use the same media key format as those returned by the Media Library. You can obtain the expanded object in includes.media by adding expansions=attachments.media_keys in the request’s query parameter. |
attachments.poll_ids | array | List of unique identifiers of polls present in the Tweets returned. These are returned as a string in order to avoid complications with languages and tools that cannot handle large integers. You can obtain the expanded object in includes.polls by adding expansions=attachments.polls_ids in the request’s query parameter. |
geo | object | Contains details about the location tagged by the user in this Tweet, if they specified one. To return this field, add tweet.fields=geo in the request’s query parameter. |
geo.coordinates | object | Contains details about the coordinates of the location tagged by the user in this Tweet, if they specified one. To return this field, add tweet.fields=geo.coordinates in the request’s query parameter. |
geo.coordinates.type | string | Describes the type of coordinate. The only value supported at present is Point . |
geo.coordinates.coordinates | array | A pair of decimal values representing the precise location of the user (latitude, longitude). This value be null unless the user explicitly shared their precise location. |
geo.place_id | string | The unique identifier of the place, if this is a point of interest tagged in the Tweet. You can obtain the expanded object in includes.places by adding expansions=geo.place_id in the request’s query parameter. |
context_annotations | array | Contains context annotations for the Tweet. To return this field, add tweet.fields=context_annotations in the request’s query parameter. |
context_annotations.domain | object | Contains elements which identify detailed information regarding the domain classification based on Tweet text. |
context_annotations.domain.id | string | Contains the numeric value of the domain. |
context_annotations.domain.name | string | Domain name based on the Tweet text. |
context_annotations.domain.description | string | Long form description of domain classification. |
context_annotations.entity | object | Contains elements which identify detailed information regarding the domain classification bases on Tweet text. |
context_annotations.entity.id | string | Unique value which correlates to an explicitly mentioned Person, Place, Product or Organization |
context_annotations.entity.name | string | Name or reference of entity referenced in the Tweet. |
context_annotations.entity.description | string | Additional information regarding referenced entity. |
entities | object | Contains details about text that has a special meaning in a Tweet. To return this field, add tweet.fields=entities in the request’s query parameter. |
entities.annotations | array | Contains details about annotations relative to the text within a Tweet. |
entities.annotations.start | integer | The start position (zero-based) of the text used to annotate the Tweet. All start indices are inclusive. |
entities.annotations.end | integer | The end position (zero based) of the text used to annotate the Tweet. While all other end indices are exclusive, this one is inclusive. |
entities.annotations.probability | number | The confidence score for the annotation as it correlates to the Tweet text. |
entities.annotations.type | string | The description of the type of entity identified when the Tweet text was interpreted. |
entities.annotations.normalized_text | string | The text used to determine the annotation type. |
entities.urls | array | Contains details about text recognized as a URL. |
entities.urls.start | integer | The start position (zero-based) of the recognized URL within the Tweet. All start indices are inclusive. |
entities.urls.end | integer | The end position (zero-based) of the recognized URL within the Tweet. This end index is exclusive. |
entities.urls.url | string | The URL in the format tweeted by the user. |
entities.urls.expanded_url | string | The fully resolved URL. |
entities.urls.display_url | string | The URL as displayed in the Twitter client. |
entities.urls.unwound_url | string | The full destination URL. |
entities.hashtags | array | Contains details about text recognized as a Hashtag. |
entities.hashtags.start | integer | The start position (zero-based) of the recognized Hashtag within the Tweet. All start indices are inclusive. |
entities.hashtags.end | integer | The end position (zero-based) of the recognized Hashtag within the Tweet. |
entities.hashtags.tag | string | The text of the Hashtag. |
entities.mentions | array | Contains details about text recognized as a user mention. |
entities.mentions.start | integer | The start position (zero-based) of the recognized user mention within the Tweet. All start indices are inclusive. |
entities.mentions.end | integer | The end position (zero-based) of the recognized user mention within the Tweet. |
entities.mentions.username | string | The part of text recognized as a user mention. You can obtain the expanded object in includes.users by adding expansions=entities.mentions.username in the request’s query parameter. |
entities.cashtags | array | Contains details about text recognized as a Cashtag. |
entities.cashtags.start | integer | The start position (zero-based) of the recognized Cashtag within the Tweet. All start indices are inclusive. |
entities.cashtags.end | integer | The end position (zero-based) of the recognized Cashtag within the Tweet. |
entities.cashtags.tag | string | The text of the Cashtag. |
withheld | object | Contains withholding details for withheld content. To return this field, add tweet.fields=withheld in the request’s query parameter. |
withheld.copyright | boolean | Indicates if the content is being withheld for on the basis of copyright infringement. |
withheld.country_codes | array | Provides a list of countries where this content is not available. |
withheld.scope | enum (tweet , user ) | Indicates whether the content being withheld is a Tweet or a user. |
note_tweet | object | Information for Tweets longer than 280 characters. To return this field, add tweet.fields=note_tweet in the request’s query parameter. |
note_tweet.text | string | The text for Tweets longer than 280 characters. |
note_tweet.entities | object | Contains details about text that has a special meaning in a Tweet. |
note_tweet.entities.urls | array | Contains details about text recognized as a URL. |
note_tweet.entities.mentions | array | Contains details about text recognized as a user mention. |
note_tweet.entities.hashtags | array | Contains details about text recognized as a Hashtag. |
note_tweet.entities.cashtags | array | Contains details about text recognized as a Cashtag. |
public_metrics | object | Engagement metrics for the Tweet at the time of the request. To return this field, add tweet.fields=public_metrics in the request’s query parameter. |
public_metrics.retweet_count | integer | Number of times this Tweet has been Retweeted. |
public_metrics.reply_count | integer | Number of Replies of this Tweet. |
public_metrics.like_count | integer | Number of Likes of this Tweet. |
public_metrics.quote_count | integer | Number of times this Tweet has been Retweeted with a comment (also known as Quote). |
public_metrics.impression_count | integer | Number of times this Tweet has been viewed. |
public_metrics.bookmark_count | integer | Number of times this Tweet has been bookmarked. |
non_public_metrics | object | Non-public engagement metrics for the Tweet at the time of the request. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. To return this field, add tweet.fields=non_public_metrics in the request’s query parameter. |
non_public_metrics.impression_count | integer | Number of times the Tweet has been viewed. This requires the use of OAuth 2.0 User Context authentication. |
non_public_metrics.url_link_clicks | integer | Number of times a user clicks on a URL link or URL preview card in a Tweet. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
non_public_metrics.user_profile_clicks | integer | Number of times a user clicks the following portions of a Tweet - display name, user name, profile picture. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
organic_metrics | object | Organic engagement metrics for the Tweet at the time of the request. Requires user context authentication. |
organic_metrics.impression_count | integer | Number of times the Tweet has been viewed organically. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
organic_metrics.url_link_clicks | integer | Number of times a user clicks on a URL link or URL preview card in a Tweet organically. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
organic_metrics.user_profile_clicks | integer | Number of times a user clicks the following portions of a Tweet organically - display name, user name, profile picture. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
organic_metrics.retweet_count | integer | Number of times the Tweet has been Retweeted organically. |
organic_metrics.reply_count | integer | Number of replies the Tweet has received organically. |
organic_metrics.like_count | integer | Number of likes the Tweet has received organically. |
promoted_metrics | object | Engagement metrics for the Tweet at the time of the request in a promoted context. Requires user context authentication. |
promoted_metrics.impression_count | integer | Number of times the Tweet has been viewed when that Tweet is being promoted. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
promoted_metrics.url_link_clicks | integer | Number of times a user clicks on a URL link or URL preview card in a Tweet when it is being promoted. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
promoted_metrics.user_profile_clicks | integer | Number of times a user clicks the following portions of a Tweet when it is being promoted - display name, user name, profile picture. This is a private metric, and requires the use of OAuth 2.0 User Context authentication. |
promoted_metrics.retweet_count | integer | Number of times this Tweet has been Retweeted when that Tweet is being promoted. |
promoted_metrics.reply_count | integer | Number of Replies to this Tweet when that Tweet is being promoted. |
promoted_metrics.like_count | integer | Number of Likes of this Tweet when that Tweet is being promoted. |
possibly_sensitive | boolean | Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences. To return this field, add tweet.fields=possibly_sensitive in the request’s query parameter. |
lang | string | Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag. To return this field, add tweet.fields=lang in the request’s query parameter. |
reply_settings | string | Shows who can reply to this Tweet. Fields returned are everyone , mentionedUsers , and following . To return this field, add tweet.fields=reply_settings in the request’s query parameter. |
source | string | The name of the app the user Tweeted from. To return this field, add tweet.fields=source in the request’s query parameter. |
includes | object | If you include an [expansion](/x-api/x-api-v2/fundamentals/expansions) parameter, the referenced objects will be returned if available. |
includes.tweets | array | When including the expansions=referenced_tweets.id parameter, this includes a list of referenced Retweets, Quoted Tweets, or replies in the form of Tweet objects with their default fields and any additional fields requested using the tweet.fields parameter, assuming there is a referenced Tweet present in the returned Tweet(s). Similarly, when including the expansions=edit_history_tweet_ids parameter, a Tweet’s edit history will be referenced in the form of Tweet objects. |
includes.users | array | When including the expansions=author_id parameter, this includes a list of referenced Tweet authors in the form of user objects with their default fields and any additional fields requested using the user.fields parameter. |
includes.places | array | When including the expansions=geo.place_id parameter, this includes a list of referenced places in Tweets in the form of place objects with their default fields and any additional fields requested using the place.fields parameter, assuming there is a place present in the returned Tweet(s). |
includes.media | array | When including the expansions=attachments.media_keys parameter, this includes a list of images, videos, and GIFs included in Tweets in the form of media objects with their default fields and any additional fields requested using the media.fields parameter, assuming there is a media attachment present in the returned Tweet(s). |
includes.polls | string | When including the expansions=attachments.poll_ids parameter, this includes a list of polls that are attached to Tweets in the form of poll objects with their default fields and any additional fields requested using the poll.fields parameter, assuming there is a poll present in the returned Tweet(s). |
errors | object | Contains details about errors that affected any of the requested Tweets. See Status codes and error messages for more details. |