A Guide To Twitter Search Operators: OSINT 🕵️‍♂️

RoddyT3ch
7 min readApr 22, 2023

--

Illustration — Virrage Images

Whether or not you’ve signed up for Twitter, you have the power to perform detailed queries on the endless stream of Tweets by using the sites search operators. This extremely useful feature isn’t blocked behind a login screen. And it doesn’t take too long to learn, All it takes is a few simple operators in combination or alone to enhance your search for information to be more narrow and effective.

Now In this guide, we are going to explore some Twitters search operators and their use cases. Which can be used by many types of professionals/amateur's alike to find sales leads, conduct research for a paper, follow trends/culture, and even Conduct Real-time OSINT & much more. With the help of Twitters millions of active users.

What are Search Operators:

Photo by Tobias Aeppli on Pexels

To optimize searches on Twitter, one must first understand the importance of using search operators to get the result you need. Search operators are specific words, phrases, and symbol that can be added into a search bar to help pinpoint the results you are looking for given the used operator or operators.

Now this ability to pinpoint the results you are looking is vital to cut out all of the unnecessary information currently unrelated to your given investigation/interests. Lets say you want to find tweets only within a certain area that contains media(photos, videos). To gain information on a current event there. You can do that with twitters search operators.

Now lets get started with some very useful search operators that I use often during my investigations/knowledge gathering expeditions, Let begin!

Search Operators:

Quotes:

“search term” this operator search for tweets with the quoted word typed out. This will lead to search results with the word(s) in the exact order and phrasing as they are written in the search.

  • “Cute Cats”

OR Operator

term1 OR term2 This operator will search for tweets containing either “term1” or “term2” (or potentially both), as well as whatever other search terms are found.

search term -search term

This will search for any tweets containing the first search term but that does NOT contain the second search term. For example: “food -hotdogs” this search will find tweets related to food but excluding the keyword hotdogs

#hashtag

The hashtag is one of the most commonly used/known used operators on twitter very iconic to the platform. This operator allows for anything following the # symbol to be searched. Hashtags can be featured on the trending page if enough people use them in their tweets.

from:username

Using this operator, you will get resulting tweets only from that user. Combine this with specific words or phrases to find tweets from the specific account about particular topics. For example lets use it on twitters CEO, Elon Musk.

to:username

This operator will search tweets directed to a specific account. For example lets use the president of Ukraine, Volodymyr Zelenskyy

query results

As we can see two very different view points on the president.

@username

This operator allows user to view all tweets that have mentioned a specific account by using the @ symbol.

since:YYYY-MM-DD

This operator will show tweets that have been sent since the date provided.

  • movies since:2017–7–27

until:YYYY-MM-DD

This operator will show tweets that have been sent before the date provided.

  • movies until:2015–10–8

filter:media

Adding this operator onto a search will narrow the results down to tweets containing media(images, videos, etc). For example lets see what the President of the United States is posting about.

  • from:@POTUS filter:media

filter:images

This operator will give results that include any searched tweets identified with image(s).

  • national parks filter:images

filter:videos

This operator will give results that include any searched tweets identified with video(s).

  • concert filter:videos

filter:safe

This operator will filter out potentially sensitive tweets from your search results.

url:

This operator will show users tweets that contain URLs with the word term of choice within it. for example, lets search for URLs with the word “amazon” within it.

  • url:amazon

And we can combine this with a search term “deals”. And we can find tweets that mention “deals” with amazon

  • “deals” url:amazon

Lang:

the lang operator filters Tweets for a given language. Here are some examples:

  • lang:es -> Spanish
  • lang:fr -> French

near:

The “near:” operator will find Tweets within a certain distance of a place. For example, if you wanted to find people posting about a concert near London you’d would search:

  • concert near:london

within:

In addition to the near operator you can further narrow down your search with the within operator, for example lets search for any posts about a protest within 10 kilometers of Paris. (you can use other types of metrics for measuring distance such as with “mi”)

  • protest near:paris within:10km

gecode:

The geocode: operator is an operator to search geotagged tweets. Granted this only works with users has location services turned on. But its a very useful operator when covering current real time events. To use geocode operator we utilize longitude and latitude. Lets see how do it.

How to search by location

To search by location, First we would need to determine the location in which you want to look for tweets aka the latitude and longitude. There’s plenty of map services out there such as Google Maps that give you the coordinates of a given place. But a good easy to use one is geocode.xyz. For today’s example we’re going to use Hamburg, Germanys coordinates. It will look something like this:

latitude: 53.56643, longitude: 10.01484

If you choose to use Google Maps, search for a given location and pull the latitude and longitude out of the URL.

now with step 2 now you have to choose a radius for example you want to find tweets within a 20km radius of your chosen location. And now the finial step is to combine your search string:

  • geocode:Latitude,Longitude,Radius
  • geocode:53.56643,10.01484,20km

results:

Lots of NSFW Content Lucky we learned how to filter it out

Now, Let move on to a real world example using some of the knowledge we already have gained. And go back in time to January 6th, 2021. A event which caught the worlds eye.

Case Study: January 6TH

AP Photo by Jose Luis Magana

Following a wide spreading message to travel U.S. Capital to protest the 2022 U.S. Presidential election results. Supporters of now former US President Donald Trump showed up to the U.S. Capital to protest the election results which eventually led to the storming of the U.S. Capital building. And many of people on scene during this event. Including the mainstream press, independent journalists, and every day bystanders were all there capture this historical event using Twitter as their medium. So Lets use the below search query to go back in time to this event. And lets see what information we can find.

geocode:38.889943,-77.011244,.5km since:2021–01–05 until:2021–01–07

The above search string will give you Tweets in a .5km radius around the U.S. Capitol. You can expand or shrink the geofence/radius however you like. But if you want to change the date range, add new search terms, or filter for different types of media etc. You are welcome to do so using the above operators already discussed. So lets click enter and let see what we can find.

Search Results(not in order):

Documented Destroyed barricade
Tweet from Perry Stein
Tweet from Haley Talbot
Tweet from MikkoMarttinen2

Translation: Back entrance to Congress. People are insulting the people inside the windows.

Tweet from U.S. Senator Paul Strauss
Report of a shooting
Account from the west front of the capital
Alleged Targeting
tweet from Sophie Alexander
Tweet by Hannah Nightingale

So as you can see, there is variety of content and “live” reporting on display after we narrowed down our search. Now if this was a live event this method of geo-fencing/narrowing down our searching. Will allow us to paint a picture with reported micro-events reported by all types of media, traditional and non-traditional. That made up this larger event in history.

Now its very important to conduct your on research and draw your own conclusions. Events like this which are very chaotic in nature. Spawn Lots and Lots of misinformation/false reporting which can lead to forming false conclusions. Leading to even more misinformation spreading.

THE END

Some Sources:

Disclaimer: I am not liable for any wrongful or illegal activity against any organization or person resulting from techniques described in this article. This article is for educational purposes only.

--

--

RoddyT3ch

Cybersecurity Professional and OSINT & Tech Enthusiast