twittergeocodetwitter-search

Geocode in Twitter API doesn't work


Can somebody tell me about Twitter Search API with geolocation filter?

I'm trying to use

GET https://api.twitter.com/1.1/search/tweets.json?oauth_consumer_key=*************&oauth_token=************-**********************&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1502873578&oauth_nonce=*****&oauth_version=1.0&oauth_signature=%****************%3D&q=ffdp&geocode=45.458626,9.181872999999996,150mi

45.458626,9.181872999999996 - Milan, Italy

And I have no statuses, but if I try this query, using advanced search:

https://twitter.com/search?l=&q=ffdp%20near%3A%22Milan%2C%20Lombardy%22%20within%3A15mi&src=typd&lang=en

I have some statuses.

Can somebody describe me, please, does it work? Or, maybe there are some mistake in my request?


Solution

  • The link for your advanced search returns tweets that are much older than a week. In general, very few tweets have latitude and longitude embedded with them. Also, the Twitter Search API will only return tweets from the past week or so. For both these reasons you are not seeing any tweets from Milan.