简体   繁体   中英

Fetch Foursquare Venues API

im hardly trying to make an app but i need to fetch the venues from foursquare, im courrently using this code but its weird that im gettin nothing.

<script>
var latLong = '17.548065, -99.500868';
var url = 'https://api.foursquare.com/v2/venues/explore?ll=40.7,-74&radius=500&client_id=XXXX&client_secret=XXXX&v=20120731';
$.getJSON(url, function(json) {
console.log(json);
$("#results").html(json.response.groups.venue.name);
 });
</script>

Plus if you can help me to do the same thing with Google Places API i'll very thankful.

https://developers.google.com/maps/documentation/places/?hl=es

Best regards!

You need to use JSONP instead.

Try append ?callback=? to the url .

var url = 'https://api.foursquare.com/v2/venues/explore?ll=40.7,-74&radius=500&client_id=XXXX&client_secret=XXXX&v=20120731?callback=?';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM