Skip to main content
X search operators are special keywords and symbols that filter tweets by author, date, engagement, media type, language, location, and other attributes. Most operators on this page work in the query field of the Search Tweets endpoint and on x.com. A few are marked UI only: those depend on a signed-in account (your follows, your location, your network) and do not work through the API.
Note: For a complete guide with copy-paste recipes, production code examples (Python and JavaScript with pagination), and a side-by-side comparison against the official X API v2 operator set, see the Twitter Search Operators Complete Cheat Sheet on the blog.

Syntax basics

  • Spaces between terms act as implicit AND
  • OR must be uppercase
  • Use a leading dash (-) to exclude a term, phrase, or operator
  • Group expressions with parentheses
  • Wrap exact phrases in double quotes
Operators can be combined freely up to roughly 22-23 operators per query. AND binds tighter than OR: cat OR black dog is evaluated as cat OR (black dog). Use parentheses to eliminate ambiguity.

Free Visual Query Builder

If you don’t want to assemble operator strings by hand, use the Sorsa Search Builder. It is a free, no-login tool with a graphical interface where you toggle filters and preview the generated query string before integrating it into your code.

1. Keyword and Boolean Logic

Plurals match their singulars and vice versa. Operators match against tweet body, the author’s display name, screen name, and expanded URLs inside the tweet.

2. User and Account Filters


3. Engagement Gating

Counts become approximate for very large values (1,000+).

4. Media and Content Type

Media filters

Tweet type filters

Special content filters


5. Date, Time, and Snowflake IDs

Snowflake ID conversion. Every tweet ID encodes its creation timestamp:
For pulling historical sets, see Historical Data.

6. Geographical Filters

Only an estimated 1-2% of tweets carry precise geolocation data. If a tweet does not have coordinates, the API falls back to reverse-geocoding the user’s profile location.

7. Language and Source

Language

Standard ISO 639-1 codes (lang:en, lang:es, lang:fr, lang:de, lang:ja, lang:ru, etc.) plus the following X-specific codes:

Source (posting client)

Common values: Twitter_for_iPhone, Twitter_for_Android, Twitter_Web_App, TweetDeck, twitter_ads.

8. Card and URL Operators

card_name: typically only matches tweets from the last 7-8 days.

Building queries

A practical construction order that scales:
  1. Group core keywords: (bitcoin OR ethereum OR $BTC)
  2. Add content constraints: lang:en, filter:images, -filter:replies
  3. Set engagement thresholds: min_faves:50, min_retweets:10
  4. Exclude noise: -from:spambot, -scam, -filter:retweets
  5. Add time bounds: since:2026-01-01 until:2026-03-01
For full code examples (Python and JavaScript with pagination and rate-limit handling) and 14 production-ready query recipes, see the full guide on the blog.

Known limitations

  • Operator cap: roughly 22-23 operators maximum per query.
  • Geo coverage is thin: only 1-2% of tweets have precise location data.
  • card_name: is time-limited to the past 7-8 days.
  • Private and suspended accounts are excluded from search results.
  • Language detection is imperfect for short tweets, code, or emoji-heavy posts.
  • Not all tweets are indexed. Tweets flagged for platform violations may be excluded.
  • Auto-correction happens silently in some cases. Use +word or "word" to force exact matching.
  • URL matching works for domains and subdomains but is unreliable for long URL paths.

Source

This reference draws on the maintained twitter-advanced-search repository by Igor Brigadir, the industry-standard source on undocumented X search behavior.

Next Steps