Skip to content
Tweet Binder

How to use the Twitter geocode to search tweets by location

This post is also available in: Español (Spanish)

Twitter is a global platform with millions of users all around the world tweeting every minute. But analyzing Twitter’s data is as important as the tweets themselves. Here at Tweet Binder we understand that analyzing the performance of a certain keyword, hashtag or account on a global level is very useful, but sometimes you need to obtain a more meaningful analysis by making Tweets more contextual and staying focused on a specific place. Here’s where Twitter geocode comes into play.

For instance, “Fireworks!” is much more relevant when associated with a location: “Fireworks!” from the Manhattan borough in New York. Our 7-Day reports allow you to filter search by location and combine it with many other advanced filters and Twitter Analytics. This command is very useful and interesting to locate Twitter content (pics and tweets), especially for local marketing campaigns. All you need to do is to add the geocode string to your query following four simple steps.

How to search by location

Let’s imagine we want to analyze tweets mentioning the Oscar Awards tweeted by accounts in New York. This advanced search command works directly on the report, on  the advanced search.

STEP 1

The most important step for the geocode string is to determine the location in which you want to look for tweets (latitude and longitude). There’s plenty of services out there such as Google Maps that give you the exact coordinates of a place.  Another good one is geocode.xyz. For today’s example we’re going to use New York’s coordinates. It will look something like this:

Latitude: 40.712776
Longitude: -74.005974

If you use Google Maps, search for the place and pull the latitude and longitude out of the URL.

STEP 2
Choose the radius in which you want your tweets to be. For example, within 10km of your location (~ 6 miles).

Twitter's geocode radius
After you find the latitude and longitude coordinates, you must choose the radius.

STEP 3
Now you can compose a search string that will be used to search tweets by location. The search string will follow this format:

geocode:latitude,longitude,radius
geocode:40.712776,-74.005974,10km

STEP 4
Paste the geocode after your desired keyword, start running your report in TweetBinder and done!

oscars geocode:40.712776,-74.005974,10km

This will show you all tweets within the chosen geographic location that you are permitted to see (depending on a user’s settings their tweets may not be accessible). In our example, the search query found the following data:

Twitter's geocode results
The Academy Awards were mentioned 2,798 times in New York from the 3/30/2021 to the 4/7/2021.

In the preceding image, you’re able to see an overview with all the statistics, including our own Economic Value and Sentiment Score. All these tweets can be later classified with our binders, a unique feature that allows you to manage and classify tweets either in suggested or manual groups. Learn how to see all the Tweets of a report.

Perfect your search

If you wat to fine-tune your search, you can combine the Twitter geocode with other search operators. For example, you may want to find mentions of the Oscars that contain an image or video, images (including third parties such as Instagram), a linking to URL or a question. In these cases, you just have to add the operator to the query:

  • filter:media It will search for mentions with the aforementioned requirements that contain any type of media.
  • filter:native_video It will search for mentions that contain an uploaded video, Amplify video, Periscope, or Vine.
  • filter:links It will search for mentions also linking to URL.
  • filter:images It will search for mentions that contain photos, including third parties such as Instagram.
  • url:oscars It will search for mentions that contain a URL with the word “oscars” anywhere within it. Please note that in this case results can contain the official URL of the Academy Awards (oscars.org) as well as any other link with that contain the word (such as a New York Times article about it).
  • ? It will search for mentions that contain a question.

You can try any of this operators by copying and pasting any of the search lines below in the following search box:

  • oscars geocode:40.712776,-74.005974,10km filter:media
  • oscars geocode:40.712776,-74.005974,10km filter:native_video
  • oscars geocode:40.712776,-74.005974,10km filter:links
  • oscars geocode:40.712776,-74.005974,10km filter:images
  • oscars geocode:40.712776,-74.005974,10km url:oscars.org
  • oscars geocode:40.712776,-74.005974,10km ?

Tweet location vs. Account location

As with every other Tweet Binder report, those ones that have the Twitter geocode string can also be downloaded in an Excel or JSON file. The Excel file contains very useful information such the Twitter account location,  as well as data about the user that has published each tweet, it’s username, the date, the number of likes and retweets and the tweet value.

The Twitter user location is different from the tweet location. On the one hand, the account location is based on the ‘home’ location provided manually by the user in their public profile. This is a free-form character field and may or may not contain metadata that can be geo-referenced. On the other hand, the Tweet location or Twitter geocode are the geographical coordinates provided when user shares location at time of Tweet and come from GPS enabled devices.

However, with our Excel downloadable file you can still extract the ‘home’ location of the user that tweeted in your desired coordinates. In our example, we can see this with actor Bruce Lee:

On the 6th of April, 2021 at 11:53, @brucelee retweeted Sandra Lloyd’s tweet inside the geofenced query. We can infer that although @brucelee’s ‘home’ location is in Los Angeles, he was visiting New York that day.

 

 

Try it now!

If you have any comment or you want to get to know better any detail about Tweet Binder binders, do not hesitate to contact us!