vignz.pie
vignz.pie

Reputation: 199

How do I paginate through results returned by foursquare venues / search api?

I want to create a list of all restaurants within a given lat-long boundary. I'm using foursquare venues/search API for the same, with sw & ne parameters.

If I'm expecting, say, 200 results. I know each limit caps at 50 results and I'm OKAY to perform 4 requests with +50 offset. But I get the same set of results when [limit=50, offset=50] and [limit=50, offset=100]

Here are the params in the sample GET request:

https://api.foursquare.com/v2/venues/search?client_id=blaa&client_secret=blaa2&v=20190610&categoryId=4d4b7105d754a06374d81259&limit=50&sw=40.467632,-74.292252&ne=40.935656,-73.672914&intent=browse&offset=50

Upvotes: 0

Views: 409

Answers (1)

Zack Gilbert Kreiling
Zack Gilbert Kreiling

Reputation: 11

According to Foursquare's documentation for venues/search, there is no offset parameter. You probably want to use the venues/explore endpoint along with the &section=food parameter (instead of the categoryId parameter).

Upvotes: 1

Related Questions