Reputation: 3
I'm trying to use the Foursquare and Google API to receive my current location and from there display a range of venues, eg. restaurants in a specific radius and plot each one on the map with a custom marker.
I've been able to display my current location with the google api, but I have never used the Foursquare API and it seems a little tricky, any help would be appreciated.
Upvotes: 0
Views: 636
Reputation: 496
You'll want to use either the venues/search or venues/explore endpoint to search around the location.
As an example of using search, this JQuery getJSON call will call the search endpoint looking for venues in the 'nightspots' category within 100m of the given venue:
var ll = latitude + "," + longitude;
$.getJSON("https://api.foursquare.com/v2/venues/search", {
ll: ll,
radius: 100,
limit: 50
intent: "browse",
categoryId: "4d4b7105d754a06376d81259",
client_id: foursq_client_id,
client_secret: foursq_client_secret,
v: 20130420
}).done(function(data) {
$.each(data.response.venues, function(i, item) {
console.log(item);
});
});
Upvotes: 1