Replies: 6 comments
-
Try specifying the state/area: It supposedly can work for multiple states at once (per documentation at https://www.weather.gov/documentation/services-web-api#/default/get_stations), but that isn't working for me from a browser right now. |
Beta Was this translation helpful? Give feedback.
-
@sweinreich is correct, specifying the state is the best option at the moment. There is no authentication requirement aside from providing a User Agent. @tommyc96 Can you provide the day or week you think it might have stopped working? |
Beta Was this translation helpful? Give feedback.
-
I tried it every week from January through the first week of June, and the URL https://api.weather.gov/stations worked. I had a hiatus from teaching for six weeks and did not attempt the demo, so I don't know the behavior from the second week of June through last week. It was around July 21st 2020 that I attempted it again after my hiatus, and it gave the error message above for the ensuing week. Today, the error message is different. It now shows this: { |
Beta Was this translation helpful? Give feedback.
-
It stopped working June 25th at approx midnight utc |
Beta Was this translation helpful? Give feedback.
-
That correlates with the release of an update. The tl;dr is the API cannot parse all the stations in one reponse and should be updated with pagination. As noted above, you can make separate calls for each state, as that should be small enough to return a valid response. You can also open an operational outtage ticket. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the information! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
For months, https://api.weather.gov/stations gave a list of station IDs (such as KSFO) and names (such as SAN FRANCISCO INTERNATIONAL AIRPORT) for unauthenticated requests. It now returns an error.
To Reproduce
https://api.weather.gov/stations
gives this:
HTTP ERROR 500
Expected behavior
For months, I (as a programming instructor) have been demonstrating to students a fetch of station IDs in JSON format from the API. I would show the students the results in a web browser, and then execute a program that wrote them to a NoSQL database. I then read each station ID to fetch the current weather conditions from each station. It is the most effective demo I have been able to create in order to illustrate several things to my students. It all started with that URL, which worked perfectly until a few weeks ago.
Screenshots

Environment
The fetch worked by simply typing the URL into a browser, or by retrieving within code
Here is a sample in python that worked perfectly for months to populate an argument with JSON data, that now retrieves empty data:
result = requests.get('https://api.weather.gov/stations').json()
Additional context
I have not tried to perform the fetch using an authenticated request. The demo has been so powerful because students have been able to run the code with no prior setup. So if the resource has been modified so that it is only available for authenticated requests, then I'll have to find another demo to perform. But if this is a bug, and if it can be restored to the previous functionality, it would help me immensely!
Thank you!
Tommy Christianson
Beta Was this translation helpful? Give feedback.
All reactions