Replies: 18 comments
-
Which API? There's multiple ones. |
Beta Was this translation helpful? Give feedback.
-
The JSON forecast API.
|
Beta Was this translation helpful? Give feedback.
-
I'm seeing the same behavior also for https://api.weather.gov/gridpoints/{wfo}/{x},{y}/forecast/hourly |
Beta Was this translation helpful? Give feedback.
-
@matthew, it was indeed punishment for fetching too frequently. Changing my UserAgent made it work again temporarily and then they unblocked my original UserAgent after a couple of days.
How frequently are you fetching the hourly? I changed mine so forecast is now ~3 hours, hourly is hourly, and observation is 15 minutes.
|
Beta Was this translation helpful? Give feedback.
-
If #85 was addressed, this would be easier. In this [comment] (https://github.com/weather-gov/api/issues/85#issuecomment-660640122), it says we will know if we were blocked since the info returned will be different, but in this case, we are seeing old data. I will try lengthening the update interval, which is currently something like 15 minutes. |
Beta Was this translation helpful? Give feedback.
-
I read somewhere that they update the hourly hourly and by 45 minutes after the hour. So I added a scheduler and set mine to update at :50. I haven’t actually logged the update times to check, though.
|
Beta Was this translation helpful? Give feedback.
-
The bug returning old data is no way related to being blocked, nor is the UA related to rate limiting. The UA only applies to being allowed to make requests. (Aside, we're working on replacing the UA requirement with API keys.) Unless you were contacted directly, or you contacted support and they confirmed, you were not blocked more than a few seconds. While I can't provide the limits, that gives you an idea of the interval, and you can even make multiple requests within that internal before getting temporarily blocked for the duration of the interval. The bug returning old data is discussed in other issues. Please review those for more information. |
Beta Was this translation helpful? Give feedback.
-
@scadergit, I believe you but what is odd about that is that changing my UA instantly fixed it, and changing the UA back instantly went back to returning old data. Current data was always returned through my browser. I actually did contact Support about this and was told someone would look into it and email me back...but it's been a week. The "bug" lasted nearly a week returning old forecast data. Up until yesterday morning I was receiving the same forecast data generated on 7/12. I've had minor delays of a few hours before, and indeed my script accounts for and smoothes over those for display purposes, but nothing this bad. |
Beta Was this translation helpful? Give feedback.
-
@scadergit, sorry for multiple replies. I understand from the other comment that you aren't allowed to share the rate limits. Is there some standard of time at which forecasts get updated that you can share? E.g. is it accurate where I read that hourly forecasts are only updated each hour and around :45? |
Beta Was this translation helpful? Give feedback.
-
I assume the other issue being referenced is #71 |
Beta Was this translation helpful? Give feedback.
-
The old date bug is completely random, so correlation is not causation. The CDN has a directive to ignore UA for cache keys...unless for some reason that got disabled...I'll verify this week. |
Beta Was this translation helpful? Give feedback.
-
Yes, that would be the primary thread for this bug. |
Beta Was this translation helpful? Give feedback.
-
@scadergit, thanks. I did set cache max-age=0 to test and expiring the cache didn't fix anything. If it helps I do log most of the data I receive back so I can probably pull the response from before the UA change (out of date), new UA (fixed), old UA (out of date) if that would help debug. |
Beta Was this translation helpful? Give feedback.
-
No worries...
That is a good question...I should update the documentation with that information for the data provided. Offices vary on how often they submit new forecast data. Some on the hour, others every six hours...all more often in adverse weather or when a mistake is made. |
Beta Was this translation helpful? Give feedback.
-
We're implementing a change to the CDN tomorrow that will unifiy their tracking id with ours. Once that is made, we can review the exact API response that is serving each of the old date responses. It will be called X-Edge-Request-Id. Please provide that once it is made available. |
Beta Was this translation helpful? Give feedback.
-
Is there an additional header we need to add to the request to have the X-Edge-Request-Id returned with the response? Currently, I have an additional header to the request added (per your previous instruction):
so results now return:
|
Beta Was this translation helpful? Give feedback.
-
I believe we instructed the CDN to always return it, but it might require to be included in the Pragma. |
Beta Was this translation helpful? Give feedback.
-
If it needs to be in the Pragma request, please let us know the exact syntax needed, and I'll add it to my scripts. |
Beta Was this translation helpful? Give feedback.
-
I have a Python script that is accessing the forecast API and right now the data it is retrieving is several day old, while the same link is returning current data in a browser. Is this the result of a rate limit blockage? I do have my email in the user agent header but haven’t been contacted. Is there someone that I can contact to get unblocked?
I’m happy to lower the frequency if that’s the issue.
Beta Was this translation helpful? Give feedback.
All reactions