Skip to content

Search operators

Twitter supports dozens of advanced search filters and operators that let you find specific tweets, users, or media.

These operators work with search.tweets() along with most official clients. They mostly do not work with search.adaptive, as it uses v1.1 search.

Operators

Tweet content

OperatorFinds tweets…
nasa esaContaining both "nasa" and "esa". (Spaces = AND)🔗
nasa OR esaEither "nasa" or "esa" (or both). OR must be capitalized.🔗
"state of the art"The exact phrase. Also matches "state-of-the-art".🔗
"this is the * time"Quoted phrase with a wildcard. * only works inside quotes.🔗
+radioooooForces the term as-is. Prevents "did you mean" corrections.🔗
-loveExcludes tweets containing "love". Works with phrases: -"live laugh love".🔗
#tgifTweets containing a specific hashtag.🔗
$TWTRTweets containing a cashtag (stock symbols).🔗
What ?Finds tweets where a question mark is used.🔗
:) / :(Matches positive (:), :-), :P, :D) or negative (:(, :-() emoticons.🔗
👀Matches specific emojis. Usually requires a keyword or lang: to work.🔗
url:google.comMatches URLs. Tokenized: use underscores for hyphens (e.g., url:t_mobile.com).🔗
lang:enFilters by language (e.g., en, es, fr, ja). See Language codes.🔗

User & account

OperatorFinds tweets…Example
from:userSent by a specific @username.dogs from:NASA
to:userTweets that are a direct reply to @username.to:NASA #MoonTunes
@userTweets mentioning @username. Combine with -from:user for mentions only.@cern -from:cern
list:IDTweets from members of a public List (Use ID or user/slug).list:esa/astronauts
filter:verifiedFrom legacy verified accounts.filter:verified
filter:blue_verifiedFrom accounts with X Premium (paid checkmark).filter:blue_verified
filter:followsOnly from accounts you follow. (Cannot be negated).kitten filter:follows
filter:socialFrom your extended network (based on activity).filter:social

Location

OperatorFinds tweets…Example
near:cityGeotagged in a specific location. Supports phrases: near:"The Hague".near:London
near:meGeotagged near your current IP/detected location.near:me
within:radiusUse with near to set a radius (km or mi).fire near:SF within:10km
geocode:lat,long,rTweets within radius r of exact coordinates.geocode:37.77,-122.41,1km
place:IDSearch by X Place Object ID.place:96683cc9126741d1

Time & date

OperatorFinds tweets…Example
since:YYYY-MM-DDSent on or after this date. (Inclusive).since:2024-01-01
until:YYYY-MM-DDSent before this date. (Not inclusive).until:2024-01-01
since:DATE_TIME_TZGranular time: since:2023-01-01_23:59:59_UTC.since:2023-10-13_00:00:00_UTC
since_time:12345On or after a specific Unix timestamp (seconds).since_time:1561720321
until_time:12345Before a specific Unix timestamp (seconds).until_time:1562198400
since_id:IDAfter (not inclusive) a specific Snowflake Tweet ID.since_id:1138872932
max_id:IDAt or before (inclusive) a specific Snowflake Tweet ID.max_id:1144730280
within_time:10mWithin the last d (days), h (hours), m (minutes), or s (seconds).nasa within_time:30s

Tweet type & logic

OperatorFinds tweets…Example
filter:nativeretweetsOnly "retweet button" retweets. (Last 7-10 days only).from:nasa filter:nativeretweets
include:nativeretweetsIncludes retweets in results (hidden by default).include:nativeretweets
filter:repliesOnly tweets that are replies.filter:replies -to:nasa
filter:self_threadsOnly self-replies (the author replying to themselves).filter:self_threads
filter:quoteOnly contains Quote Tweets.filter:quote
conversation_id:IDEvery tweet in a specific thread/conversation.conversation_id:1140437409
quoted_tweet_id:IDQuotes of a specific Tweet ID.quoted_tweet_id:113863184
quoted_user_id:IDAll quotes of a specific User ID (numeric).quoted_user_id:11348282
card_name:pollXchoiceTweets with polls. Options: poll2choice_text_only, poll3choice, etc.card_name:poll4choice_text_only

Engagement & media

OperatorFinds tweets…Example
filter:has_engagementHas at least one like/reply/RT. Negate to find "dead" tweets.-filter:has_engagement
min_retweets:XMinimum number of Retweets.min_retweets:500
min_faves:XMinimum number of Likes (Faves).min_faves:1000
min_replies:XMinimum number of Replies.min_replies:100
-min_faves:XMaximum number of Likes.-min_faves:10
filter:mediaAny media (images, video, GIFs).cat filter:media
filter:imagesTweets containing images.filter:images
filter:twimgSpecifically native X/Twitter images (pic.twitter.com).filter:twimg
filter:videosAny video (Native, YouTube, etc.).filter:videos
filter:consumer_videoNative X video only.filter:consumer_video
filter:pro_videoAmplify/Pro video only.filter:pro_video
filter:spacesLive or recorded Twitter Spaces.filter:spaces
card_name:animated_gifTweets containing GIFs.card_name:animated_gif

Matching

Logical grouping

Spaces are implicit AND. Use parentheses to group conditions.

  • Query: (puppy OR kitten) (sweet OR cute) -filter:nativeretweets min_faves:10
  • Meaning: Find tweets about puppies or kittens AND sweet or cute, excluding retweets, with 10+ likes.

Force literal matches

X uses "signal words." If you search for the word photo, X thinks you want filter:images. To avoid this, wrap it in quotes, like "photo".

URL tokenization

X strips hyphens from parameters and you should use underscore instead. url:t-mobile.com won't work, but url:t_mobile.com will. This applies to all URL-based operators (url:, filter:links, etc.).

From a technical perspective, quote-tweets are tweets with a URL of another tweet. It's possible to find Tweets that quote a specific Tweet by searching for the URL of that Tweet.

To find everyone quoting a specific tweet, search for the tweet's URL and exclude the original author, like https://x.com/jack/status/20 -from:jack.

Any parameters must be removed or only Tweets that contain the parameter as well are found. This includes the automatic client parameter added when using the share menu (eg. ?s=20 for the Web App and ?s=09 for the Android app)

Snowflakes

All X IDs (tweets, users) embed a timestamp. This allows you to search with precise time boundaries using since_id or max_id.

To convert an ID to millisecond epoch, use milliepoch = (tweet_id >> 22) + 1288834974657.

To convert an epoch to ID, use tweet_id = (milliepoch - 1288834974657) << 22.

python
def milliepoch_to_id(ms):
    if ms <= 1288834974657: raise ValueError("Too early")
    return (ms - 1288834974657) << 22

def id_to_milliepoch(id):
    if id <= 0: raise ValueError("Invalid ID")
    return (id >> 22) + 1288834974657

Language codes

Twitter supports several unique language filters for specific tweet structures:

CodePurpose
lang:undUnknown (usually just links, numbers, or emojis).
lang:qamTweets containing Mentions only.
lang:qctTweets containing Cashtags only.
lang:qhtTweets containing Hashtags only.
lang:qmeTweets containing Media links only.
lang:qstTweets with Very short text.
lang:zxxNo text (Media or Twitter Card only).

Searching by client

You can filter tweets by the app they were sent from.

These should work for every single client, official or not. If it isn't, try putting the client name in quotes or replace spaces with underscores.

You cannot copy an existing name. This operator needs to be combined with something else to work, eg lang:en.

Examples:

  • source:twitter_web_client
  • source:twitter_web_app
  • source:twitter_for_iphone
  • source:twitter_for_ipad
  • source:twitter_for_mac
  • source:twitter_for_android
  • source:twitter_ads (promoted tweets)
  • source:tweetdeck
  • source:tweetdeck_web_app
  • source:twitter_for_advertisers
  • source:twitter_media_studio
  • source:cloudhopper (sms gateway)
  • custom clients, like source:IFTTT or source:Instagram

News site filter

When using filter:news, Twitter makes sure every result includes a link to a whitelist of "news" websites.

Limitations

  • Operator limit: You can typically only use ~22-23 operators in a single query.

  • Card names: card_name: searches are usually limited to the last 7-8 days of data.

  • Private accounts: Tweets from private (protected), suspended, or locked accounts will never appear in search results.

  • Time logic: Date/Time operators usually must be combined with a keyword or user filter to function correctly.

not affiliated with X Corp.