Weather API data question

Hey guys and gals,

I don’t need any help getting my weather api project to work. I just started to make headway, my project isn’t done yet but I had a question about something.

I’m using the FCC api here:

My questions is, when I’m getting information from the api such as:

  $.getJSON(url, function(data) {

Why do I have to specify “weather[0]” instead of just weather?

from example data response from the API

  { "id":701,

so weather seems to be an Array of Object… weather[0].description would be the value of description key from the first object of that weather array.

1 Like

Yes its an array in a JSON object.