GET Search API 1.1 returns 401 error when used with geocode parameter


#1

This works:
https://api.twitter.com/1.1/search/tweets.json?q=SpaceBabies&lang=en&result_type=mixed&count=10

Returns valid results.

This does not work:
https://api.twitter.com/1.1/search/tweets.json?q=SpaceBabies&lang=en&result_type=mixed&count=10&geocode=45.5236,122.6750,100mi

Returns the following error:
Error code: 401
{“errors”:[{“message”:“Could not authenticate you”,“code”:32}]}

I’ve tried various query terms. Since the first one works my code obviously authenticates OK. So why? Any ideas?


#2

It’s likely that you need to encode the commas for the URL to be strictly valid.