I am using Foursquare API to get the nearest locations for my current location. Can anyone please guide me how I can get the nearest places of a specific type? (I mean I need all gas stations, cafes, etc. near me).
Here is the link I am using https://api.foursquare.com/v2/venues/search?ll=41.104805,29.024291&oauth_token=EDO2GW34NJ5QBUVL5YXQTDYK41X2QMFBHS1XCY1FZMJFWNVM&v=20111229
Here I get some locations but I am unable to find gas stations or cafes so please guide me how can I get those specific places near by me.
Thanks in advance.
The search parameter documentation is here: https://developer.foursquare.com/docs/venues/search
You can make an API call to get the categories. The doc is here: https://developer.foursquare.com/docs/venues/categories
The actual call is: https://api.foursquare.com/v2/venues/categories
And it returns all the categories - you need to parse through this json return object to find what you're looking for.
Once you've got your category (in this case let's use Gas Stations), you can add category to the query you already had: https://api.foursquare.com/v2/venues/search?categoryId=4bf58dd8d48988d113951735&ll=41.104805,29.024291&oauth_token=EDO2GW34NJ5QBUVL5YXQTDYK41X2QMFBHS1XCY1FZMJFWNVM&v=20111229
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With