Replies: 4 comments
-
Yes, it does complicate your code, but this is heavily documented and it would also complicate the code inside of the API. |
Beta Was this translation helpful? Give feedback.
-
Ok. It seemed worth asking. Can you link me to the heavy documentation? All I am aware of is https://www.weather.gov/documentation/services-web-api#/ which is pretty light. I would advocate for more complicated API server code so that all the clients can be simpler. The proxy you describe would still include the latency of the API call (13 seconds in my example) on the first call. I hadn't contemplated caching the nationwide station list and then calculating the distance, but I may go that way. Thanks for the idea. |
Beta Was this translation helpful? Give feedback.
-
The API was heavily influenced by how the new foreast (v3) would need data. In this scenario, it needed all possible observation stations to apply business rules based on quality of observation data from MADIS. The new foreast has been on hold until infrastructure can improve the latency of the endpoints, including /points, which needs to be very fast. The challenge with /points is that it makes several calls to gather all the point-related information, so the infrastructure upgrades will likely imporve this endpoint the most. @KTibow is correct, the API was designed for proxy caching and performance, but we'll consider all suggestions because a lot has already changed since it was designed for forecast several years ago. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the info Jared! Much 🙌 as always for the open, free, excellent APIs! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In order to avoid a subsequent call to
https://api.weather.gov/gridpoints/{wfo}/{x},{y}/stations
, I wish calls tohttps://api.weather.gov/points/{point}
included a propertynearestObservationStation
that was the first result from the call to the stations endpoint.For my simple personal weather app, I always want the current observation and forecast for a location. I respect the
cache-control
headers and only refresh the stations list weekly, but I'd prefer to avoid this step altogether (since it complicates my code.)I will next add location awareness/configuration to my app, so the app will be less likely to have a cached version and sometimes the stations call is quite slow so it would be great to avoid it.
Still, I love the new API. It's been mostly easy to work with!
So specifically for a response like below I propose the addition of
"nearestObservationStation": "https://api.weather.gov/stations/KBOS"
Beta Was this translation helpful? Give feedback.
All reactions