weathergov API Notes
The JSONs got copied incorrectly when I moved files. Run the commands directly to get the examples.
[] re - run commands to get fresh examples
[] move larger json examples to their own files
weather.gov does not offer zip code search, you need lat/long. They point to Census bureau as a potenal source to get that :
https : //geocoding.geo.census.gov/geocoder/Geocoding _ Services _ API.html
The notes below are scratchpad notes that still need to be put together
- hit this one from stright luck : https : //api.weather.gov/products/9d061e9e - 0300 - 419e - 9deb - 3ee37db33cb9
via : https : //api.weather.gov/products
Examples
Temperature
curl https://api.weather.gov/stations/KJAX/observations/latest | jq '.properties.temperature'
Available Keys
curl https://api.weather.gov/stations/KJAX/observations/latest | jq '.properties | keys'
Documentation
Docs are here, under Specifications :
https : //www.weather.gov/documentation/services - web - api
There's a feed with a list of the available end points here :
https : //api.weather.gov/openapi.json
- not all the endpoints lists in that JSON are considered operational according to the sepcifications
- I'm pretty sure when you see [TODO: Code shorthand span ] it stands for Weather Forecast Office. which appears to be the same as the gridID
- Get coordinates by looking at google maps and pulling the coords (e.g. [TODO: Code shorthand span ] ), then do this :
Use the coordinates to get the data with :
curl -X GET "https://api.weather.gov/points/40.123%2C-71.434" -H "accept: application/geo+json"
Not sure you really need the ` - H "accept : application/geo+json" ` , but it was in the example. (TODO : Run a test without it to see what happens)
Looks like you can get a current set of data with :
curl https://api.weather.gov/gridpoints/LWX/96,70
You can also get the forecast with :
curl https://api.weather.gov/gridpoints/LWX/96,70/forecast
use it to get the forecast data.
curl https://api.weather.gov/openapi.json | jq '.paths | keys'