DEV Community

loading...

Advanced search on Twitter

Eric Leung
I like to share what I'm learning on data science, programming, and technology.
・2 min read

There is an advanced search feature on Twitter. Clicking on this, you see a nice popup and text boxes to fill in.

After you fill in these boxes, Twitter populates the normal search bar with the appropriate text to implement those more advanced features. I couldn't find a list of how you can directly write out these searches, so here I write out how to do advanced Twitter searches without using that popup.

All of these words

The most basic of the searches. Type in all the words you want to be found anywhere in a tweet.

what's happening
Enter fullscreen mode Exit fullscreen mode

Exact phrase

In contrast with the previous search, here you can be specific on the exact placement of words using quotes.

"happy hour"
Enter fullscreen mode Exit fullscreen mode

Any of these words

This is similar to "All of these words", except these tweets don't have to include all the words at the same time. A tweet could contain one, two, or more of these words.

cats OR dogs
Enter fullscreen mode Exit fullscreen mode

Note, the parentheses around searches will ensure your search is isolated from other searches. For example,

"happy hour" (cats OR dogs)
Enter fullscreen mode Exit fullscreen mode

None of these words

You can find tweets without specific words using the minus sign.

-dogs
Enter fullscreen mode Exit fullscreen mode

Hashtags

To search a hashtag, simply write it out with the hashtag in front of the word(s).

#ThrowbackThursday
Enter fullscreen mode Exit fullscreen mode

Language

Use the two-letter code for the language to search for those tweets.

lang:es hola
Enter fullscreen mode Exit fullscreen mode

Account direction of tweet

You can search for tweets from and to particular accounts by using the from: and to: keywords.

from:twitter
Enter fullscreen mode Exit fullscreen mode
to:twitter
Enter fullscreen mode Exit fullscreen mode

Mentioning accounts

Simply add the Twitter account with the @ symbol in front.

@Twitter
Enter fullscreen mode Exit fullscreen mode

Miscellaneous filters

Without and with replies.

-filter:replies
filter:replies
Enter fullscreen mode Exit fullscreen mode

Without and with links.

-filter:links
filter:links
Enter fullscreen mode Exit fullscreen mode

Engagement thresholds

Minimum number of replies, favorites,

min_replies:42
min_faves:42
min_retweets:42
Enter fullscreen mode Exit fullscreen mode

Date ranges

Search within specific time intervals using since: and until:.

since:2014-06-14 until:2016-05-15
Enter fullscreen mode Exit fullscreen mode

Cheatsheet

what's happening                   # all of the words somewhere
"happy hour"                       # extract phrasing
cats OR dogs                       # any combination of words
"happy hour" (cats OR dogs)        # combine search types
-dogs                              # tweets not containing words
#ThrowbackThursday                 # hashtag searching
lang:es hola                       # non-English tweets
from:twitter                       # tweets from an account
to:twitter                         # tweeting at an account
@Twitter                           # they mention accounts
-filter:replies                    # filter out replies
filter:replies                     # filter for replies
-filter:links                      # filter out links
filter:links                       # filter for links
min_replies:42                     # minimum replies
min_faves:42                       # minimum favorites
min_retweets:42                    # minimum re-tweets
since:2014-06-14 until:2016-05-15  # time ranges
Enter fullscreen mode Exit fullscreen mode

I hope this proves helpful and makes searching quicker for you.

Discussion (0)