How to call the current chance of precipitation without inputting the hour?

  • 1
  • Question
  • Updated 3 years ago
I am trying to get the most recent chance of precipitation using the hourly forecast, but I can't seem to get it to return data. Do I need to use the hour to get the current 'pop", or is there a way to call the most recent 'pop' from somewhere else? From the xml response, it looks like I should be able to parse the current data using this call:

current_precip = parsed_json['hourly_forecast']['forecast']['pop']

but that doesn't return data. 

I'm guessing that I need to enter in a value for FCTTIME, and if so, is there a way to automatically bring up the current hour? 

Thanks for any help!
Photo of doktor

doktor

  • 3 Posts
  • 1 Reply Like
  • frustrated

Posted 3 years ago

  • 1
Photo of doktor

doktor

  • 3 Posts
  • 1 Reply Like
Found out that I needed to use this call:

current_precip = parsed_json['hourly_forecast'][0]['pop']
(Edited)