Can anyone explain what the "id:" value in the returned information from a get api command for a zone is based on? #347
Replies: 3 comments
-
The alert id is generated upstream by HazCollect Extended, and is unique for every alert product, but mutiple products can be chained together to describe one event. The chaining of products can get a bit complicated, but this will always result in a new alert id and referenced using the "references" property. In the example you provided, the VTEC indicates that it is a "NEW" product, and the "replaceBy" property indicates it was replaced by https://api.weather.gov/alerts/NWS-IDP-PROD-4205722-3554224. If you follow that link, you'll see the first alert ID in the "references" and that the second alert is a "CON" or continuation of it. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. So, it sounds like the best way to filter would indeed be by using the id property. If the id from a GET call is the same as a previous GET call then the returned alerts are the same alert. If they are different then it is a new alert. |
Beta Was this translation helpful? Give feedback.
-
Yes, if you make calls to the /alerts or /alerts/active endpoints on a short interval, you will likely see the same alerts as the previous calls. If you're tracking those locally, you can discard alerts on subsequent calls that have an id that you've already processed. |
Beta Was this translation helpful? Give feedback.
-
NOTE
Please do not report operational issues (such as outages) here. We can not support these issues via this forum. Please report these as described here: https://weather-gov.github.io/api/reporting-issues
Please describe what you're trying to do.
A clear and concise description of what your issue is. Ex. I'm looking for forecast data...
There are times when I get multiple returned values and I'm trying to filter the results to eliminate duplicates. And I think the only things so far that are (might be...) consistently unique in the json are the id and sent values.
I'm trying to decide which is "more" unique.
For example I've gotten several updates for a freeze warning for my area today and each as a different sent date/time and a different id (example https://api.weather.gov/alerts/NWS-IDP-PROD-4205125-3553895).
I can't find any information on that id structure.
Beta Was this translation helpful? Give feedback.
All reactions