Three nights in a row I told someone the sky over her yard would be clear. I had numbers for it: a cloud cover percentage for each hour, pulled straight from api.weather.gov , with the gridpoint id written down next to them so I could fetch it again.
The numbers were real. They were also for a gridpoint about 111 km from where she was standing.
This is a short post about the class of bug that never throws, because nothing in the request was malformed. It is worth writing down because I am usually the one telling other people to verify their inputs, and I had a successful response in my hand every time.
How the NWS forecast API is shaped
Two endpoints, two jobs.
GET https : //api.weather.gov/points/{lat},{lon}
Enter fullscreen mode
Exit fullscreen mode
returns, among other things:
{ "properties" : { "gridId" : "OKX" , "gridX" : 53 , "gridY" : 78 , "relativeLocation" : { "properties" : { "city" : "Sandy Hook" , "state" : "CT" } } , "forecastZone" : "CTZ005" } }
Enter fullscreen mode
Exit fullscreen…