Why won't my json url work?

Nothing I am doing seems to be working, I even used the same json url as used in this tutorial and it still keeps coming up with the error:

"> p5.js says: It looks like there was a problem loading your json. Try checking if the file path [http://api.open-notify.org/astros.json] is correct, or running a local server.[https://github.com/processing/p5.js/wiki/Local-server] "

Anyone have any idea what I can do to fix this? I’m using the online application, I don’t know if that makes a difference. Thanks for any help!

1 Like

I’m following Daniel Shiffman’s tutorial exactly, but nothing is working:

function setup() {
  
  loadJSON("http://api.open-notify.org/astros.json", gotData,'jsonp');
  
}

function gotData(data) {
  println(data);
  for (var i = 0; i < data.number; i++) {
    fill(255);
    ellipse(random(width), random(height), 16, 16);
  }
}


1 Like