Search

Advanced Tweet Search

Run a full-text tweet search using the same operator syntax as Twitter/X advanced search. Combine free text with operators such as from:, to:, since:, until:, min_faves:, and lang: to filter precisely. Results are cursor-paginated at roughly 20 tweets per call. Cost: $0.0008 per call.

get/tweet/advanced_search

Request

  • Base URL: https://api.twitterapis.com/twitter
  • URL: https://api.twitterapis.com/twitter/tweet/advanced_search
  • Auth: HTTP bearer

Query parameters

querystring required

Search query using Twitter operator syntax.

Example:from:naval min_faves:1000
productstring

Ranking and result type: Latest, Top, People, Photos, or Videos. Defaults to Latest.

Example:Latest
cursorstring

Pagination cursor from a previous response's next_cursor.

countinteger

Accepted but not honoured on this endpoint: the upstream page is fixed at roughly 20 results and raising count does not return more. Use cursor to read further.

fieldsstring

Comma-separated list of dotted field paths to keep in the response (one parameter, never repeated), applied to every object in the returned lists and to nested objects (for example fields=id,text,author.username; the list's own name may prefix a path, fields=tweets.id). A path prefix that lands on an array applies to each element (media.media_url_https). Pagination and envelope keys (next_cursor, cursor, has_more, count, partial, error, message, reason) are always kept. Unknown paths are ignored; up to 50 paths of up to 6 segments. Projection never changes status codes or billing, and applies to data reads only: account, feedback, session status, monitor (other than deliveries), webhook and stream-compat reads return their bodies unchanged.

compact'1'

Set to 1 (or true) to apply the built-in compact preset: ids, url, text, created_at, lang, the engagement counts, the is_retweet/is_reply/is_quote flags, conversation ids, the author's id/username/name/followers_count/verification, and the quoted or retweeted tweet's id/url/author username. The preset trims what it recognises and leaves alone what it would empty, so it never turns a body into {}. Combine with fields to add paths on top of the preset. Typically cuts a tweet page by 70 to 90 percent for LLM tool callers.

paid_promotion'only' | 'exclude'

Filter this page's tweets by X's Paid partnership label: only keeps tweets whose is_paid_promotion is true, exclude keeps the rest. Omit it for every tweet. It filters the page X returned and does not fetch more, so a filtered page can hold fewer tweets than asked for, or none, while next_cursor still pages on. The response carries paid_promotion_filter { mode, kept, removed }, and count reflects what is returned. Any other value is a 400. Billing is the same as without it.

Response

Search tweets with Twitter's full query-operator syntax, paginated with cursors.

querystring

Echo of the query you sent.

productstring

Echo of the ranking product applied to the search.

countinteger

Number of items returned in this page.

next_cursorstring

Opaque cursor for the next page. Null on the final page for list and affiliate endpoints; follower-graph endpoints return a non-null cursor even on the last page, so stop when the collection array is empty.

has_moreboolean

True when another page is available: this page returned items and carried a usable next_cursor. False on the final page. Follower-graph endpoints keep sending a non-null next_cursor past the end, but has_more still flips to false once the item array comes back empty, so it is the reliable loop-stop signal.

incompleteboolean

Present and true only when X soft-limited the search that served this page, so the page may be missing rows. Absent on every healthy page.

incomplete_reasonstring

Why the page is incomplete: upstream_soft_limit. Present only with incomplete.

upstream_limitobject

X's own limit signal for this page (its error codes and message). Present only with incomplete.

Changes

No recorded changes to this operation across all 1 revision of this API.