Hi my name is Dimitri and this is my first ever post on the forum. I’m trying to do the weather app challenge and I am having trouble accessing nested objects from the API respond received from openweathermap.org. Some of the data looks something like this:
“weather”:[{“id”:803,“main”:“Clouds”,“description”:“broken clouds”,“icon”:“04n”}],
“main”:{“temp”:293.25,“pressure”:1019,“humidity”:83,“temp_min”:289.82,“temp_max”:295.37},
“name”:“Cairns”,
I don’t have trouble accessing an object that is not nested so when I try json[“name”] or json.name it returns the name of the city (in this case Cairns) as expected.
The problem is when I try to access a nested object, so when I try json.weather.main or main.temp nothing is returned…
Please help I"ve been stuck on this for awhile.
Thank you!!