Twitter SEARCH api searching exact location


#1

Does anyone know a way of gathering tweets form a certain location such as a province or a state in a country? Because currently I am using circles to estimate areas. I was wondering if there are any other way to do this like having a bounding box from certain latitude to latitude and longitude to longitude.
This is what I am using right now:
query.setGeoCode(location, radiusAround,Query.KILOMETERS)

val querySouthernSK = defineStandardGeoQuery(new GeoLocation(51.591803, -105.688616), 425, startingIdForNextBatchSouthern, maxAllowableTweetsInPageForAPI)


#2

The search API documentation and parameters are here:

https://dev.twitter.com/rest/public/search

Note that only a very small proportion (c. 1-2%) of Tweets have geolocation attached and that search only.covers a 7 day backward window.


#3

Thanks for the note. I do have a question regarding the proportion of the tweets that was filtered. I notice if i were to use twitter streaming API, only 1-2% of the tweets are given. I was wondering if that one percent is the percentages of the tweets in the world selected randomly. And if it is, what happens if I put a location filter(query) in the search. does the tweets go through the 1% filter first, and then go through the geo filter I set, which means if I am looking at a very small place I could get no tweets. Or does the tweets go through the geo filter I set first than I get 1-2% of the tweets that are filtered already? (is the limit number of tweets I could receive per time unit or is it a pre-filter that I get through using the Streaming API)

Any help would be appreciated.


#4

You are asking questions that cross the discussion.

Only around 1-2% of Tweets globally have location data attached. This does not differ across our delivery mechanisms (REST, Streaming or Enterprise Gnip)

The Twitter Search (REST) API has an additional limitation that the index is optimised for recency and has a 7 day look back window.

If you are filtering for terms on the real-time API for your given radius you may receive all the Tweets in that geo but there is no guarantee of this.

For high fidelity data you should look at Twitter’s commercial Gnip data APIs, or go via a partner.