Inspired by this Yelp tutorial, I created a script to search for all gyms in a given city. I tweaked the script with these updates in order to return ALL gyms, not just the first 20. You can find the gist here. The SEARCH_LIMIT is 20.
I'm encountering a Bad Request error. I followed the Yelp Tutorial pretty closely, and am unsure of what it can be coming from -- I'm pretty sure the request is properly encoded, and all my API keys are right.
The print out is below:
Traceback (most recent call last):File "YelpSearch.py", line 97, in <module>query_api()File "YelpSearch.py", line 74, in query_apiresponse = search_yelp(offset) File "YelpSearch.py", line 67, in search_yelpreturn request(API_HOST, SEARCH_PATH, url_params=url_params)File "YelpSearch.py", line 53, in requestconn = urllib2.urlopen(signed_url, None)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopenreturn _opener.open(url, data, timeout)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in openresponse = meth(req, response)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response'http', request, response, code, msg, hdrs)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in errorreturn self._call_chain(*args)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chainresult = func(*args)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_defaultraise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request