keyword | Standalone | Core | Matches a keyword within the body of a Post. This is a tokenized match, meaning that your keyword string will be matched against the tokenized text of the Post body. Tokenization splits words based on punctuation, symbols, and Unicode basic plane separator characters. For example, a Post with the text “I like coca-cola” would be split into the following tokens: I, like, coca, cola. These tokens would then be compared to the keyword string used in your query. To match strings containing punctuation (for example coca-cola), symbol, or separator characters, you must wrap your keyword in double-quotes. Example: pepsi OR cola OR "coca cola" |
emoji | Standalone | Core | Matches an emoji within the body of a Post. Similar to a keyword, emojis are a tokenized match, meaning that your emoji will be matched against the tokenized text of the Post body. Note that if an emoji has a variant, you must wrap it in double quotes to add to a query. Example: (😃 OR 😡) 😬 |
"exact phrase match" | Standalone | Core | Matches the exact phrase within the body of a Post. Example: ("X API" OR #v2) -"recent counts" |
# | Standalone | Core | Matches any Post containing a recognized hashtag, if the hashtag is a recognized entity in a Post. This operator performs an exact match, NOT a tokenized match, meaning the rule #thanku will match posts with the exact hashtag #thanku, but not those with the hashtag #thankunext. Example: #thankunext #fanart OR @arianagrande |
@ | Standalone | Core | Matches any Post that mentions the given username, if the username is a recognized entity (including the @ character). Example: (@XDevelopers OR @API) -@X |
$ | Standalone | Advanced | Matches any Post that contains the specified ‘cashtag’ (where the leading character of the token is the ‘’character).NotethatthecashtagoperatorreliesonX′s‘symbols’entityextractiontomatchcashtags,ratherthantryingtoextractthecashtagfromthebodyitself.Example:‘twtr OR @XDevelopers -$fb` |
from: | Standalone | Core | Matches any Post from a specific user. The value can be either the username (excluding the @ character) or the user’s numeric user ID. You can only pass a single username/ID per from: operator. Example: from:XDevelopers OR from:API -from:X |
to: | Standalone | Core | Matches any Post that is in reply to a particular user. The value can be either the username (excluding the @ character) or the user’s numeric user ID. You can only pass a single username/ID per to: operator. Example: to:XDevelopers OR to:API -to:X |
url: | Standalone | Core | Performs a tokenized match on any validly-formatted URL of a Post. This operator can matches on the contents of both the url or expanded_url fields. For example, a Post containing “You should check out X Developer Labs: https://t.co/c0A36SWil4” (with the short URL redirecting to https://developer.x.com) will match both the following rules: from:XDevelopers url:"https://developer.x.com" and from:XDevelopers url:"https://t.co" . Tokens and phrases containing punctuation or special characters should be double-quoted. |
retweets_of: | Standalone | Core | Matches Posts that are Retweets of the specified user. The value can be either the username (excluding the @ character) or the user’s numeric user ID. You can only pass a single username/ID per retweets_of: operator. Example: retweets_of:XDevelopers OR retweets_of:API |
context: | Standalone | Core | Matches Posts with a specific domain id/entity id pair. You can only pass a single domain/entity per context: operator. Example: context:domain_id.entity_id . You can combine multiple domain/entities using the OR operator: (context:47.113922 9372198469633 OR context:11.1088514520308342784) |
entity: | Standalone | Core | Matches Posts with a specific entity string value. You can only pass a single entity: operator. Example: entity:"string declaration of entity/place" . Please note that this is only available with recent search. |
conversation_id: | Standalone | Core | Matches Posts that share a common conversation ID. A conversation ID is set to the Post ID of a Post that started a conversation. As Replies to a Post are posted, even Replies to Replies, the conversation_id is added to its JSON payload. You can only pass a single conversation ID per conversation_id: operator. Example: conversation_id:1334987486343299072 (from:XDevelopers OR from:API) |
list: | Standalone | Advanced | Matches Posts posted by users who are members of a specified list. For example, if @XDevelopers and @API were members of List 123, and you included list:123 in your query, your response will only contain Posts that have been published by those accounts. You can find List IDs by using the List lookup endpoint. Example: list:123 |
place: | Standalone | Advanced | Matches Posts tagged with the specified location or X place ID. Multi-word place names (“New York City”, “Palo Alto”) should be enclosed in quotes. You can only pass a single place per place: operator. Note: See the GET geo/search standard v1.1 endpoint for how to obtain X place IDs. Example: place:"new york city" OR place:seattle OR place:fd70c22040963ac7 |
place_country: | Standalone | Advanced | Matches Posts where the country code associated with a tagged place/location matches the given ISO alpha-2 character code. You can find a list of valid ISO codes on Wikipedia. You can only pass a single ISO code per place_country: operator. Example: place_country:US OR place_country:MX OR place_country:CA |
point_radius: | Standalone | Advanced | Matches against the place.geo.coordinates object of the Post when present, and in X, against a place geo polygon, where the Place polygon is fully contained within the defined region. point_radius:[longitude latitude radius] . Units of radius supported are miles (mi) and kilometers (km). Radius must be less than 25mi. Longitude is in the range of ±180. Latitude is in the range of ±90. All coordinates are in decimal degrees. Rule arguments are contained within brackets, space delimited. Example: point_radius:[2.355128 48.861118 16km] OR point_radius:[-41.287336 174.761070 20mi] |
bounding_box: | Standalone | Advanced | Matches against the place.geo.coordinates object of the Post when present, and in X, against a place geo polygon, where the place polygon is fully contained within the defined region. bounding_box:[west_long south_lat east_long north_lat] . Width and height of the bounding box must be less than 25mi. Longitude is in the range of ±180. Latitude is in the range of ±90. All coordinates are in decimal degrees. Rule arguments are contained within brackets, space delimited. Example: bounding_box:[-105.301758 39.964069 -105.178505 40.09455] |
is:retweet | Conjunction required | Core | Matches on Retweets that match the rest of the specified rule. This operator looks only for true Retweets (for example, those generated using the Retweet button). Quote Tweets will not be matched by this operator. Example: data @XDevelopers -is:retweet |
is:reply | Conjunction required | Core | Deliver only explicit replies that match a rule. Can also be negated to exclude replies that match a query from delivery. Note: This operator is also available with the filtered stream endpoint. When used with filtered stream, this operator matches on replies to an original Post, replies in quoted Posts, and replies in Retweets. Example: from:XDevelopers is:reply |
is:quote | Conjunction required | Core | Returns all Quote Tweets, also known as Posts with comments. Example: "sentiment analysis" is:quote |
is:verified | Conjunction required | Core | Deliver only Posts whose authors are verified by X. Example: #nowplaying is:verified |
-is :nullcast | Conjunction required | Advanced | Removes Posts created for promotion only on ads.x.com that have a "source":"Twitter for Advertisers (legacy)" or "source":"Twitter for Advertisers" . This operator must be negated. For more info on Nullcasted Posts, see our page on Post availability. Example: "mobile games" -is:nullcast |
has:hashtags | Conjunction required | Core | Matches Posts that contain at least one hashtag. Example: from:XDevelopers -has:hashtags |
has:cashtags | Conjunction required | Advanced | Matches Posts that contain a cashtag symbol (with a leading ‘’character.Forexample,‘tag). Example: #stonks has:cashtags` |
has:links | Conjunction required | Core | This operator matches Posts which contain links and media in the Post body. Example: from:XDevelopers announcement has:links |
has:mentions | Conjunction required | Core | Matches Posts that mention another X user. Example: #nowplaying has:mentions |
has:media | Conjunction required | Core | Matches Posts that contain a media object, such as a photo, GIF, or video, as determined by X. This will not match on media created with Periscope, or Posts with links to other media hosting sites. Example: (kittens OR puppies) has:media |
has:images | Conjunction required | Core | Matches Posts that contain a recognized URL to an image. Example: #meme has:images |
has:videos | Conjunction required | Core | Matches Posts that contain native X videos, uploaded directly to X. This will not match on videos created with Periscope, or Posts with links to other video hosting sites. Example: #icebucketchallenge has:videos |
has:geo | Conjunction required | Advanced | Matches Posts that have Post-specific geolocation data provided by the X user. This can be either a location in the form of a X place, with the corresponding display name, geo polygon, and other fields, or in rare cases, a geo lat-long coordinate. Note: Operators matching on place (Post geo) will only include matches from original posts. Retweets do not contain any place data. Example: recommend #paris has:geo -bakery |
lang: | Conjunction required | Core | Matches Posts that have been classified by X as being of a particular language (if, and only if, the Post has been classified). It is important to note that each Post is currently only classified as being of one language, so AND’ing together multiple languages will yield no results. You can only pass a single BCP 47 language identifier per lang: operator. Note: if no language classification can be made the provided result is ‘und’ (for undefined). Example: recommend #paris lang:en |