How to access forecast high and low values

  • 1
  • Question
  • Updated 3 years ago
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)


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?
Photo of MarkVenn


  • 1 Post
  • 0 Reply Likes
  • frustrated

Posted 3 years ago

  • 1
Photo of Tim Roche

Tim Roche, Official Rep

  • 262 Posts
  • 19 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