I'm using Foursquare API to get a list of venues by using v2/venues/search API endpoint but here i am getting all categories of list but i need only Restaurants list
You can pass in a categoryId parameter to filter by a Foursquare categoryId. To get an up-to-date list of categories, see the venues/categories endpoint.
try this
https://api.foursquare.com/v2/venues/search?radius=1000&ll=40.723229,-74.006570&limit=50&client_id=YOUR CLIENT_ID&v=20130412&client_secret=YOUE CLIENT_SECRET&categoryId=4d4b7105d754a06374d81259,4d4b7105d754a06376d81259
Related
Can I get list of all categories that foursquare could return to me ?
https://developer.foursquare.com/docs/responses/category.html (link to category object description)
I know that the new categories could be created, and some deleted. But I just would like to prepare my app to be able to handle some categories in special way, and I need to know in advance what they could be.
Thanks for time in advance.
This should include all possible Foursquare categories. It's this endpoint: https://developer.foursquare.com/docs/api/venues/categories
Foursquare also provides an up-to-date category hierarchy without using the API. Useful if you just want to take a look at the list without doing a call.
Interestingly on that page, they also provide "Supported Countries" where the category "can only appear on venues in those countries".
https://developer.foursquare.com/categorytree
For the Foursquare api
Venues visited by a user
https://api.foursquare.com/v2/users/USER_ID/venuehistory
I was wondering if we can change the sort of the venues coming back? It appears to be sorted by alpha. It would be helpful to sort by most recent checkin. Or in addition to the beenHere field add a last_checkin_id: or just date would be fine.
Is there a sort query string parameter that i am missing?
The venuehistory endpoint simply returns all the venues that a user has been to. If you're looking to sort venues by most recent check-in, consider using the user/checkins endpoint instead.
Foursquare api: How to add featured location to the top of the near results list?
I'm trying to understand your question so correct me if I'm wrong. But these are your two options:
You want to add a featured venue that you yourself define to a list of venues retrieved from the API. In which case you would have to do manually that has nothing to do with the API.
or you want a list of featured venues as defined by foursquare which would be the explore endpoint:
https://developer.foursquare.com/docs/venues/explore
Might be missing something but, how can I get the structure of a Foursquare response for a request like https://api.foursquare.com/v2/venues/search?ll=...
I want to put the response into a data structure, but most venues aren't fully populated with data. For example, many venues data have contact info so the contact field is just and empty dict.
I want to know all the fields Foursquare could possibly send back to me for a given venue.
The complete venue description is listed here https://developer.foursquare.com/docs/responses/venue
usually there is a link to the datatypes returned at the bottom of the API endpoint description.
We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )