Second JSON call not working

Hey guys,

I am having an issue with my second .getjson call not working, I have literally been staring at it for hours… everything looks correct.

var API_KEY= “code goes here”;

$(document).ready(function() {
var loc;
var weather;

$.getJSON(‘https://ipinfo.io’,
function(data){
console.log(“Assigning the Location”)
loc = data.loc.split(’,’);
console.log(loc);

   $.getJSON('https://api.darksky.net/forecast/' + API_KEY + '/' + loc[0] + ',' + loc[1], 
             function(wd) {
                console.log('weather data');
})

});
});

I know the second get call is failing because I do not even get the weather data to log in console. HELP! :slight_smile:

Thank you SkyC, solves the issue. I had tried this with both openweathermap and darksky. I have a feeling it is the same issue I was having with both.