Foursquare API: Venues visited by a user sort - foursquare

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.

Related

FourSquare API returns venues that I have not called for

We are interested in producing a list of venues in an app that we are building. We call the FourSquare API for this, and we want it to return only venues that fit the parameters we specify in the call. We have specified that we want venues in the category "gay bar", within 100 meters of the coordinates that the call is made from.
When we make the call from coordinates in Oslo, the API returns one gay bar, but does not return two other gay bars that are within 100m of the coordinates (these are in FourSquare's database). Instead, the API returns a set of places that are not in the category we have specified (offices, convention centres, regular pubs, etc). We are obviously not interested in these venues - we are interested in the two venues that the API does not return.
The URL for the call is below. Please, if you can help me understand how to correct this, I would be very grateful.
Ben
https://api.foursquare.com/v2/venues/search?categoryIds=4bf58dd8d48988d1d8941735&ll=59.915286,10.740464&radius=100&limit=15&v=20210826&intent=browse
The documentation suggests that the parameter name is categoryId (not plural). Try that.

Sorting a photoset with the Flickr API

Is there a simple way to sort a photset in reverse chronological order (i.e. "Arrange by date taken (newest first)" using the Flickr API rather than the edit interface?
You can fetch the date_taken field when you call getPhotos, and then sort the results yourself...

ForeSquareApi :Getting list of venues in near by location

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

foursquare venues.json structure

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.

Foursquare get venue details

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 :) )

Resources