Why is Foursquare API not returning menu for certa

2019-09-01 18:43发布

问题:

I am hoping someone can figure this out:

Through the Foursquare API, you can get the menu by providing the Venue_ID of a particular restaurant:

  • https://developer.foursquare.com/docs/venues/menu

e.g. https://api.foursquare.com/v2/venues/47a1bddbf964a5207a4d1fe3/menu?oauth_token=my_auth_token_goes_here&v=20130928

And that works.

But it doesn't work for the following (and several other) restaurants:

https://api.foursquare.com/v2/venues/4fa027ede4b0e4be23b3374e/menu?oauth_token=my_auth_token_goes_here&v=20130928

  • This gives me a response back but the menu is empty! :(

You can confirm by trying it out at https://developer.foursquare.com/docs/explore#req=venues/4fa027ede4b0e4be23b3374e/menu

Would appreciate any help/insights on this.

Thanks!

回答1:

Foursquare is only allowed to redistribute menu data from certain providers through its public API. Unfortunately you've stumbled upon an example of this. If count inside the menus object is 0, you should handle this situation gracefully.