
When I’m first interacting with an API and I want to
make sense of its responses, sometimes I’ll copy the text
to a text editor and break it down, line by line, to make it
more human-readable. This way I can see the natural
hierarchy of the JSON and figure out exactly what I have
to look for when I’m decoding the response in my code.
It starts with putting the key: value pairs on the individual
lines (example 10-2). Here you can see that there are
keys like “sunriseTime Local”, and “precipChance”, and
“narrative”, which is the verbal description of the
forecast for the coming days of the week.
Keep in mind that not all APIs ...