Hello,
I've been working on trying to pull realtime weather data using javascript functions. There have been a few posts about doing this with Survey123 Connect, including using the Open Weather API and NOAA API. I've gotten both of these to successfully pull data, but my user is requesting a piece of information that does not seem to be present in either of them. I'm looking for an API that includes rainfall (or precipitation generally) amounts within the last 24 hours. Is anyone aware of a weather API that contains this information and possibly have examples of how they've used it in Survey123?
Open Weather API sounds like it can pull the last year (EDIT: sorry, they have yearly, monthly, and daily APIs). And their definition of "max" for "precipitation" sounds like it should count.
I'm probably missing something though.
Thanks! I had come across these actually, and I've gotten the pull to work, but really the issue is that I don't want a daily aggregate, but an aggregate of the previous 24 hours, which is of course unlikely to be a single date (which is how I would structure the API call based on what I read in Open Weather's documentation).
Ohhhh. Gotcha.
Hmm. That isn't typically how these types of records are kept. With the exception of specialty services that keep a running record of "24 hour precipitation", which if they exists are likely to be a very localized service. And since that value changes second-to-second, it would likely be a single value that you would pull. Setting up your own automated rain gauge system would be a good option, but is most likely out of scope.
All I can suggest is try to pull today's precipitation and yesterday's precipitation separately for an approximation of 24 precipitation.
Yeah that's kind of what I'm thinking too. Typically my users would consult a local weather station's web page, I think, which is a bit of a different thing to what I've been working with.