0

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!

Hector
  • 1
  • 1

1 Answers1

0

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=?';
xdazz
  • 158,678
  • 38
  • 247
  • 274