Foursquare get venue details - foursquare

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

Related

Can I get list of all categories that foursquare API could return to me?

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

What does the Foursquare venues/search return?

Does anyone know what the Foursquare venues/search return? Does it give the up-to-date Foursquare venues or all the venues ever created for an area? I read this page https://developer.foursquare.com/docs/venues/search but it was not that specific. It goes like: "Returns a list of venues near the current location, optionally matching a search term". Does anyone have more information about this?
In my experience, the search request doesn't distinguish user created places like "Joe Bob's House" from a business like "Starbucks." It returns all of the nearby places best matched to this particular user if the intent is to checkin, or all of the nearby places if the intent is to browse for "coffee," for example.
Does that answer your question?
You should take a closer look at the intent parameter on that page. You can specify the type of results you're looking for. Depending on your needs, you might also want to check out venues/explore

how to add new category to foursquare

I see that there is no very useful category in the foursquare category list provided by API.
This category is "Car services".
And what's more important for me in RU locale is that it should be "Автосервис" or "Станция технического обслуживания авто".
Now many venues are marked with the wrong category because of the absence of these categories.
For example, car service venues are marked as "Automotive Shops" or in Russian "Магазин автотоваров". This is completely the wrong meaning.
So the question is how can I request for the addition of a new category?
Unfortunately there's no way to add venue categories via the Foursquare API, but please feel free to reach out to Foursquare support directly with your feedback: http://support.foursquare.com/requests/new

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.

Resources