Forums

Help a newbie out! Twitter API (python) problems filtering by location in bounding box

Hi, I'm accessing the streaming API, and at first I managed to filter by keywords with success. However, I am now just wanted to filter by location only, and despite several attempts I have had no success with the long/lat I've been using. I did manage to get the SanFran example from the Twitter DEV page to work successfully, so I'd appreciate if someone could see where I was going wrong.

Successful SanFran long/lat string:

twitterStream.filter( locations=[-122.75,36.8,-121.75,37.8])

I'm looking to filter tweets by Cardiff and chose two long/lats from the outer area twitterStream.filter( locations=[-3.1458,51.4647,-3.2131,51.4920])

However I just keep getting back 406 errors. I've tried with several variants on long/lat pairs. Has anyone any idea where I'm going wrong?

Much appreciated. Sarah

The twitter docs here say that a 406 error code is the result of a badly formatted seach request. Maybe twitter doesn't like that many decimal places or something like that or maybe the range is too small or too large.

Thanks. No further luck but I'll keep trying!