Yelp / yelp-fusion

Yelp Fusion API
https://yelp.com/developers
MIT License
403 stars 394 forks source link

HTTP Status 500 and 429 #77

Closed cambuilt closed 8 years ago

cambuilt commented 8 years ago

It appears that I have reached my call limit which I determined due to getting errors 500 and 429 (Too many requests) I contacted api@yelp.com and was granted an increase to 50,000 calls per day. However, I am still getting error 500.

First, I make this call to authenticate:

https://api.yelp.com/oauth2/token?grant_type=client_credentials&client_id=[clientid]&client_secret=[secret]

That gives me a successful code 200, but this returns a 500 (Unknown error):

https://api.yelp.com/v3/businesses/search?categories=restaurant&latitude=38.9890678045225&longitude=-77.0978405174881&radius=10000&offset=0

mittonk commented 8 years ago

@cambuilt : Ah, found a misconfiguration in your access limit. Try again now?

bizmate commented 8 years ago

Sorry to hijack the conversation but how can these issues be avoided ahead? i.e.

  1. is there a way to know the usage of the API without tracking this on the client side (i.e. analytics on the api management page?)
  2. is anything in the api going to send a usage notification based on a threshold? (btw I noticed i can contact api@yelp to request additional if required)
mittonk commented 8 years ago

@bizmate : Both definitely good ideas for the future --- neither's in place yet.

cambuilt commented 8 years ago

Thanks, mittonk, but still getting HTTP status 500 with the same search.

mittonk commented 8 years ago

@cambuilt : OK, I can repro that 500 on my own key --- so it's unrelated to your daily request limit.

Changing categories=restaurant to categories=restaurants gives a 200 and reasonable-looking results like https://www.yelp.com/biz/suma-bethesda-2

So, For you: Check the category list at

For Yelp: this should give a helpful NO_SUCH_CATEGORY error instead of an unhelpful 500.

cambuilt commented 8 years ago

Thanks Ken, that fixed my issue!

mittonk commented 8 years ago

That busted categories query now returns:

{
  "error": {
    "code": "INVALID_CATEGORY",
    "description": "The category alias you specified is not valid"
  }
}