Recent search

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

Search for public Tweets created in the last 7 days.

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

Request Params

KeyDatatypeRequiredDescription
querynullRequired. Query for matching Tweets. Up to 512 characters.
start_timenullThe oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).
end_timenullThe newest, most recent UTC timestamp to which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).
since_idnullReturns 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_idnullReturns 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_resultsnullThe 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_tokennullThis 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.fieldsnullComma-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,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default values: id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request: non_public_metrics,organic_metrics,promoted_metrics | | 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,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values: media_key,type

OAuth1.0a User Context authorization required if any of the following fields are included in the request: non_public_metrics,organic_metrics,promoted_metrics | | 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 |

RESPONSES

status: OK

{"data":[{"id":"1275840243636322304","text":"RT @polarbearrs: Hi  #VisibleWomen ✨ I’m Anna, I’m a Black + Latina Caribbean illustrator based in NYC. I love making dreamy surrealist por…"},{"id":"1275840238498308097","text":"RT @DavidYankovich: A man who admitted his own guilt twice is getting freed from prison while black folks who jump a turnstile in NYC subwa…"},{"id":"1275840234521899008","text":"@freetesla11 @square1_NYC @FakeMikeMiseph @ajn465 @krystalball His evils have actually become bipartisan for the most part. Much like Reagan, in a sense.\nTrump is disorganized and incompetent. He was handed an unprecedented level of power when he got inaugurated(both chambers, courts, governorships) and yet still accomplished very little."},{"id":"1275840231883898880","text":"RT @NotifyNYC: AMBER Alert: Ahsan Ali, 15-year-old  male from 46th Avenue in Queens, in a white Toyota Sienna with license plate number JJX…"},{"id":"1275840228402569216","text":"@BeltwayGreg @zachdcarter you realize Amazon increased its presence in NYC anyway, without any tax incentives, right?"},{"id":"1275840227924414464","text":"RT @mcgoawayylmao: @DeeH_NYC i can't wait for your best picture speech at the oscars"},{"id":"1275840226922057728","text":"@SnottieDrippen It’s like another account tweeted a video saying JR Smith IS a bucket then used footage almost exclusively from his time in Denver and NYC as if it was last season..."},{"id":"1275840226657816579","text":"@tracifrost1976 In NYC we wear masks.   If you're still not sure if they are good for anything, take a look at this graph.  We're keeping it low. https://t.co/pdmt5RG53h"},{"id":"1275840225844113409","text":"@NYCMayor Where is the money you promised NYC public schools families. We were suppose to get it the first week of June"},{"id":"1275840222559899649","text":"Just wondering how the government plans on monitoring out of state visitors. Plenty of people live in Jersey that work in NYC"}],"meta":{"newest_id":"1275840243636322304","oldest_id":"1275840222559899649","result_count":10,"next_token":"b26v89c19zqg8o3fo7gesq314yb2ynhwgmfg7az3v76v1"}}