How I can receive all venues in city (for example, in Moscow).
I am trying to get list of all venues via https://api.foursquare.com/v2/venues/explore?near=Moscow,Russia&radius=20000&limit=50&&offset=0&client_id=clid&client_secret=clsecret&v=20160307
http requsts by changing offset parameter, but totalCount of venues in result list is 249 (for Moscow it is small).
So, is it possible to get list of all venues for so huge city as Moscow?
It is neccesary for my bachelor work, I write a reccomendation system for building tourist routes and only foursquare service have a extensive database with cafes, museums and monuments.
Thanks
Related
I am wondering if it is possible to get the most popular artist of my city with the Spotify API.
The current API (2016-05) doesn't seem to provide location specific queries. Artists of a city would be found in the Search for an Item-API-reference but there's no such a dedicated possibility.
You could search for keywords mentioning your city or for tags including your city (tag:Berlin) but you'd certainly not obtain all artists of that city with this type of query.
But say you had all artists of a particular city, you'd still have to measure how successful these artists actually are.
A rather easy metric would be to collect an artist's top tracks and evaluate the popularity integer value of these tracks. These values can be compared to other artists (e.g. for a first trial by average popularity).
I am calling Foursquare Venue API for getting all food venues of London.
Used API is: https://api.foursquare.com/v2/venues/explore?ll=51.51121389999999,-0.11982439999997041§ion=xxxx&**limit=11000**&oauth_token=xxxx
It returns always random 100 venues. If I call it next time then it returns same venues instead of unique 100 venues.
How to get unique records for getting all venues? How to get all venues by increasing the limit?
The maximum number of venues returned in an explore query can be found in our documentation: https://developer.foursquare.com/docs/venues/explore
Getting all the food venues in any geographic region isn't really something the Foursquare API is designed to do, but you can get different results if you modify your ll and/or radius params. Please keep in mind our developer policies against scraping though if you choose to do a sweeping approach.
It varies from city to city but I've noticed that the actual Foursquare app always returns an accurate list of stores that are nearby for checkin ... whereas the developer api results are mostly inaccurate and often upto 3 blocks off their mark when usin intent=checkin ... what gives?
Is it possible to search venues (via venues/search) in whole city without passing "radius" parameter? Because I don't know radius of each city :) Documentation says "Searches can be done near a point or through a whole city", but how can I provide this in venues/search?
Thanks.
I do not think there is a way to tell it 'search the entire city', but I also think it might be a wrong use case.
You need to remember a few things when searching:
Foursquare will return up to 50 results (the limit parameter)
The 50 results are ordered by the most popular places around the center of your search
So if you are searching a city which have more than 50 venues in Foursquare database, 'searching the entire city' will usually get the same (up to) 50 results - always.
This where the filters comes in handy, in our case, to get you better results for our needs, we use the categoryId combined with the radius to get things we want to show our users. Sometimes we get information from other cities because of a big radius, but for our application its okay, we actually give our customers more options :) . I can also guess that a lot of apps also use the query filter as they know the name of the place they are looking for.
You just need to experiment with it and discover how to get the data which is right to your application.
In theory, to search an entire city I would use the city lat/lng from Google or Open Street Maps or geonames and do a 10Km search around that point (intent=browse, radius=10000), the following is a guess, but it will get 50 places for over 99% of the cities people who own smartphones live in :)
You can do obtain results within in a city as follows:
https://api.foursquare.com/v2/venues/search?near=Singapore,Singapore&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET3&v=YYYYMMDD
For more details check the documentation:
https://developer.foursquare.com/docs/venues/explore
Assuming you're talking about requests with a query, I would just set a reasonable value for radius and use the city's default city center. If you want to avoid showing results from neighboring cities, you can post-request filter by the returned venue's "city" string in the location stanza.
Is it possible to get the nearby locations of a user's friends, or, when searching for nearby venues, determine how many friends are present at each of the venues?
In other words, I would like to list all nearby venues along with a count of friends here now. Can this be done without making venue detail calls on all of the venues?
Friend information is not currently accessible via the /venues/search endpoint -- only the total number of users at the venue.
As you mentioned, you can call the /venues/VENUE_ID/herenow endpoint to get more information (including friend vs. non-friend) breakdowns for the returned venues.
You can, alternatively, make a single call to /checkins/recent and combine the data about current friend location with /venues/search results.