json - How do I get the hourly forecast from api.weather.gov for Texas stations or zones or offices or gridpoints or anything else? - Stack Overflow
[Solved] Arduino Language National Weather Service API request WeatherStation
Weather API service
NWS Weather API
Factsheet
U.S. Army Signal Service
U.S. Army Signal Service
Looking at the api documentation found HERE and HERE, you are calling the /gridpoints/{wfo}/{x},{y}/forecast/hourly call which will return the hourly weather forecast for the specified weather office {wfo} at the specified x-y coordinates. You can find a list of the weather offices HERE. Finding the X-Y coordinates for the weather offices may be a bit more tedious to find on the web.
If you happen have access to the GPS coordinates that you are working with you can use the /points/{x},{y} API call to get the information on the closest weather office to then pass to the /gridpoints/{wfo}/{x},{y}/forecast/hourly API call.
The flow of your application can look something like this:
Step 1: Get your map Geo coordinates. In my case, I am at 35,-106
Step 2: Make a call to the weather.gov API: https://api.weather.gov/points/35,-106. You will be presented with some JSON data. Look for the cwa key in the properties object. That will be the forecast office to pass into the next api call. In my case, the key is ABQ. You also need to find the gridX and gridY keys in the properties. These are the XY coordinates that you will use for the {X},{Y} parameters in the API call. In my case X = 121 and Y = 112.
Step 3: Make the final call to the weather.gov API: https://api.weather.gov/gridpoints/ABQ/121,112/forecast/hourly
As long as you have the latitude/longitude of the location you want the forecast for, then:
- Get the point metadata from https://api.weather.gov/points/{lat},{lon}
- Follow the link in the
forecastHourlyproperty to get the forecast
This is preferable to constructing the URL as in the other answer, as your program won't break if the URL scheme changes in the future.
Hello all!
I have a client (think roofing) that wants to be able to schedule roofing crews around upcoming weather forecast. Can someone recommend a service (reasonably priced is ok) that can give us the forecast as a percent chance of rain by zip code that we can refresh every hour or so to put into the scheduling algorithm? We are thinking setting up a program that runs every hour and updates a weather table with the regions zip codes and a column for each upcoming day that we put the percentage chance of rain.
Thanks!