简体   繁体   English

如何在搜索模式下使用 Foursquare API 获得超过 50 个场地?

[英]How do I get more than 50 venues using the Foursquare API in search mode?

I'm implementing a simple Python project for study purposes and I want to retrieve 200 different burger locations using the Foursquare API within a radius.我正在实施一个简单的 Python 项目用于研究目的,我想在半径内使用 Foursquare API 检索 200 个不同的汉堡位置。

I've tried to make four consecutive calls with "search", but the results from each call are overlapping.我尝试使用“搜索”连续拨打四次电话,但每次通话的结果都是重叠的。 I've also checked this question , but the offset is limited to 50 (so I can only get 100 results by making two calls).我也检查了这个问题,但偏移量限制为 50(所以我只能通过两次调用获得 100 个结果)。

I want to make sure that none of the venues are repeated without having to check the responses of each call and I don't want to traverse the results one by one.我想确保没有一个场地重复,而不必检查每个呼叫的响应,我不想一个一个地遍历结果。

Is there a simple way to do that?有没有一种简单的方法可以做到这一点?

Thanks in advance.提前致谢。

There's no way around the limit of 50 on the venues/search endpoint, unfortunately, at least nothing documented.不幸的是, venues/search端点上的limit是 50 是不可能的,至少没有任何记录。

As the other answer pointed out you can use the venues/explore endpoint, along with offset to get each next set of 50 ( limit ).正如另一个答案指出的那样,您可以使用venues/explore端点以及offset来获得下一组 50 个( limit )。 Depending on the parameters used ( query , categoryId , section , etc), and if you hit this endpoint as an unauthenticated user (so you don't get customized results), you may be able to replicate the same set of results as you would from venues/search .根据使用的参数( querycategoryIdsection等),如果您以未经身份验证的用户身份访问此端点(因此您不会获得自定义结果),您可能能够复制与您相同的一组结果从venues/search

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM