Why is Foursquare API not returning menu for certain venues

不羁岁月 提交于 2019-12-11 16:28:00

问题


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.



来源:https://stackoverflow.com/questions/19070527/why-is-foursquare-api-not-returning-menu-for-certain-venues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!