X (Twitter) search unofficial API: search tweets, no API key
Input
query requiredRaw X search query. Supports all X search operators, e.g. '"AI automation" min_faves:500 since:2026-06-04'. Combining -filter:replies with min_faves and since can unexpectedly return zero results; using fewer operators together is more reliable. The query is taken literally, so if it targets a person or organization ambiguously (a bare first name, a nickname, or a handle you are not certain is exact, meant for from:/to:/@ targeting), resolve the exact handle first (for example via get_user_info, or by asking) rather than guessing: a wrong guess does not error, it searches the wrong thing and returns a plausible-looking but incorrect result set.
tab optionalWhich search tab: 'top' (ranked, default) or 'latest' (chronological). Top is a sample, not an exhaustive ranking.
Default: "top"count optionalHow many to return. Without it, the script returns the first page X shows (often 20 to 40). With it, the script loads more until it has count, reaches the end, or X stops loading; complete says whether it reached the end.
Output
count requiredNumber of tweets returned. 0 is a valid answer.
query requiredtweets requiredcomplete requiredTrue when X showed the end of the results and every one it sent is returned. False when there may be more: count was reached, X stopped loading, or no count was given and the first page is not the end.
