Search code examples
python-3.xtweepygeocode

tweepy 3.5 search geocode returns empty list


I am trying to get tweets around an specific location using python 3.4 and tweepy 3.5.0. First, I create an api object:

>>> api = tweepy.API(auth)

Then, if I call create with just a query, I get a lot of results:

>>> len(api.search('python'))
15

However, when I try to use a geocode, I always get an empty list. No matter what query or radius I use:

>>> len(api.search('python', geocode='-33.602131, -70.576876, 100000km'))
0
>>> len(api.search(geocode='-33.602131, -70.576876, 100000km'))
0

What am I doing wrong?


Solution

  • I finally got the problem! The geocode argument does not allow spaces. So, by changing the query, I got results again:

    >>> len(api.search(geocode='-33.602131,-70.576876,100000km'))
    15