GET /2/tweets/counts/all
GET /2/tweets/counts/all
This endpoint is only available to those users who have been approved for Academic Research access.
The full-archive Tweet counts endpoint returns the count of Tweets that match your query from the complete history of public Tweets; since the first Tweet was created March 26, 2006.
Endpoint URL
https://api.x.com/2/tweets/counts/all
Authentication and rate limits
Authentication methods supported by this endpoint | |
---|---|
Rate limit | App rate limit (Application-only): 300 requests per 15-minute window shared among all users of your app |
Query parameters
Name | Type | Description |
---|---|---|
query Required | string | One query for matching Tweets. You can learn how to build this query by reading our build a query guide.You can use all available operators and can make queries up to 1,024 characters long. |
end_time Optional | date (ISO 8601) | YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). Used with start_time . The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (for example, 12:00:01 excludes the first second of the minute). If used without start_time , Tweets from 30 days before end_time will be returned by default. If not specified, end_time will default to [now - 30 seconds]. |
granularity Optional | string | This is the granularity that you want the timeseries count data to be grouped by. You can requeset minute , hour , or day granularity. The default granularity, if not specified is hour . |
next_token Optional | string | This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, assuming that your request contains more than 31 days-worth of results, and should not be modified. You can learn more by visiting our page on pagination. |
since_id Optional | string | Returns results with a Tweet ID greater than (for example, more recent than) the specified ID. The ID specified is exclusive and responses will not include it. If included with the same request as a start_time parameter, only since_id will be used. |
start_time Optional | date (ISO 8601) | YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (for example, 12:00:01 includes the first second of the minute). By default, a request will return Tweets from up to 30 days ago if you do not include this parameter. |
until_id Optional | string | Returns results with a Tweet ID less than (that is, older than) the specified ID. Used with since_id . The ID specified is exclusive and responses will not include it. |
Example code with offical SDKs
TypeScript (Default fields)
TypeScript (Optional fields)
Java (Default fields)
Java (Optional fields)
Example responses
Default Fields
Optional Fields
Response fields
Name | Type | Description |
---|---|---|
start | date (ISO 8601) | Start time for the granularity. |
end | date (ISO 8601) | End time for the granularity. |
tweet_count | integer | Count of the volume of Tweets that match the query. |
meta | object | Creation time of the Tweet. |
meta.total_tweet_count | integer | Total count of the Tweets that match the query. |
meta.next_token | string | This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. |