API doesn't always return alerts

  • 1
  • Problem
  • Updated 4 years ago
API is called like this:
http://api.wunderground.com/api/KEY_H...

I have been testing different locations, but there appears to be an issue that the alert data is sometimes not given. It's completely random for me, and this is what gets returned:
"alerts": [
]

The main Weather Underground website shows active alerts, and the NWS has the alerts issued, but the API does not return them. Has anyone else noticed this issue? Is there a workaround or a fix planned?
Photo of justanotherdev

justanotherdev

  • 5 Posts
  • 0 Reply Likes
  • frustrated

Posted 4 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
Keep us posted on this. They should be there when that city/county is under an alert. If you could screenshot the alert on our site and the problem you are having at the same time we can look into them. Its hard to go backwards and debug alerts that were missed and it is ideal to catch them in real time.
Photo of justanotherdev

justanotherdev

  • 5 Posts
  • 0 Reply Likes
Replied to official post.
Photo of justanotherdev

justanotherdev

  • 5 Posts
  • 0 Reply Likes
Replied with another update.
Photo of justanotherdev

justanotherdev

  • 5 Posts
  • 0 Reply Likes
Hi Brendan,

Thank you for the reply. I have been investigating this issue and it appears to only happen when using latitude and longitude as the location query.

Luckily I have dual monitors so screenshots were fairly simple. Here's the first shot, showing the alert on the official site. On the right is the JSON returned by the API, as you can see there is no alert.


HOWEVER, when passing in the location name, the alert info is returned.


I also uploaded the images to Dropbox, as the resolution on the inline images is very low: https://www.dropbox.com/sh/j5j3lvx1zs...

Hope this helps.
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
Fascinating! Thank you for this feedback, we will look into it.
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
Thanks, that did help. When I check that URL it does work now:
http://api.wunderground.com/api/KEY/f...

We reviewed this situation and at the time of that alert, the alert may have been outside of the lat/lon coordinates. If you see something like that again, do the same lat/lon comparison on wunderground.com and see what the result is. The lat/lon search on the API probably was just on the edge of the alert.

I appreciate the screengrab, it really helped in looking at this.
Photo of justanotherdev

justanotherdev

  • 5 Posts
  • 0 Reply Likes
Hi Brendan,

This appears to be an ongoing issue when using geo coordinates as the location query. I had a user contact me from Castleton, IN saying that there was a Tornado Warning, but my app failed to notify him and did not show the alert it all. He had to use a competing weather app to see the alert. This is very alarming and is not only a safety issue, but also a potential liability mess. I would really appreciate if the WU API team could look into this further, as it appears to be affecting everyone.

I checked the Severe Weather Map for the United States and selected a random location in Montana, Glendive. Sure enough, the website shows the alert no problem, but the API does not return it when passing in the geo coordinates. If you check the coordinates, you will see that they are for the center of Glendive, MT, and are within the bounds of the alert.

Instead of posting the images online, I have just added them to the dropbox folder: https://www.dropbox.com/sh/j5j3lvx1zs...