M3Works / metloom

Location Oriented Observed Meteorology
Other
16 stars 4 forks source link

NWS Forecast API #110

Closed micah-prime closed 2 months ago

micah-prime commented 4 months ago

It would be very useful to have a class that handles 7 day forecasts form the NWS

Here is the API https://www.weather.gov/documentation/services-web-api

We can call the points api to get the URL for the forecast https://api.weather.gov/points/42,-119

In this example, 3 forecast URLs are available

"forecast": "https://api.weather.gov/gridpoints/BOI/28,28/forecast",
"forecastHourly": "https://api.weather.gov/gridpoints/BOI/28,28/forecast/hourly",
"forecastGridData": "https://api.weather.gov/gridpoints/BOI/28,28",

forecast can be used to return the 12 hour increments

forecastHourly returns hourly data (hourly in local tz)

forecastGridData returns the 'raw' grid data (hourly UTC). This is likely the easiest version for us to use in the API. We can aggregate to daily as needed.