Foursquare的API地点和放大器;结果数量 [英] Foursquare Venue API & Number of Results

查看:316
本文介绍了Foursquare的API地点和放大器;结果数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能获得从Foursquare的API场地超过50的结果? (https://developer.foursquare.com/docs/venues/search.html)

默认限制为50,但它不会使分页任何提及或偏移量来获得额外的物品。

请指教。


解决方案

作为回答<一个href=\"http://stackoverflow.com/questions/7303309/how-do-i-get-more-locations/8165223#8165223\">here

API文档这里可以提供帮助。

Foursquare的搜索非常紧密相连的位置点(在查询LL参数),您提供的。简单的答案是,要找到更多的场地给定区域内,你需要简单地与区域内的不同位置点再次查询。

两个查询,无论是在靠近彼此几点:

  https://api.foursquare.com/v2/venues/search?ll=40.700,-74.000&limit=50
https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50

将获得您两组不同的场地(即可能重叠,这取决于点的接近程度)。

为搜索方法的默认意图是签,这将返回最接近点的50个最受欢迎的地点。相反,如果你想看看所有的场馆区域内,可以使用浏览意图。此它可以是一个'半径'参数,在这种情况下它返回周围给定的点的圆内场地具有给定的半径,或者它需要两个坐标重新presenting矩形的'SW'或者ne角落。所以,你可以这样做:

<$p$p><$c$c>https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50&intent=browse&radius=50

这将给你围绕该点50米圆内50个比赛场馆。较小的半径将减少返回场地的数量。因此,通过改变您搜索在此半径和点(或由'软件'和'东北'参数所描述的矩形的大小和位置),就可以得到更多的场地返回。

希望有所帮助。

Is it possible to get more than 50 results from the Foursquare Venues API? (https://developer.foursquare.com/docs/venues/search.html)

The default limit is 50, but it does not make any mention of pagination or offset to get additional listings.

Please advise.

解决方案

As answered here

The API docs here can help.

Foursquare searching is very closely linked to the location 'point' (the 'll' param on the query) that you provide. The simple answer is that to find more venues within a given area, you need to simply query again with a different location 'point' within that area.

Two queries, both at points close to one another:

https://api.foursquare.com/v2/venues/search?ll=40.700,-74.000&limit=50
https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50

will get you two different sets of venues (that may overlap, depending on how close the points are).

The default intent for the search method is 'checkin', which will return the 50 most popular locations closest to that point. If instead you want to look at all the venues within an area, you can use the 'browse' intent. This takes either a 'radius' parameter, in which case it returns venues inside a circle around the given point with the given radius, or it takes two coordinates representing the 'sw' and 'ne' corners of a rectangle. So, you could do:

https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50&intent=browse&radius=50

which will give you 50 venues within the 50m circle around that point. A smaller radius will reduce the number of venues returned. So, by varying the radius and the point at which you search (or the size and position of the rectangle described by the 'sw' and 'ne' parameters), you can get more venues returned.

Hope that helps.

这篇关于Foursquare的API地点和放大器;结果数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆