Foursquare venue score/rating - foursquare

Does anyone know how I can get a venue's score/rating (e.g. 9.0/10) using the Foursquare API?
I am connecting via Userless Access.
https://developer.foursquare.com/overview/auth#userless
The JSON blob that I get when I request venue details does not seem to include the score/rating.
https://developer.foursquare.com/docs/venues/venues

It is worth noting, first of all, that not all venues have ratings. A rating is only calculated in certain situations, like if there is enough sentiment data about a venue to start calculating a rating and if the venue is not a user's home.
However, if a venue does have a rating calculated and you're making a request with a recent version of the API (make sure you have a v param set from within the last few months), it will be returned in the JSON from the API as follows, when you make a call to /venues/<ID>:
{
response: {
venue: {
... // Other data about the venue will surround this, of course
rating: 7.18
}
}
... // The response's metadata will also be here
}
So, basically you want to check response.venue.rating.

Related

Foursquare API: Venues visited by a user sort

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.

Flickr photos by group with location name

I am grabbing photos from my 2 flickr groups using the API method flickr.groups.pools.getPhotos. This is ok but i'd like to actually return the town name rather than just the geo location. Does anybody know of an alternative method to grab my images including the geo location, town name, and the group that they are in? I'd rather not make multiple API calls per image.
Thanks
So it appears there is no way of doing this. I had to call flickr.groups.pools.getPhotos then flickr.photos.geo.getLocation on each image to get its location. Not the best solution but it is then being cached into a db for improved performance, then only called once every 30 mins.
You can get location attributes by adding "geo" parameter to extras argument for flickr.groups.pools.getPhotos request.
extras (Optional)
A comma-delimited list of extra information to fetch for each returned record. Currently supported fields are: description, license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_q, url_m, url_n, url_z, url_c, url_l, url_o
In response you will receive geo latitude and longitude for each photo from group.

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

Foursquare API - Has there been a change to the core venue field specials?

Has there been a change to the core venue field specials?
I'm using Venue Detail request (https://developer.foursquare.com/docs/venues/venues) to retrieve Venue Detail. As usual this request returns a "venue" for a response field.
What seems to have changed is the core venue field "specials". This now appears to be returning the same response fields as Specials/list ( https://developer.foursquare.com/docs/specials/list).
This requires iteration on specials.items as opposed to specials.
Looking at https://developer.foursquare.com/docs/responses/venue the Core venue field "specials" still should be returned as an array.
I'm trying to find in the change log where this may have changed?
The venues specials object is now using the standard count and items format that other lists in the api use.
The new format is only for clientversion 20120120 and later. Older versions get the old format.
We'll be updating the docs/changelog shortly.

Resources