title: How to access "Foursquare Userless Venues API v2" via JSON?
body: <p>I am trying to access the venues on Foursquare by using their userless API formula on my ASP MVC map application but couldn't manage it working.</p>
  
  <p>My code is:</p>
  
  <pre><code>var fsObj = [];
  var url = 'https://api.foursquare.com/v2/venues/search?ll=' + lat + ',' + lng + '&amp;query=' + type + '&amp;radius=' + distance + '&amp;intent=browse&amp;client_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&amp;client_secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&amp;v=20120304';
  $.getJSON(url, {}, function (data) {
      venues = data['response']['groups'][0]['items'];
      for (var i = 0; i &lt; venues.length; i++) {
          var fsRes = {
              'Id': venues[i]['venue']['id'],
              'Name': venues[i]['venue']['name'],
              'Latitude': venues[i]['venue']['location']['lat'],
              'Longitude': venues[i]['venue']['location']['lng'],
              'Type': type,
              'Vicinity': venues[i]['venue']['location']['address'],
              'Reference': "Foursquare"
          };
          fsObj.push(fsRes);
      }
      printMap(fsObj);
  });
  </code></pre>
  
  <p>As you may understand: I am getting lat, lng and distance values from the map. Also trying to print the endresult.</p>
  
  <p>When I use same url on browser it is getting the results but in this code unfortunately not. It makes me to think that may be the json request is not good becase when I try to put a breakpoint at printMap line; it even doesn't stop. Am I doing something wrong?</p>
  
  <p>Any helps will be highly appreciated. Thank you very much.</p>
  
  <p><strong>NEW APPROACH BUT STILL NO CHANCE:</strong></p>
  
  <pre><code>var getFoursquare = function (p, g, q) {
      var lat = p.lat();
      var lng = p.lng();
      var url = 'https://api.foursquare.com/v2/venues/search?ll=' + lat + ',' + lng + '&amp;query=' + q + '&amp;radius=' + g + '&amp;intent=browse&amp;client_id=XXXXXXXXXXXXXXXX&amp;client_secret=XXXXXXXXXXXXXXXXXXXXXXXXXX&amp;v=20120305';
      $.getJSON(url, function (data) {
          $.each(data.response.venues, function (i, venues) {
              fsRes = {
                  'Id': venues.id,
                  'Name': venues.name,
                  'Latitude': venues.location.lat,
                  'Longitude': venues.location.lng,
                  'Type': q,
                  'Vicinity': venues.location.address,
                  'Reference': "Foursquare"
              };
              fsObj.push(fsRes);
          });
          printMap(fsObj);
      }).error(function (event, jqXHR, ajaxSettings, thrownError) { alert(event); alert(jqXHR); alert(thrownError); });
  }
  </code></pre>