Logo
Twitter API Documentation

Full-archive search

GET https://api.twitter.com/2/tweets/search/all?query=

Search across the complete history of public Tweets matching a search query; since the first Tweet was created in March 2006.

For full details, see the API reference for this endpoint.

NOTE this endpoint requires access via the Academic Research product track

 

Body PARAM

Key Datatype Required Description 
query
null Required. Query for matching Tweets. Up to 1024 characters.
start_time
null The oldest UTC timestamp from which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).
end_time
null The newest, most recent UTC timestamp to which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).
since_id
null Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. The ID specified is exclusive and responses will not include it.
until_id
null Returns results with a Tweet ID less than (that is, older than) the specified ID. The ID specified is exclusive and responses will not include it.
max_results
null The maximum number of search results to be returned by a request. A number between 10 and the system limit (currently 100). By default, a request response will return 10 results.
next_token
null 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.
tweet.fields
null Comma-separated list of fields for the Tweet object. Allowed values: attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,referenced_tweets,reply_settings,source,text,withheld Default values: id,text
expansions
null Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object. Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id Default values: none
media.fields
null Comma-separated list of fields for the media object. Expansion required. Allowed values: duration_ms,height,media_key,preview_image_url,public_metrics,type,url,width Default values: media_key,type
place.fields
null Comma-separated list of fields for the place object. Expansion required. Allowed values: contained_within,country,country_code,full_name,geo,id,name,place_type Default values: id,full_name
poll.fields
null Comma-separated list of fields for the poll object. Expansion required. Allowed values: duration_minutes,end_datetime,id,options,voting_status Default values: id, options
user.fields
null Comma-separated list of fields for the user object. Expansion required. Allowed values: created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld Default values: id,name,username



HEADERS

Key Datatype Required Description 




RESPONSES

status





Curl
curl -X GET 'https://api.twitter.com/2/tweets/search/all?query=?query=&start_time=&end_time=&since_id=&until_id=&max_results=&next_token=&tweet.fields=&expansions=&media.fields=&place.fields=&poll.fields=&user.fields='

ENDPOINTS