Enterprise operators
Below are the operators available with PowerTrack and Historical PowerTrack. A subset of these are available with the 30-Day and Full-Archive search APIs. See this table for a product-by-product list of available operators.
Operator |
Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
keyword |
Matches a keyword within the text body or URL of a Post. Keywords must start with either a digit (0-9) or any non-puncutation character. Keyword matching is a tokenized match, meaning that your keyword will be matched against the tokenized text of the Post body – tokenization is based on punctuation, symbol, and separator Unicode basic plane characters. To match strings containing punctuation (for example, coca-cola), symbol, or separator characters, you must use a quoted "exact phrase match". Note: This operator will match on both URLs and unwound URLs within a Post. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emoji |
Matches an emoji within the body of a Post. Emojis are a tokenized match, meaning that your emoji will be matched against the tokenized text of the Post body – tokenization is based on punctuation, symbol/emoji, and separator Unicode basic plane characters. For example, a Post with the text “I like 🍕” would be split into the following tokens: I, like, 🍕. These tokens would then be compared to the emoji used in your rule. Note that if an emoji has a variant, you must use “quotations” to add to a rule. Example: (🍕 OR 💜 OR 🐢) -🤖 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"exact phrase match" |
Matches an exact phrase within the body of a Post. Example: Note: In 30 Day Search and Full Archive Search, punctuation is not tokenized and is instead treated as whitespace. Note: This operator will match on both URLs and unwound URLs within a Post. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# |
Matches any Post with the given hashtag. This operator performs an exact match, NOT a tokenized match, meaning the rule “2016” will match posts with the exact hashtag “2016”, but not those with the hashtag “2016election” Example: Note: that the hashtag operator relies on X's entity extraction to match hashtags, rather than extracting the hashtag from the body itself. See HERE for more information on X Entities JSON attributes. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@ |
Matches any Post that mentions the given username. The to: operator returns a subset match of the @mention operator. Example: Note: that the mention operator relies on X's entity extraction to match mentioned users, rather than extracting the mention from the body itself. See HERE for more information on X Entities JSON attributes. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"keyword1 keyword2"~N |
Commonly referred to as a proximity operator, this matches a Post where the keywords are no more than N tokens from each other. If the keywords are in the opposite order, they can not be more than N-2 tokens from each other. Can have any number of keywords in quotes. N cannot be greater than 6. Example:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
contains: | Substring match for Posts that have the given substring in the body, regardless of tokenization. In other words, this does a pure substring match, and does not consider word boundaries. Use double quotes to match substrings that contain whitespace or punctuation. Example: Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
from: |
Matches any Post from a specific user. Example: The value must be the user’s X numeric Account ID or username (excluding the @ character). See HERE for looking up numeric X Account IDs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
to: |
Matches any post that is in reply to a particular user. Example: The value must be the user’s numeric Account ID or username (excluding the @ character). See HERE for looking up numeric X Account IDs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
url: |
Performs a tokenized (keyword/phrase) match on the expanded URLs of a post (similar to url_contains). Example: @XDevelopers url:"developer.x.com" Note: When using PowerTrack or Historical PowerTrack, this operator will match on URLs contained within the original Post of a Quote Tweet. For example, if your rule includes url:"developer.x.com", and a Post contains that URL, any Quote Tweets of that Post will be included in the results. This is not the case when using the Search API. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
url_title: |
Available alias: within_url_title: Performs a keyword/phrase match on the (new) expanded URL HTML title metadata. See HERE for more information on expanded URL enrichment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
url_description: |
Available alias: within_url_description: Performs a keyword/phrase match on the (new) expanded page description metadata. See HERE for more information on expanded URL enrichment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
url_contains: |
Matches Posts with URLs that literally contain the given phrase or keyword. To search for patterns with punctuation in them (for example, google.com) enclose the search term in quotes. Example: Note: If you’re using the Expanded URL output format, we will match against the expanded URL as well. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bio: |
Available alias: user_bio: Matches a keyword or phrase within the user bio of a Post. This is a tokenized match within the contents of the 'description' field within the User object. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bio_name: |
Matches a keyword within the user bio name of a Post. This is a tokenized match within the contents of a user’s “name” field within the User object. Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bio_location: |
Available alias: user_bio_location: Matches Posts where the User object's location contains the specified keyword or phrase. This operator performs a tokenized match, similar to the normal keyword rules on the message body. This location is part of the User object, and is the account's 'home' lcoation, is a non-normalized, user-generated, free-form string, and is different from a Post's location (when available). Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
statuses_count: |
Available alias: tweets_count: Matches Posts when the author has posted a number of statuses that falls within the given range. If a single number is specified, any number equal to or higher will match. Additionally, a range can be specified to match any number in the given range (for example, statuses_count:1000..10000). Example: @XDevelopers statuses_count:1..10 Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
followers_count: |
Matches Posts when the author has a followers count within the given range. If a single number is specified, any number equal to or higher will match. Additionally, a range can be specified to match any number in the given range (for example, followers_count:1000..10000).' Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
friends_count: |
Available alias: following_count: Matches Posts when the author has a friends count (the number of users they follow) that falls within the given range. If a single number is specified, any number equal to or higher will match. Additionally, a range can be specified to match any number in the given range (for example, friends_count:1000..10000). Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
listed_count: |
Available alias: user_in_lists_count: Matches Posts when the author has been listed within X a number of times falls within the given range. If a single number is specified, any number equal to or higher will match. Additionally, a range can be specified to match any number in the given range (for example, listed_count:10..100). Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$ | Matches any Post that contains the specified ‘cashtag’ entity. Example: Note: The cashtag operator relies on X's ‘symbols’ entity extraction to match cashtags, rather than trying to extract the cashtag from the body itself. See HERE for more information on X Entities JSON attributes. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
retweets_of: |
Available alias: retweets_of_user: Matches Posts that are Retweets of a specified user. Accepts both usernames and numeric X Account IDs (NOT Post status IDs). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
retweets_of_status_id: |
Available alias: retweets_of_tweet_id: Deliver only explicit Retweets of the specified Post. Note that the status ID used should be the ID of an original Post and not a Retweet. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
in_reply_to_status_id: |
Available alias: in_reply_to_tweet_id: Deliver only explicit replies to the specified Post. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sample: | Returns a random sample of Posts that match a rule rather than the entire set of Posts. Sample percent must be represented by an integer value between 1 and 100. This operator applies to the entire rule and requires any “OR’d” terms be grouped. Important Note: The sample operator first reduces the scope of the firehose to X%, then the rule/filter is applied tio that sampled subset. If you are using, for example, sample:10, each Post has a 10% chance of being in the sample. The sampling is deterministic, and you will get the same data sample in realtime as you would if you pulled the data historically. Example: Note: Only available with PowerTrack and Historical PowerTrack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
source: | Matches any Post generated by the given source application. The value must be either the name of the application, or the application’s URL. Cannot be used alone. Example: #happybirthday source:"X for iPhone" "This is a test X from my TestingApp" source:MyTestAppName Note: As a X app developer, Posts created programattically by your application will have the source of your application Name and Website URL set in your app settings. The source operator seraches on the Post source attribute. See HERE for more information on X Entities JSON attributes. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lang: |
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. This operator is not recommended to be used alone, matching volume will be very high. The list below represents the current supported languages and their corresponding BCP 47 language indentifier:
Example: (@XDevelopers OR to:XDevelopers) lang:es Note: The language operator matches on the specific Post language determined by X and set as the lang Post attribute. See HERE for more information on X Entities JSON attributes. If no language classification can be made for a Post, the Post lang will be set as ‘und’ (for undefined). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
place: |
Matches Posts tagged with the specified location or X place ID (see examples). Multi-word place names (“New York City”, “Palo Alto”) should be enclosed in quotes. Example: Note: See the GET geo/search public API endpoint for how to obtain X place IDs. Note: This operator will not match on Retweets, since Retweet's places are attached to the original Post. It will also not match on places attached to the original Post of a Quote Tweet. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
place_country: |
Matches Posts where the country code associated with a tagged place/location matches the given ISO alpha-2 character code. Example: Valid ISO codes can be found here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Note: This operator will not match on Retweets, since Retweet's places are attached to the original Post. It will also not match on places attached to the original Post of a Quote Tweet. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
point_radius:[lon lat radius] |
Matches against the Exact Location (x,y) of the Post when present, and in X, against a “Place” geo polygon, where the Place is fully contained within the defined region.
Example: point_radius:[2.355128 48.861118 16km]
Note: This operator will not match on Retweets, since Retweet's places are attached to the original Post. It will also not match on places attached to the original Post of a Quote Tweet. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bounding_box:[west_long south_lat east_long north_lat] |
Available alias: geo_bounding_box: Matches against the Exact Location (long, lat) of the Post when present, and in X, against a “Place” geo polygon, where the Place is fully contained within the defined region.
Example: Note: This operator will not match on Retweets, since Retweet's places are attached to the original Post. It will also not match on places attached to the original Post of a Quote Tweet. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
profile_country: |
Exact match on the “countryCode” field from the “address” object in the Profile Geo enrichment. Uses a normalized set of two-letter country codes, based on ISO-3166-1-alpha-2 specification. This operator is provided in lieu of an operator for “country” field from the “address” object to be concise. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
profile_region: |
Matches on the “region” field from the “address” object in the Profile Geo enrichment. This is an exact full string match. It is not necessary to escape characters with a backslash. For example, if matching something with a slash, use “one/two”, not “one\/two”. Use double quotes to match substrings that contain whitespace or punctuation. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
profile_locality: |
Matches on the “locality” field from the “address” object in the Profile Geo enrichment. This is an exact full string match. It is not necessary to escape characters with a backslash. For example, if matching something with a slash, use “one/two”, not “one\/two”. Use double quotes to match substrings that contain whitespace or punctuation. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
profile_subregion: |
Matches on the “subRegion” field from the “address” object in the Profile Geo enrichment. In addition to targeting specific counties, these operators can be helpful to filter on a metro area without defining filters for every city and town within the region. This is an exact full string match. It is not necessary to escape characters with a backslash. For example, if matching something with a slash, use “one/two”, not “one\/two”. Use double quotes to match substrings that contain whitespace or punctuation. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:geo |
Matches Posts that have Post-specific geo location data provided from X. This can be either “geo” lat-long coordinate, or a “location” in the form of a X “Place”, with corresponding display name, geo polygon, and other fields. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:profile_geo |
Available alias: has:derived_user_geo Matches Posts that have any Profile Geo metadata, regardless of the actual value. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:links |
This operator matches Posts that contain a link or referenced media in the "text" object of the payload. Note: In addition to this operator matching Posts with a link in their text, it also matches Posts with media (image, video, gif), and Quote Tweets. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
is:retweet |
Deliver only explicit retweets that match a rule. Can also be negated to exclude retweets that match a rule from delivery and only original content is delivered. This operator looks only for true Retweets. Quoted Tweets which do not use X's Retweet functionality will not be matched by this operator. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
is:reply |
Delivers only explicit replies that match a rule. Can also be negated to exclude replies that match a rule from delivery (see example request below). When used with PowerTrack, this operator matches on replies to an original Post, replies in quoted Posts and replies in Retweets. When used with the Search API, this operator only matches on replies to an original Post and excludes replies in quoted Post and replies in Retweets. Example: #contest123 is:reply @XDevelopers -is:reply Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
is:quote | Delivers only Quote Tweets, or Posts that reference another Post, as identified by the "is_quote_status":true in Post payloads. Can also be negated to exclude Quote Tweets. Example: Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
is:verified |
Deliver only Posts where the author is “verified” by X. Can also be negated to exclude Posts where the author is verified. Example: @XDevelopers is:verified Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:mentions |
Matches Posts that mention another X user. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:hashtags |
Matches Posts that contain a hashtag. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:media |
Available alias: has:media_link Matches Posts that contain a media url classified by X. For example, pic.x.com. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:images |
Matches Posts that contain a media url classified by X. For example, pic.x.com. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:videos |
Available alias: has:video_link Matches Posts that contain native X videos, uploaded directly to X. This will not match on videos created with YouTube, Periscope, or Posts with links to other video hosting sites. Note: When using the Search API, this operator must be used in conjunction with other operators that don't include
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
has:symbols |
Matches Posts that contain a cashtag symbol (with a leading ‘$’ character. For example, $tag). Note: When using the Search API, this operator must be used in conjunction with other operators that don't include |