Weather Alert XML Structure

  • 2
  • Question
  • Updated 6 years ago
The API Documentation lacks any information about how alerts are structured. I want to know what an alert will look like so I can create the code to display it properly. Has anyone else seen the XML structure of alerts? Can you share a few, or even better, post a generalized alert sample?
Photo of Woody Null

Woody Null

  • 4 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 2
Photo of MikeRhg

MikeRhg

  • 15 Posts
  • 3 Reply Likes
I have an example here from Europe from last January. In the end it is self-explanatory. Be carefull, sometimes characters are missing in the description and/or message. I don't know if this happens for german explanations only. I already posted this issue, but nobody answers...

By the way, I had to change the brackets from the XML code, because when they stay as they are, the output was bad.

Hope this helps...

Example:

(alerts)
(alert)
(type)WIN(/type)
(wtype_meteoalarm)2(/wtype_meteoalarm)
(wtype_meteoalarm_name)Snow/Ice(/wtype_meteoalarm_name)
(level_meteoalarm)3(/level_meteoalarm)
(level_meteoalarm_name)Orange(/level_meteoalarm_name)
(level_meteoalarm_description)The weather is dangerous. Unusual meteorological phenomena have been forecast. Damage and casualties are likely to happen. Be very vigilant and keep regularly informed about the detailed expected meteorological conditions. Be aware of the risks that might be unavoidable. Follow any advice given by your authorities.(/level_meteoalarm_description)
(description)(![CDATA[Snow/Ice Aufkommender Regen oder Schneeregen, der auf dem
gefrorenen Boden gebietsweise zu Glatteis fÃ1⁄4hrt.
Dies ist ein erster Hinweis auf erwartete Unwetter. Er soll die
rechtzeitige Vorbereitung von Schutzma�nahmen ermöglichen. Die
Prognose wird in den nächsten 12 Stunden konkretisiert. Bitte
erfolgen Sie die weiteren Wettervorhersagen mit besondererAufmerksamkeit.]])(/description)
(date)2012-01-26 16:55:00 GMT(/date)
(date_epoch)NA(/date_epoch)
(expires)2012-01-27 09:00:00 GMT(/expires)
(expires_epoch)NA(/expires_epoch)
(message)(![CDATA[Snow/Ice Aufkommender Regen oder Schneeregen, der auf dem
gefrorenen Boden gebietsweise zu Glatteis fÃ1⁄4hrt.
Dies ist ein erster Hinweis auf erwartete Unwetter. Er soll die
rechtzeitige Vorbereitung von Schutzma�nahmen ermöglichen. Die
Prognose wird in den nächsten 12 Stunden konkretisiert. Bitte
erfolgen Sie die weiteren Wettervorhersagen mit besondererAufmerksamkeit.]])(/message)
(phenomena)NA(/phenomena)
(significance)NA(/significance)
(/alert)
(/alerts)
Photo of Woody Null

Woody Null

  • 4 Posts
  • 0 Reply Likes
Thanks so much!! this is exactly what I was looking for. So what's the exact difference between (description) and (message)? They both say the same thing?
Photo of MikeRhg

MikeRhg

  • 15 Posts
  • 3 Reply Likes
Yes, there was no difference so far. The (description) and (message) was always the same.

But again, be careful, for the european area they get alerts from http://meteoalarm.eu. So for other regions they get it from other providers (that's my idea) and then the structure could be different. This can be only answered by the Wunderground guys.

One more thing, I had it a couple of times, that there were more than one alarm at the same time (for example: Wind and Rain alarm). But then the XML structure was expandet.

Regards Mike
Photo of Woody Null

Woody Null

  • 4 Posts
  • 0 Reply Likes
Thank you. I finally got a look an an alert for US, and it is different from European alerts.

(alert)
(type)SPE(/type)
(description)Special Statement(/description)
(date)1:22 PM EDT on June 1, 2012(/date)
(date_epoch)1338571320(/date_epoch)
(expires)2:00 PM EDT on June 01, 2012(/expires)
(expires_epoch)1338573600(/expires_epoch)
(message)...Strong thunderstorm to affect Warren...Clarke...northern Fauquierand Loudoun counties...At 122 PM EDT...Doppler radar indicated a strong thunderstorm 2 milessoutheast of Blue Mountain...moving northeast at 25 mph.Locations impacted include Bluemont.Storm intensity is increasing...and severe weather may developrapidly. Remain alert...and be prepared to take action if warningsare issued.Wind gusts of 40 to 50 mph can be expected with this storm.Hts/kramarlat...Lon 3918 7794 3907 7771 3890 7798 3895 7808time...Mot...loc 1722z 215deg 20kt 3896 7799(/message)
(phenomena)SP(/phenomena)
(significance)S(/significance)
(/alert)
Photo of MikeRhg

MikeRhg

  • 15 Posts
  • 3 Reply Likes
Hey, cool, thanks for checking, I will implement it into my code.
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
Great sharing folks! Happy to see people getting in and figuring this out. We're currently working on ways to make our documentation better, and I'll add "alerts" to the list.