Sarkis Arutiunian
Sarkis Arutiunian

Reputation: 1291

foursquare API get filtered list of restaurants

I was checking docs https://developer.foursquare.com/docs/

And can see information how to get some data about the venues, but there no description how to get the list of venues. For example I need to get list of all restaurant in Los Angeles, how can I do it? if it's possible.

Thanks!

Upvotes: 1

Views: 3049

Answers (1)

Kosuke Ogawa
Kosuke Ogawa

Reputation: 7451

You can use v2/venues/search endpoint. https://developer.foursquare.com/docs/venues/search

e.g.

https://api.foursquare.com/v2/venues/search?
categoryId=4d4b7105d754a06374d81259 // food category
&near=Los+Angeles
&limit=50 // up to 50
&oauth_token=(YOUR_OAUTH_TOKEN)
&v=20170901

It's difficult to get list of ALL restaurant in Los Angeles because limit parameter is up to 50.

Use v2/venues/categories endpoint to get categoryId list. https://developer.foursquare.com/docs/venues/categories

- Food (4d4b7105d754a06374d81259)
  - Afghan Restaurant (503288ae91d4c4b30a586d67)
  - American Restaurant (4bf58dd8d48988d14e941735)
  - Chinese Breakfast Place (52af3a903cf9994f4e043bee)
  ...

Upvotes: 4

Related Questions