Documentation Index Fetch the complete documentation index at: https://x-preview-mintlify-aed10b63.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
This page provides a complete list of operators available when building a query for the Search API endpoints.
Overview
Operators are used to match on specific Post attributes. There are two types:
Standalone operators — Can be used alone or with any other operators
Conjunction-required operators — Must be used with at least one standalone operator
Keyword and Phrase Operators
Operator Type Summary Example keywordStandalone Matches a keyword within the Post body (tokenized match) pepsi OR cola OR "coca cola"emojiStandalone Matches an emoji within the Post body (😃 OR 😡) 😬"exact phrase"Standalone Matches the exact phrase within the Post body ("X API" OR #v2) -"recent search"
Entity Operators
Operator Type Summary Example #Standalone Matches Posts containing a hashtag (exact match) #thankunext #fanart@Standalone Matches Posts mentioning a username (@XDevelopers OR @API) -@X$Standalone Matches Posts containing a cashtag $twtr OR @XDevelopers -$fb
User Operators
Operator Type Summary Example from:Standalone Matches Posts from a specific user from:XDevelopers OR from:APIto:Standalone Matches Posts in reply to a specific user to:XDevelopers OR to:APIretweets_of:Standalone Matches Retweets of a specific user retweets_of:twitterdev
URL Operators
Operator Type Summary Example url:Standalone Tokenized match on URL (matches url or expanded_url fields) url:"https://developer.twitter.com"
Context and Entity Operators
Operator Type Summary Example context:Standalone Matches Posts with a specific domain/entity pair context:10.799022225751871488entity:Standalone Matches Posts with a specific entity string value (recent search only) entity:"Michael Jordan"conversation_id:Standalone Matches Posts in a conversation thread conversation_id:1334987486343299072
List Operator
Operator Type Summary Example list:Standalone Matches Posts from members of a specific List list:123
Post Reference Operators
Operator Type Summary Example in_reply_to_tweet_id:Standalone Matches replies to a specific Post in_reply_to_tweet_id:1539382664746020864retweets_of_tweet_id:Standalone Matches Retweets of a specific Post retweets_of_tweet_id:1539382664746020864quotes_of_tweet_id:Standalone Matches Quote Tweets of a specific Post quotes_of_tweet_id:1539382664746020864
Location Operators
Operator Type Summary Example place:Standalone Matches Posts tagged with a location place:"new york city" OR place:seattleplace_country:Standalone Matches Posts with a country code place_country:US OR place_country:MXpoint_radius:Standalone Matches Posts within a radius of a point point_radius:[2.355128 48.861118 16km]bounding_box:Standalone Matches Posts within a bounding box bounding_box:[-105.301758 39.964069 -105.178505 40.09455]
Post Type Operators
Operator Type Summary Example is:retweetConjunction required Matches Retweets data @XDevelopers -is:retweetis:replyConjunction required Matches replies from:XDevelopers is:replyis:quoteConjunction required Matches Quote Tweets "sentiment analysis" is:quoteis:verifiedConjunction required Matches Posts from verified authors #nowplaying is:verified-is:nullcastConjunction required Excludes promotional Posts (must be negated) "mobile games" -is:nullcast
Content Type Operators
Operator Type Summary Example has:hashtagsConjunction required Matches Posts with hashtags from:XDevelopers -has:hashtagshas:cashtagsConjunction required Matches Posts with cashtags #stonks has:cashtagshas:linksConjunction required Matches Posts with links from:XDevelopers has:linkshas:mentionsConjunction required Matches Posts with mentions #nowplaying has:mentionshas:mediaConjunction required Matches Posts with media (photo, GIF, video) (kittens OR puppies) has:mediahas:imagesConjunction required Matches Posts with images #meme has:imageshas:video_linkConjunction required Matches Posts with native X videos #icebucketchallenge has:video_linkhas:geoConjunction required Matches Posts with geolocation data recommend #paris has:geo
Language Operator
Operator Type Summary Example lang:Conjunction required Matches Posts classified as a specific language recommend #paris lang:en
Engagement Operators
Use engagement operators to filter Posts by minimum likes, replies, or reposts. These operators are available on the /2/tweets/search/recent and /2/tweets/search/all endpoints.
Operator Type Summary Example min_likes:Conjunction required Matches Posts with at least the specified number of likes from:XDevelopers min_likes:100min_replies:Conjunction required Matches Posts with at least the specified number of replies #announcement min_replies:50min_reposts:Conjunction required Matches Posts with at least the specified number of reposts lang:en min_reposts:25
Combine engagement operators to surface high-signal Posts. For example, from:XDevelopers min_likes:100 min_reposts:25 returns Posts from @XDevelopers with at least 100 likes and 25 reposts.
Logical Operators
Operator Summary Example ORLogical OR between expressions cat OR dogSpace (AND) Logical AND between expressions cat dog (both required)()Grouping for complex expressions (cat OR dog) -is:retweet-Negation/exclusion cat -grumpy
Supported Languages
The lang: operator supports these BCP 47 language codes:
Language Code Language Code Language Code Amharic amGreek elPortuguese ptArabic arGujarati guRomanian roArmenian hyHebrew iwRussian ruBasque euHindi hiSerbian srBengali bnHungarian huSimplified Chinese zh-CNBulgarian bgIndonesian inSlovak skCatalan caItalian itSlovenian slCroatian hrJapanese jaSpanish esCzech csKannada knSwedish svDanish daKorean koTamil taDutch nlLatvian lvTelugu teEnglish enLithuanian ltThai thEstonian etMalayalam mlTraditional Chinese zh-TWFinnish fiMarathi mrTurkish trFrench frNorwegian noUkrainian ukGerman dePersian faUrdu urGeorgian kaPolish plVietnamese vi
Query limitations
Access level Recent search Full-archive search Self-serve 512 characters 1,024 characters Enterprise 4,096 characters 4,096 characters
Next steps
Build a query Learn query syntax and best practices
Search introduction Get started with Search
Query Builder Tool Build and test queries interactively