How to access forecast high and low values

  • 1
  • Question
  • Updated 4 years ago
Hi
I am trying to access the forecast high celcius values and I know that they are in forecast -> simpleforecast but I am not sure how to access the next day's high temperature. I am using python to pull other data out fine using

print forecast['forecast']['txt_forecast']['forecastday'][0]['fcttext']

(the first "forecast" is the variable that is holding the json document)

and

rain = forecast['forecast']['txt_forecast']['forecastday'][0]['pop']

bur try as I might I can not access the high temperatures in the same way. I have tried various combinations of keys and they have all failed. Can anyone point me in the right direction?
Cheers
Mark
Photo of MarkVenn

MarkVenn

  • 1 Post
  • 0 Reply Likes
  • frustrated

Posted 4 years ago

  • 1
Photo of Tim Roche

Tim Roche, Official Rep

  • 297 Posts
  • 24 Reply Likes
It doesn't look like you are accessing simpleforecast  at all

Your python should look more like forecast[simpleforecast][forecastday][0, 1, 2, etc,,,][high][fahrenheit]

Hope this helps

Tim