Search X tweets
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. AGENT INSTRUCTION: this query is taken literally — if it targets a person or organization ambiguously (a bare first name, a nickname, or a handle you're not certain is exact, meant for from:/to:/@ targeting), resolve the exact handle first (for example via get_user_info, or by asking the user) rather than guessing, since a wrong guess won't error, it will just silently search the wrong thing and return 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 optionalMax tweets to return. The script scrolls until count is met or results dry up. Default 20, max 100.
Default: 20Output
count requiredNumber of tweets returned. 0 is a first-class outcome (no results for the query).
query requiredtweets required