I have the following code for receiving tweets. The specified geocode is an area in New York State. However, when I print the location using print (json_reply ['user'] ['location']), it prints the location in Voorburg, Netherlands. I assume this is the location specified by the user in the profile information. In addition, the geocode always returns null. I'm interested in tweets from New York State along with the coordinates.
tweets = api.search(q='xyz', lang='en', since='2016-11-02',until='2016-11-06', geocode='43,-75,90km', count=1) json_str = json.dumps(tweets[0]._json) print(json_str) json_reply = json.loads(json_str) print(json_reply['text']) print(json_reply['created_at']) print(json_reply['user']['location']) print(json_reply['geo'])
Voorburg, Netherlands
source share