{"operation":"tweets/search","version":"1.7.0","status":"pilot","title":"Search tweets","summary":"The tweets of a search on X (Twitter), 20 a page, with their text, counts, media and author, read with your connected X account.","use_when":"You want tweets about a subject, from an account, in a language or between two dates: pass the search as you would type it in X's search box, operators included (from:nasa since:2026-11-01 lang:en min_faves:100). `tab` is the page's own: top (X's selection, the default) or latest (newest first). Follow `next` unchanged for more. It needs one of your X accounts connected (POST /v2/accounts), and X counts each account's searches: about 50 for 15 minutes. An empty page is not the end of a search, keep following `next` until it is null (empty pages are free). X never says a list is over (it gives a cursor on every page): `next` is null when X gives none, or after three empty pages in a row, a rule of this API.","categories":["Social media"],"icon":"lens","source":"x","input":{"type":"object","required":["query"],"additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"maxLength":500,"description":"The search, as typed in X's search box, passed to X as it is. X's own operators, the ones its advanced search form writes: words (all of them), \"an exact phrase\", either OR other, -without, #hashtag, lang:fr, from:account, to:account, @mention, filter:replies or -filter:replies, filter:links or -filter:links, min_replies:10, min_faves:100, min_retweets:50, since:2026-11-01, until:2026-11-15 (dates in UTC).","examples":["web scraping","from:nasa since:2026-11-01","\"data extraction\" lang:fr min_faves:10"]},"tab":{"type":"string","enum":["top","latest"],"default":"top","description":"The tab of X's results: top, X's own selection (it can show a few tweets of one conversation together), or latest, newest first. The page's People and Media tabs are other operations."},"account":{"type":"string","description":"The connected X account to search with (GET /v2/accounts). Left out, the platform takes the first of your X accounts with a free slot.","examples":["acc_7Hq2Kd9mX4pL"]},"cursor":{"type":"string","pattern":"^[A-Za-z0-9_=-]{40,8000}$","description":"Where to go on, from `next` in an answer, as it is: opaque, and only for the search it was given with (otherwise `invalid_cursor`). Leave it out to start at the first page."}}},"requires":{"account":"x"},"limits":{"per_account":{"calls":1,"per_s":2,"jitter_s":[0,2]},"when_busy":{"error":"account_rate_limited","retry_after":true}},"pagination":{"style":"cursor","page_size":20,"next":{"query":"<query as it was written>","tab":"<tab as it was written>","cursor":"<opaque>"}},"record":{"type":"object","additionalProperties":false,"required":["object","id","position","is_promoted","url","text","language","created_at","reply_count","retweet_count","quote_count","like_count","bookmark_count","view_count","author","in_reply_to","reply_policy","is_quote","quoted_tweet","retweeted_tweet","urls","hashtags","symbols","smart_tags","mentions","media","card","article","place","community_note","community_id","grok_conversation","posted_with","is_paid_promotion","has_ai_generated_media","is_possibly_sensitive","is_long","edit","ids","source_url","observed_at"],"properties":{"object":{"const":"tweet"},"id":{"type":"string","description":"The tweet's id."},"position":{"type":"integer","minimum":1,"description":"Its rank in the search","across pages.":null},"is_promoted":{"type":"boolean","description":"Whether it is an ad X places among the search's results: a tweet of an advertiser, shown to the connected account that reads. Given where X puts it."},"url":{"type":"string","format":"uri","description":"The tweet on x.com."},"text":{"type":["string","null"],"description":"The whole text, a long tweet's included (is_long). Links are X's short ones (t.co), given in full in `urls` and `media`."},"language":{"type":["string","null"],"description":"The language X detected: ISO 639-1, or X's own codes (und, zxx, qme...)."},"created_at":{"type":["string","null"],"format":"date-time","description":"When it was posted, UTC."},"reply_count":{"type":["integer","null"]},"retweet_count":{"type":["integer","null"],"description":"Reposts."},"quote_count":{"type":["integer","null"]},"like_count":{"type":["integer","null"]},"bookmark_count":{"type":["integer","null"]},"view_count":{"type":["integer","null"],"description":"Null when X shows no view count for it."},"author":{"type":["object","null"],"additionalProperties":false,"required":["id","handle","name","url","description","description_language","description_urls","location","website_url","created_at","follower_count","following_count","tweet_count","media_count","like_count","is_blue_verified","is_verified","verified_type","is_protected","is_possibly_sensitive","professional","avatar_url","banner_url","avatar_shape","pinned_tweet_ids","affiliation"],"properties":{"id":{"type":"string","description":"The account's id."},"handle":{"type":["string","null"],"description":"Its @handle, without the @."},"name":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"description":{"type":["string","null"],"description":"The bio."},"description_language":{"type":["string","null"]},"description_urls":{"type":"array","items":{"type":["string","null"]},"description":"The links of the bio","in full.":null},"location":{"type":["string","null"],"description":"As the account wrote it."},"website_url":{"type":["string","null"],"description":"The profile's link, in full."},"created_at":{"type":["string","null"],"format":"date-time"},"follower_count":{"type":["integer","null"]},"following_count":{"type":["integer","null"]},"tweet_count":{"type":["integer","null"]},"media_count":{"type":["integer","null"]},"like_count":{"type":["integer","null"],"description":"The tweets the account liked."},"is_blue_verified":{"type":["boolean","null"],"description":"The blue check of a paying subscriber."},"is_verified":{"type":["boolean","null"],"description":"X's earlier verification."},"verified_type":{"type":["string","null"],"description":"business or government, when X says so."},"is_protected":{"type":["boolean","null"]},"is_possibly_sensitive":{"type":["boolean","null"]},"professional":{"type":["object","null"],"additionalProperties":false,"required":["type","categories"],"properties":{"type":{"type":["string","null"],"description":"business or creator."},"categories":{"type":"array","items":{"type":["string","null"]}}}},"avatar_url":{"type":["string","null"]},"banner_url":{"type":["string","null"]},"avatar_shape":{"type":["string","null"],"description":"circle, square (organizations), hexagon."},"pinned_tweet_ids":{"type":"array","items":{"type":"string"}},"affiliation":{"type":["object","null"],"description":"The label the account carries next to its name: the organization whose badge it has, or X's own word on it (Automated); null without one.","additionalProperties":false,"required":["name","url","badge_url","type","detail","account"],"properties":{"name":{"type":["string","null"],"description":"The organization's name on the badge."},"url":{"type":["string","null"],"description":"The organization's profile, as X links it."},"badge_url":{"type":["string","null"],"description":"The badge's image."},"type":{"type":["string","null"],"description":"business_label for an organization's badge, automated_label for an account X labels as automated."},"detail":{"type":["string","null"],"description":"The label's own sentence when it has one: Automated by @marc_krenn."},"account":{"type":["object","null"],"description":"The account the label's sentence names (who runs an automated account); null without one.","additionalProperties":false,"required":["id","handle"],"properties":{"id":{"type":"string"},"handle":{"type":["string","null"]}}}}}}},"in_reply_to":{"type":["object","null"],"additionalProperties":false,"required":["tweet_id","user_id","handle"],"description":"The tweet it replies to; null when it is not a reply.","properties":{"tweet_id":{"type":["string","null"]},"user_id":{"type":["string","null"]},"handle":{"type":["string","null"]}}},"reply_policy":{"type":["string","null"],"description":"Who may reply, when the conversation's author restricted it, in X's own word: ByInvitation (the accounts the author follows or mentions), Community (the members of its community). Null when anyone may reply.","examples":["ByInvitation"]},"is_quote":{"type":["boolean","null"]},"quoted_tweet":{"type":["object","null"],"description":"The tweet it quotes, with a tweet's fields but position, quoted_tweet, retweeted_tweet, source_url and observed_at. Null when it quotes none, or one X no longer shows (ids.quoted_tweet_id still says which)."},"retweeted_tweet":{"type":["object","null"],"description":"The tweet it reposts, with the same fields as quoted_tweet."},"urls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["url","display","short_url"],"properties":{"url":{"type":["string","null"],"description":"The link in full."},"display":{"type":["string","null"],"description":"As the page shows it."},"short_url":{"type":["string","null"],"description":"X's t.co link, as it stands in the text."}}}},"hashtags":{"type":"array","items":{"type":["string","null"]},"description":"Without the #."},"symbols":{"type":"array","items":{"type":["string","null"]},"description":"Cashtags, without the $."},"smart_tags":{"type":"array","description":"The assets the tweet tags, a kind of tag X added in November 2026 (tokens so far); empty on most tweets. Not the cashtags of `symbols`.","items":{"type":"object","additionalProperties":false,"required":["text","name","ticker"],"properties":{"text":{"type":["string","null"],"description":"The tag as the text writes it: a chain and the asset on it (hyperliquid:native)."},"name":{"type":["string","null"],"description":"The asset's name (Hyperliquid)."},"ticker":{"type":["string","null"],"description":"Its ticker (HYPE)."}}}},"mentions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","handle","name"],"properties":{"id":{"type":["string","null"]},"handle":{"type":["string","null"]},"name":{"type":["string","null"]}}}},"media":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","type","url","page_url","width","height","alt_text","duration_ms","video_url","view_count"],"properties":{"id":{"type":["string","null"]},"type":{"type":["string","null"],"description":"photo, video or animated_gif."},"url":{"type":["string","null"],"description":"The image, or a video's poster."},"page_url":{"type":["string","null"]},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"alt_text":{"type":["string","null"]},"duration_ms":{"type":["integer","null"]},"video_url":{"type":["string","null"],"description":"The video's file of the highest bitrate."},"view_count":{"type":["integer","null"]}}}},"card":{"type":["object","null"],"additionalProperties":false,"required":["type","url","title","description","domain","image_url"],"description":"The preview X draws under a tweet for a link, a poll or a player.","properties":{"type":{"type":["string","null"],"description":"X's name of the card: summary, summary_large_image, player..."},"url":{"type":["string","null"]},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"domain":{"type":["string","null"]},"image_url":{"type":["string","null"]}}},"article":{"type":["object","null"],"additionalProperties":false,"required":["id","title","preview_text","cover_url","published_at","modified_at"],"description":"An X Article attached to the tweet (its title and preview, not its text).","properties":{"id":{"type":["string","null"]},"title":{"type":["string","null"]},"preview_text":{"type":["string","null"]},"cover_url":{"type":["string","null"]},"published_at":{"type":["string","null"],"format":"date-time"},"modified_at":{"type":["string","null"],"format":"date-time"}}},"place":{"type":["object","null"],"additionalProperties":false,"required":["id","name","full_name","type","country","country_code","bounding_box"],"description":"The place its author tagged it with (Ozuoba, Nigeria); null without one, which is most tweets. X gives the place and the box around it, never the point it was posted from.","properties":{"id":{"type":["string","null"],"description":"X's id of the place."},"name":{"type":["string","null"]},"full_name":{"type":["string","null"],"description":"The name with its region or country, as the page writes it."},"type":{"type":["string","null"],"description":"city, admin, country, neighborhood, poi."},"country":{"type":["string","null"]},"country_code":{"type":["string","null"],"description":"Two letters."},"bounding_box":{"type":"array","description":"The corners of the box around the place, each longitude then latitude.","items":{"type":"array","items":{"type":"number"}}}}},"community_note":{"type":["object","null"],"additionalProperties":false,"required":["id","title","text","language","url","urls"],"description":"The Community Note X shows under the tweet: context written by readers, shown once enough of them rated it helpful. Null when the tweet carries none.","properties":{"id":{"type":"string","description":"The note's id."},"title":{"type":["string","null"],"description":"X's own heading over the note: Readers added context they thought people might want to know."},"text":{"type":["string","null"],"description":"The note's text; its links are X's short ones (t.co), given in full in `urls`."},"language":{"type":["string","null"],"description":"The note's language, when X says it: en."},"url":{"type":["string","null"],"description":"The note's own page on X."},"urls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["url","short_url"],"properties":{"url":{"type":["string","null"]},"short_url":{"type":["string","null"]}}}}}},"community_id":{"type":["string","null"],"description":"The id of the X community the tweet was posted in (x.com/i/communities/<id>); null for a tweet posted to everyone."},"grok_conversation":{"type":["array","null"],"description":"The Grok conversation the tweet shares, when it shares one: its messages in X's own order. X names no speaker; on every conversation read the first message is the person's question and the second Grok's answer. Null for a tweet that shares none.","items":{"type":"object","additionalProperties":false,"required":["text","media_urls","source_urls","source_tweet_ids","about_tweet_id"],"properties":{"text":{"type":["string","null"],"description":"The message, as written (Grok's answers are in Markdown)."},"media_urls":{"type":"array","items":{"type":"string"},"description":"The images the message carries."},"source_urls":{"type":"array","items":{"type":"string"},"description":"The web pages Grok read for this message, in X's order, repeats included."},"source_tweet_ids":{"type":"array","items":{"type":"string"},"description":"The posts on X Grok read for this message."},"about_tweet_id":{"type":["string","null"],"description":"The post the message is about, when it asks Grok about one (x/tweets/get reads it)."}}}},"posted_with":{"type":["string","null"],"description":"The app it was posted with, when X says it: Twitter Web App."},"is_paid_promotion":{"type":["boolean","null"],"description":"The author's own disclosure of a paid partnership."},"has_ai_generated_media":{"type":["boolean","null"],"description":"X's label of media made with AI."},"is_possibly_sensitive":{"type":["boolean","null"]},"is_long":{"type":"boolean","description":"A tweet longer than 280 characters; text holds it whole."},"edit":{"type":["object","null"],"additionalProperties":false,"required":["tweet_ids","editable_until","edits_remaining"],"properties":{"tweet_ids":{"type":"array","items":{"type":"string"},"description":"Its versions, the first to the last."},"editable_until":{"type":["string","null"],"format":"date-time"},"edits_remaining":{"type":["integer","null"]}}},"ids":{"type":"object","additionalProperties":false,"required":["tweet_id","conversation_id","author_id","quoted_tweet_id"],"properties":{"tweet_id":{"type":"string"},"conversation_id":{"type":["string","null"],"description":"The first tweet of its thread."},"author_id":{"type":["string","null"]},"quoted_tweet_id":{"type":["string","null"]}}},"source_url":{"type":"string","format":"uri","description":"The search on x.com."},"observed_at":{"type":"string","format":"date-time","description":"When it was read, UTC."}}},"price":{"credits_per_call":20,"description":"20 credits per call that returns tweets, a short last page included. An empty answer, a failed call and a busy account are free.","free":["empty","failed","account_rate_limited"]},"deadline":{"default_s":30,"max_s":60},"errors":[{"code":"invalid_query","status":422,"detail":true,"message":"Pass the search as you would type it in X's search box; tab is top or latest."},{"code":"account_required","status":422,"message":"You have no connected X account. Connect one with POST /v2/accounts {\"site\": \"x\", \"cookies\": ..., \"country\": \"FR\"}: the cookies of a browser where you are logged in to x.com, and the country you use the account from (https://docs.lobstr.io/accounts)."},{"code":"account_rate_limited","status":429,"retryable":true,"detail":true,"message":"This X account cannot search right now: it pauses a couple of seconds between two pages, and X counts each account's searches (about 50 for 15 minutes). `retry_after` says when it can search again, in seconds. Retrying before then gets this same answer: nothing is queued."},{"code":"account_unusable","status":409,"message":"X logged this account out, or locked it. Open x.com in the browser the account comes from, then connect it again with POST /v2/accounts and fresh cookies (the same account keeps its id)."},{"code":"site_unavailable","status":503,"retryable":true,"message":"X did not answer properly; retry later (not charged)."},{"code":"unexpected_answer","status":424,"retryable":false,"message":"X answered in a shape we do not read yet; we are told and fix it (not charged)."}],"examples":[{"request":{"query":"from:nasa since:2026-11-01","tab":"latest"},"records":[{"object":"tweet","id":"2122000000000000001","position":1,"is_promoted":false,"url":"https://x.com/NASA/status/2122000000000000001","text":"Liftoff of the resupply mission to the International Space Station. https://t.co/abc123","language":"en","created_at":"2026-11-15T18:42:10Z","reply_count":312,"retweet_count":1840,"quote_count":96,"like_count":12950,"bookmark_count":410,"view_count":1204500,"author":{"id":"11348282","handle":"NASA","name":"NASA","url":"https://x.com/NASA","description":"Exploring the secrets of the universe for the benefit of all.","description_language":"en","description_urls":[],"location":"Pale Blue Dot","website_url":"https://www.nasa.gov/","created_at":"2007-12-19T20:20:32Z","follower_count":86000000,"following_count":170,"tweet_count":73000,"media_count":28000,"like_count":16000,"is_blue_verified":true,"is_verified":false,"verified_type":"government","is_protected":false,"is_possibly_sensitive":false,"professional":null,"avatar_url":"https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg","banner_url":"https://pbs.twimg.com/profile_banners/11348282/1763000000","avatar_shape":"square","pinned_tweet_ids":[],"affiliation":null},"in_reply_to":null,"reply_policy":null,"is_quote":false,"quoted_tweet":null,"retweeted_tweet":null,"urls":[{"url":"https://www.nasa.gov/live","display":"nasa.gov/live","short_url":"https://t.co/abc123"}],"hashtags":[],"symbols":[],"smart_tags":[],"mentions":[],"media":[],"card":null,"article":null,"place":null,"community_note":null,"community_id":null,"grok_conversation":null,"posted_with":null,"is_paid_promotion":null,"has_ai_generated_media":null,"is_possibly_sensitive":false,"is_long":false,"edit":{"tweet_ids":["2122000000000000001"],"editable_until":"2026-11-15T19:42:10Z","edits_remaining":5},"ids":{"tweet_id":"2122000000000000001","conversation_id":"2122000000000000001","author_id":"11348282","quoted_tweet_id":null},"source_url":"https://x.com/search?q=from%3Anasa%20since%3A2026-11-01&src=typed_query&f=live","observed_at":"2026-11-16T15:00:00Z"}],"next":{"query":"from:nasa since:2026-11-01","tab":"latest","cursor":"gAAAAABpGn1a_sealed_cursor_of_the_next_page_as_the_answer_gives_it_0123456789"}}],"health":{"every_h":3,"canaries":[{"query":"web scraping","tab":"latest","account":"monitoring","min_records":15},{"query":"from:nasa","tab":"latest","account":"monitoring","min_records":10,"expect":{"author.handle":"NASA"}}],"required_fields":["id","url","text","created_at","author.id","author.handle","like_count"]},"changelog":[{"version":"1.7.0","date":"2026-11-22","notes":"New field `grok_conversation`: the Grok conversation a tweet shares, its messages in order with the images, web pages and posts each carries."},{"version":"1.6.0","date":"2026-11-20","notes":"Two new fields in the author's `affiliation`: `detail`, the label's own sentence (Automated by @x), and `account`, the account that sentence names."},{"version":"1.5.0","date":"2026-11-20","notes":"Two new fields on a tweet: `community_note`, the Community Note X shows under it (its text, links and page), and `community_id`, the X community it was posted in."},{"version":"1.4.1","date":"2026-11-20","notes":"A page without a tweet no longer ends the list: X gives a cursor on every page and one can come empty in the middle. `next` goes on; it is null after three empty pages in a row."},{"version":"1.4.0","date":"2026-11-19","notes":"New field `reply_policy`: who may reply to the tweet when its conversation's author restricted it, in X's own word (ByInvitation, Community); null when anyone may."},{"version":"1.3.0","date":"2026-11-19","notes":"New field `is_promoted`: an ad X places in the list is given where X puts it and marked, no longer left out."},{"version":"1.2.0","date":"2026-11-18","notes":"One more field: `smart_tags`, the assets a tweet tags (a token's name and ticker), a kind of tag X started sending in November 2026. Empty on most tweets."},{"version":"1.1.0","date":"2026-11-17","notes":"Two more fields, both null on most tweets: `place`, the place a tweet's author tagged it with, and `author.affiliation`, the organization whose badge the author carries next to its name. `author.website_url` is null, no longer an empty string, when the profile has no link."},{"version":"1.0.0","date":"2026-11-16","notes":"First version on the API v2, in place of the v1 Twitter Search Results Scraper: a search as typed in X's box, its Top or Latest tab, 20 tweets a page with their counts, media, author, quoted tweet and edits, read with your own connected X account, which goes out from the country you use it from."}],"object":"operation","id":"x/tweets/search","site":{"title":"X (Twitter)","domain":"x.com","color":"#C9D3DE"}}