Increasing radius parameter of Foursquare API request omits nearby venues - foursquare

I am using the Venues platform to search for venues under the category "Food" given a latitude and longitude.
Here's the request I started out with:
https://api.foursquare.com/v2/venues/search?ll=37.783207,-122.441673&limit=50&categoryId=4d4b7105d754a06374d81259&intent=checkin&radius=520&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&v=20120721
This gives me the desired results, however, if I increase the radius from 520 to 5200, I get venues, but I lose venues that are nearby.
I think this is because I limit the results to 50 venues (max allowed by Foursquare) and there are more than 50 venues within a 5200 meter radius. In this case, it seems like Foursquare gives me back the 50 most popular places, which omits some venues. I'd like to have this larger radius, but make sure I get back the venues closest to me.
Are there other parameters that I need to include for this to happen? How can I make sure I get back the nearest venues within a large radius?

If you just want reasonable quality venues that are physically close to the user, don't specify a radius at all for intent=checkin -- the default is dynamic based on the density of venues nearby.
intent=browse will give you the top venues in an area without a proximity bias.

Related

Foursquare API's - venue searching method - Priority limit vs radius

Hi every body,
I have a concept problem. I would like to know how FourSquare looks for venues? (how it segments the search area? are they circles with gradually increasing radius? or a randomly choosing from the asked radius )
.
example:
Limit = 100
radius= 1000
total number of venue exist in this radius = 5000
.
which of these two option is the case? :
1- the result will be the 100 venues in a small circle ( like 100 venue in radius of 150 )
2- the result will be the 100 venues and they are well distributed venues come from a radius of 1000
.
To have an idea about why I'm asking this question, my main problem which I try to solve is:
find a radius of fixed number of venue in different adresses. my objective is to find a density index.
for example in in the center of Toronto we have 100 venues in a 50 meters radius, for the same number of venues, in a smaller city, we reach perhaps a radius of 200 meters.
.
Thanks
I solve my problem by some estimations but it is good to share the experience:
When we have to request one for radius 100 meter and other for 200 meter, logically we expect that the number of second one be greater than first, which, IS NOT the case with foursquare.
Some of venue in 100 radiuses won’t be in 200 radiuses.
So, I did request for 100, 200, 300… 1000. Then joined them all, then removed duplicated. So I have some estimation. But it is not the complete venues ( I checked on google map )

Google Places API doesn't restrict results to given radius parameter

I'm using this code in NodeJS to retrieve the results:
return googleMaps.places({
language: 'en',
query: keywords,
location: [loc.lat, loc.lng],
radius: 5000
})
As you can see, there's a restriction for 5000 meters max. For some reason I got results from another city which is about 50KM away from that lat, lng (some of the results were in the relevant distance, half were not..)
Any thoughts?
It looks like you're using Google's Place Text Search service. The documentation states:
radius — Defines the distance (in meters) within which to bias place
results. The maximum allowed radius is 50 000 meters. Results inside
of this region will be ranked higher than results outside of the
search circle; however, prominent results from outside of the search
radius may be included.
You may bias results to a specified circle by passing a location and a
radius parameter. This will instruct the Google Places service to
prefer showing results within that circle. Results outside the defined
area may still be displayed. Biasing results to a region or circle is
recommended to improve relevance of results for otherwise ambiguous
queries.
So this appears to be expected behavior from the API. There is no way to fully restrict Text Search results within a given location/radius.
Hope this helps!

how to get cross streets using foursquare

How do I access the "between X and Y streets" using the Foursquare API?
Is there a way to query the foursquare API such as when Input=lat/long ; Output = "On A Street between B and C streets" like in the screenshot?
Thanks!
Any API that returns a venue object will give you the crossStreet. Check out the venues response here.
From the response docs the location object contains:
An object containing none, some, or all of address (street address),
crossStreet, city, state, postalCode, country, lat, lng, and
distance. All fields are strings, except for lat, lng, and distance.
Distance is measured in meters.
Some venues have their locations intentionally hidden for privacy
reasons (such as private residences). If this is the case, the
parameter isFuzzed will be set to true, and the lat/lng parameters
will have reduced precision.
Depending on what your trying to do you can get venue details, search or explore and see the cross street with each.

Instagram Media/Search API

What is the smallest radius does Instagram Search Media API support ?
As I'm trying with radius of 50 meters, but not seems to be accurate.
Thanks.
I have noticed that some of the data returned from this API regardless of the radius are not accurate and not within the radius, there are some cases when 1 or 2 data points are way outside the radius, I manually filter out those, check out http://map.gramfeed.com

Is the Instagram Search distance a Radius or a Diameter?

Is the Distance parameter on the Instagram Search API specifying a radius from the given point, or a diameter passing through that point?
I'm asking because it seems that even though I know there's an image in a particular place, at a particular time, the API doesn't return that image when I query for it at the exact spot & time that it was taken.
Any ideas? Thanks.
The distance parameter is for the radius around the point defined by the lat/lng.
The image will not be returned if the user's account is private. That might be why you are not seeing it in your results.

Resources