Replies: 3 comments
-
The tl;dr is yes, the response might slightly differ between the forecast application and the API. A more correct comparison is between the forecast application and the API /gridpoints/{office}/{grid}/forecast endpoint, both of which are generated from the raw data. The forecast application has a long history of one-off tweaks beyond the NWS directives that define how the to generate the its response; whereas the API strictly follows the directives that don't fully cover all the reasons the tweaks were made. The forecast application has never exposed the raw data, but this difference is one of the reasons the API also provides the raw grid data (by removing /forecast). |
Beta Was this translation helpful? Give feedback.
-
I do see that the hourly data returned from https://api.weather.gov/gridpoints/OKX/44,71/forecast/hourly closely matches what I see in weather.gov. The https://api.weather.gov/gridpoints/OKX/44,71 hourly data is very different. Are you saying this is by design? Is there a better source of hourly data to obtain Thanks |
Beta Was this translation helpful? Give feedback.
-
The gridpoint data (without /forecast or /forecast/hourly) is the raw data straight from the forecast office. The forecast application and the API then apply directives differently to create the forecast and hourly data. Some data points should be consistent, others could vary more based on how many tweaks or how directives were applied. All this said, NCO had a significant data outage over the weekend of your original post, so it could be temporary factors. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a Python program to use the weather.gov API, https://api.weather.gov/gridpoints/{office}/{grid X},{grid Y}.
To verify my results, I went to weather.gov and selected an hourly report for a zipcode and compared it to my results. The API seemed to report colder results than the website. I also compared to other websites and got similar differences. Not sure if I am doing something wrong. Here is an example:
Request zipcode = 06812
address: New Fairfield, CT 06812, USA
latitude: 41.4799889
longitude: -73.5005111
URL that I generated for zipcode 06812 - https://api.weather.gov/gridpoints/OKX/44,71
Call:
forecast_request = requests.get(https://api.weather.gov/gridpoints/OKX/44,71)
forecast_result = json.loads(forecast_request.content)
I am looking at the following elements under forecast_result['properties']
'temperature'
'maxTemperature'
'minTemperature'
'relativeHumidity'
'dewpoint'
'windSpeed'
'windDirection'
'windGust'
'windChill'
Is the URL for this zipcode correct? Is the source data for weather.gov different than the data returned in the API?
Thank you
Dan
Beta Was this translation helpful? Give feedback.
All reactions