I have created app in foursquare and get the client_id and client_secret key . I need all the restaurants details of a city.but i got only 50 restaurant details. Please help me . thanks in advance
'https://api.foursquare.com/v2/venues/explore?near=San Francisco,San Francisco§ion=food&novelty=50&client_id=client_id&client_secret=client_secret&v=20170109';
Matt is correct that you can use the
offset
parameter but his linked documentation and sample url was a little off.It looks like you're using the venues/explore endpoint, you can find documentation on this here: https://developer.foursquare.com/docs/venues/explore
To page through results you would set up something like this:
In your response (json) you should inspect the
json['response']['totalResults']
value to see how many results there are in total.It also looks like some of the parameters that you're using are invalid.
San Francisco, CA
notSan Francisco, San Francisco
novelty
parameter with that API, do you mean to uselimit
?You should use the
offset
parameter in order to page through the venues:Here is the API docs: https://developer.foursquare.com/docs/venues/listed
The stated limit is 200 so the example below will return a list of results 201-400: https://api.foursquare.com/v2/venues/?limt=200&offset=201