Skip to main content
GET
Twitter advanced search API & tweet scraper
Repost records include retweetedAt, the repost event’s UTC ISO 8601 timestamp. It is null when that timestamp is unavailable. The API omits it for original posts. The nested original post keeps its own creation date. This field does not report every account that reposted a post. Request per-account timestamps with Get retweeters.
Requested counts are upper bounds for paid calls. When credits can’t cover the full page or ID list, Xquik returns fewer results. While has_next_page is true, send next_cursor as cursor with the same query, filters, queryType & limit. With 0 affordable results, it returns 402 insufficient_credits.
Search Tweets accepts keywords, hashtags, operators, dates, authors, media, and engagement filters. For exact lookup, send a Tweet ID or X status URL in q with no time params. To search one user’s tweets as a plain timeline, call Search user tweets (GET /x/users/{id}/tweets). Date params append since: and until: search operators to q, so q=from:username&sinceTime=2026-05-01&untilTime=2026-05-02 stays on search. Cursor requests return an empty final page for exact IDs.
1 credit per tweet returned · All plans from $0.00012/credit
Omit mode for automatic maximum coverage. Xquik combines available views within a short request window. It keeps the existing response shape. Pass next_cursor back unchanged as cursor. Keep the same endpoint, target, query, and filters.
Existing unprefixed cursors keep their legacy behavior. after, limit, and pageSize aliases also keep working. Billing still counts only returned rows. Use mode=standard only to force legacy single-view pagination. A page can be empty or underfilled. Continue while has_next_page is true. Stop only after the response reports has_next_page=false. First-page requests do not support Idempotency-Key retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. You cannot replay earlier or terminal responses after their cursors become unavailable. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. Concurrent use returns 409 coverage_cursor_unavailable with exact Retry-After seconds. Wait, then retry the same cursor once. Repeated busy responses never authorize restarting with another cursor. Finished, expired, superseded, or identity-mismatched cursors return 410 coverage_cursor_gone. The response omits Retry-After. Restart without a cursor. Keep received results. Deduplicate restarted results by id. Malformed cursors return 400 invalid_coverage_cursor. Restart without them. Conversation searches use automatic recovery even when limit is 1. A search with no results ends with has_next_page=false.

Direct API handoff

Use GET /x/tweets/search for live JSON. Store IDs and next_cursor to resume. Use tweet_search_extractor for estimates, saved pages, or downloadable CSV, JSON, and XLSX files. limit bounds unique matching tweets after filtering. Keep q, filters, queryType, and limit unchanged when resuming with cursor=next_cursor. Continue while has_next_page is true. Deduplicate IDs and reject repeated cursors. Explicit mode=coverage returns retained rows when its request window expires. Check diagnostic.deadlineReached and diagnostic.complete. Partial coverage does not mean the source ran out of tweets. For account date windows, sinceTime and untilTime append since: and until: to q. Inline since_time: and until_time: intersect. The start is inclusive. The end is exclusive. Days are UTC. q=from:username&sinceTime=2026-05-01&untilTime=2026-05-02 behaves like from:username since:2026-05-01 until:2026-05-02. Use queryType=Latest for backfills or keywords for ranked search. Bounds apply to every returned page. Coverage continues past rejected rows. -filter:nativeretweets drops button reposts but keeps quotes & manual RT text. include:nativeretweets adds button reposts to author searches. -filter:retweets also drops manual RT text. Xquik keeps the operator you send. Dated author searches keep either filter through pagination & recovery, and read the account timeline too. Bare q=from:username uses automatic timeline and search coverage. Continue when the response includes next_cursor. Use mode=standard only when an old integration requires the legacy single-page timeline behavior. A search that needs a protected author returns 403 with x_account_protected and no charge. Choose a public account. Searches across several authors are unaffected.

Advanced Twitter search patterns

Tweet rows

Store tweets[] as the matching tweet rows for app ingestion, analyst export, or retrieval.

Tweet keys

Store tweets[].id as the stable tweet key for deduplication, CRM notes, queues, and follow-up lookups.

Search context

Store tweets[].text and tweets[].createdAt for search hit context and time ordering.

Author joins

Store tweets[].author.id, tweets[].author.username, tweets[].author.name, tweets[].author.followers, tweets[].author.verified, and tweets[].author.profilePicture for author joins and enrichment.

Scoring fields

Store engagement counts for scoring, routing, and prioritization.

Relationship context

Store tweets[].media, quoted_tweet & retweeted_tweet for media & relationship context.

Next page

Store has_next_page and next_cursor as the cursor handoff. For bounded limit batches, keep the same query, filters, queryType, and limit when resuming.

File exports

Use tweet_search_extractor when the output must be saved CSV, JSON, or XLSX.
Tweet search costs 1 credit per tweet returned. Retry 429 with the Retry-After header. Retry 502 after a short backoff. Change the query after 424 search_unavailable.

Matched text ranges

Each row says where its text matches the search, in textHighlights. Use the ranges to bold the matched words or to cut a snippet around them.
  • startIndex is the first code point of a match. endIndex is the first one after it.
  • Offsets count code points of the row’s text, as displayTextRange does.
  • JavaScript counts some characters, such as most emoji, as 2 units. Split the text by code point first.
  • The list is empty when X marks nothing, such as for a from: search without words.
  • X marks matches only in a post’s first 280 characters. Later matches in a long post get no range.

Query parameters

string
required
Send the caller’s query, Tweet ID, or status URL. query is an alias. Quotes match phrases. Hyphens negate terms. Use exactPhrase for literals.
string
Latest ranks by time. Top ranks engagement. Any case works. result_type and sort_order are accepted aliases, as are type, search_type, product, category & section. recency maps to Latest. relevancy maps to Top. Photos, Videos & Media read Latest with mediaType images, videos or media, unless you set mediaType. People & Lists answer 400 & point to /x/users/search & /x/lists/search.
string
Optional compatibility override. Omit it for automatic maximum coverage. Use standard for legacy single-view pagination. Use coverage for a one-shot diagnostic response without cursor pagination.
string
Pass next_cursor back unchanged. New Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior.
string
Inclusive lower bound. Intersects with inline bounds.
string
Exclusive upper bound. Intersects with inline bounds.
integer
Maximum Tweets per automatic page, from 1 through 10000. count and max_results are accepted aliases. So are pageSize, maxItems, max_items & per_page. Keep the value on cursor requests.

Structured filters

Structured filters are part of the public Search Tweets API. Use X search operators. Keep the same filters on every cursor request.
string
Filter to posts from this username. The @ prefix is optional.
string
Filter to replies directed to this username.
string
Filter to posts that mention this username.
string
Only include posts with this language code.
string
Include posts created on or after this date or timestamp.
string
Include posts up to this date or timestamp. A date is a UTC day, inclusive, so its own posts count.
string
Use images, videos, gifs, media, links, or none.
integer
Require this minimum like count.
integer
Require this minimum repost count.
integer
Require this minimum reply count.
integer
Require this minimum quote count.
integer
Require this minimum view count.
integer
Require this minimum bookmark count.
integer
Allow this maximum like count. Missing counts pass.
integer
Allow this maximum repost count. Missing counts pass.
integer
Allow this maximum reply count. Missing counts pass.
integer
Allow this maximum quote count. Missing counts pass.
boolean
When true, only return posts from Blue-verified authors.
boolean
When true, only return posts from verified authors.
string
Use include, exclude, or only for replies. This setting overrides includeReplies when the endpoint supports both.
string
Use include, exclude, or only for reposts.
string
Match this literal phrase, including any hyphens.
string
Exclude comma-separated or whitespace-separated terms.
string
Require at least 1 comma-separated or whitespace-separated term.
string
Match these hashtags. Separate values with commas or spaces.
string
Match these cashtags. Separate values with commas or spaces.
string
Use include, exclude, or only for quote posts.
string
URL substring or domain that must appear in tweet URL entities.
string
Filter to tweets in this conversation thread.
string
Only include replies to this tweet ID.
string
Filter to quote tweets of this tweet ID.
string
Filter to retweets of this tweet ID.
string
Keep only Tweets with this card type, such as poll2choice_text_only. Tweet search checks each Tweet’s card.
string
X search no longer supports source. A Tweet search with it answers 424 & charges nothing.
string
X search no longer supports excludeSource. A Tweet search with it answers 424 & charges nothing.
string
X search no longer supports geocode. A Tweet search with it answers 424 & charges nothing.
string
Match this place name.
string
X search no longer supports within. A Tweet search with it answers 424 & charges nothing. Use near alone.
boolean
When true, enable X safe-search filtering.
boolean
X no longer searches filter:news, so leave this unset.
string
Return Tweets whose IDs exceed this ID.
string
Return Tweets at or below this ID.
boolean
When true, only return native reposts.
string
Match Tweets from this recent window, such as 90m or 7d. Use a whole number & s, m, h or d.

Search-only operators

These query parameters apply only to GET /x/tweets/search because they map to search operators before the request runs. Use advancedQuery only when you already have trusted raw X search operator syntax to append.
string
Words the Tweets must match, in X search syntax.
string
Search within this X place ID. Search places finds the ID by name.
string
Search within this country code.
string
Geo point radius in X search syntax, such as -73.99 40.73 25mi.
string
Geo bounding box in X search syntax, such as -74.1 40.6 -73.9 40.8.
string
Raw X search operators appended to the final search query.
string
Search within this X List ID.

Headers

string
Full account key. Sessions and OAuth also work.
string
Bearer xq_your_guest_key_here for paid_reads.

Response

200 OK

object[]
Array of matching tweets. Tweet object fields. The API omits fields absent from a source tweet.
string
Tweet ID.
string
Tweet text.
string
Tweet type.
string
ISO 8601 creation time.
boolean
Whether this is a Note Tweet.
boolean
Whether the author pinned this post to their profile. Omitted if unavailable.
number
Like count.
number
Repost count.
number
Reply count.
number
Quote count.
number
View count.
number
Bookmark count.
string
Tweet URL.
string
Tweet language code.
boolean
Whether the tweet is a reply.
string
Tweet ID being replied to. Omitted if not a reply.
string
User ID being replied to. Omitted if not a reply.
string
Username being replied to. Omitted if not a reply.
string
Conversation thread ID.
string
Tweet client.
number[]
Rendered text offsets.
object[]
Where text matches the search. Each item has startIndex & endIndex, counted in code points of text. Empty when X marks nothing in the post. X marks matches only in a post’s first 280 characters.
boolean
Whether replies are limited.
boolean
Whether this tweet quotes another.
boolean
Whether this row is a retweet. text carries the original post in full.
object
Parsed entities.
object
Disclosure labels.
object
Tweet author profile. Author object fields.
string
Author user ID.
string
Author X username.
string
Author display name.
number
Follower count.
number
Following count.
boolean
Whether the author is verified.
string
Profile image URL.
string
Cover image URL.
string
Profile bio.
string
Profile location.
string
Account creation date.
number
Total tweet count.
object[]
Attached media items. Omitted when the tweet has no attached media. Media item fields.
string
Direct media URL (pbs.twimg.com).
object[]
Video variants. Omit for images.
string
Media type: photo, video, or animated_gif.
string
Shortened t.co URL from the tweet text.
object
Embedded quoted tweet (same shape as tweet object). Omitted if not a quote tweet.
object
Original retweeted tweet (same shape as tweet object). Omitted if not a retweet.
boolean
Whether more results are available. Pass next_cursor to fetch the next page.
string
Opaque cursor for the next page. Empty string when no more results.
string
Your q as X searched it. Present only when Xquik fixed it, such as by removing an unmatched quote X refuses.
string
How far back a filtered Latest search has read, in UTC. Every newer post was checked, so an empty page still moves this time back.

400 Missing query

The q query parameter is empty or missing.

401 Unauthenticated

Anonymous requests get WWW-Authenticate: Bearer and a guest wallet checkout action. This is not a Payment challenge.
Missing or invalid API key. Check the x-api-key header value.

402 Payment required

Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action.

404 Missing user or tweet

user_not_found means a required user lookup failed. Check the username. tweet_not_found means an exact tweet lookup failed. Check the tweet ID or URL. Neither means a search completed with no matching tweets.

502 X API unavailable

The read service returned an error. Retry after a short delay.

429 Rate limit exceeded

You exceeded your tier rate limit. Wait for the Retry-After header before retrying.

424 Search unavailable

X fails this query on every read, so a retry fails too. Follow its message to fix the search. The normalized v1 contract also returns 424 x_api_unavailable.
Next steps. Tweet Search Export Workflow when you need saved CSV, JSON, or XLSX files, Get Tweet to fetch full details for a specific tweet, or Get User to look up an author profile.