May 9

Weather Alerts in Real Time with Webhooks

A more recent version of this article has been published. To view, click here.

Note: This post highlights severe weather alerts for facility managers; however, AerisWeather supports the delivery of numerous datasets via Webhooks for a variety of industries and use cases. To schedule a Webhooks demonstration tailored to your own industry or use case, please reach out to our team here.

When it comes to ensuring the safety of your employees, facilities, and the public, it is paramount to have near real-time access to accurate weather information, including weather alerts.

The AerisWeather API provides quick access to this weather information via the Alerts endpoint, especially government-issued weather warnings (ie. National Weather Service in the US; Environment Canada for CA; MeteoAlarm in the EU, and the UK Met Office in the UK), watches, and advisories. You can obtain this information by querying the API for a specific location. For example, you may query the Alerts endpoint to get current alerts for Minneapolis:

/alerts/minneapolis,mn
/alerts/44.98,-93.26

Querying every one to two minutes to obtain the latest active alerts is sufficient in non-emergency situations for just a few locations. However, most will require faster notification when multiple locations are involved, or in the instance high-impact/short-fuse warnings, such as tornado warnings. When a tornado is occurring, seconds matter to ensure the safety of your employees, clients, and assets.

This scenario is where AerisWeather’s Webhooks excel. With Alert Webhooks, you will receive real-time alerts within seconds of issuance and receipt from the respective government agencies.

What are Webhooks?

A webhook, also known as an HTTP callback, is a lightweight API that allows for information to be pushed based on trigger events.  When using the AerisWeather API, you are pulling information via API requests. With Webhooks, we push information directly to you, allowing you to act upon the information quickly and efficiently.

In practice, you provide AerisWeather with one or more URLs to a lightweight API that you host that we can send data to when specific events trigger/occur. Events that might trigger a data push may include a new alert being received, an update to an existing alert, or a cancelation. Other Webhook datasets may trigger by other events.

When an event is triggered, AerisWeather will perform an HTTPS POST to the URLs you have provided. For ease of implementation, the HTTP body included in the webhook POST will be a JSON object and match the standard AerisWeather API output for that endpoint. This implementation allows clients to efficiently migrate from the API to webhooks as their usage grows. Additionally, we offer several security options to ensure you only receive valid updates from AerisWeather for enhanced protection.

Which Weather Data Can Be a Webhook?

The most common use case for Webhooks is weather alerts, including government-issued warnings, watches, and advisories within the US, Canada, and Europe.

Most of AerisWeather’s data sets support webhooks, including:

Data SetDescription
AlertsGovernment-issued alerts, including warnings, watches, and advisories. Currently available for the USA, Canada, and Europe regions.
LightningLightning strike information. Available globally.
Tropical CyclonesActive tropical cyclones, including hurricanes, tropical storms, and typhoons. Includes current locations, wind speeds, pressure, forecast path, error cone, and associated wind fields. Available globally.
FiresActive wildfires within the USA and Canada, including fire perimeters when available.
EarthquakesGlobal earthquakes, including location, magnitude, and depth
OtherMost of our data sets are available via webhooks. Contact our Accounts Team for more information.

Alert Webhooks

We already discussed the use case of using Alert Webhooks to ensure receipt of short-fuse alerts as soon as possible, such as tornado warnings. With a Webhooks implementation, you will receive these warnings within seconds of issuance and receipt from the respective government organization.

Another use case for Webhooks is when you need to monitor hundreds, thousands, or even millions of locations for employees, clients, facilities, mobile users, or other assets. While you could query the AerisWeather API for each location, the volume of queries would quickly add up. Additionally, the infrastructure and management costs to query the API thousands of times concurrently can quickly become non-trivial, especially as your service grows.

With Alert Webhooks, alerts are pushed to a web service of your choice. The alert format will include the polygon of the alert coverage area. With this information, your web service can then query your local database for locations within the alert area, then perform any notifications or other tasks only on the affected locations. This method allows you to act only on locations affected by an alert versus querying the API millions of times per day to monitor each location individually.

Affected Locations
Locations affected by an alert polygon

As detailed above, you can receive weather alerts in real-time for only monitored locations within the affected area. This combination improves monitoring while lowering costs by removing the need to continuously query the alerts endpoint for each location.

Enhanced Alert Webhooks Filtering

Alert Webhooks will send all government-issued weather alerts supported within the AerisWeather alerts endpoint. These alerts will include their coverage area polygons, which allow filtering to just your monitored locations affected by the alert.   

Restricting actions based on the alert’s coverage area is beneficial. However, you may want to filter actions based on the alert type instead. For example, your use case may only require notifying clients if they are affected by tornado, severe thunderstorm, or flash flood warnings. For this use case, you can filter on the alert type code. This code is available within the JSON object sent in the webhook’s body. Specifically, look for the response[#].details.type, as seen in the snippet below:

"response":[
    {
      "id": "2a975f585d3fd1c0c77d2ced8fa0fb12",
      "loc": {
        "long": -74.8555,
        "lat": 44.3207
      },
      "dataSource": "noaa_nws",
      "details": {
        "type": "WS.W",
        "name": "WINTER STORM WARNING",
        "loc": "NYZ029",
        "emergency": false,
        "priority": 25,
        "color": "FF69B4",
        "cat": "winter",
       ...

The alert’s type code will match one of the alert codes listed within the Alert Types documentation. With our use case example, to filter the incoming webhooks to just tornado, severe thunderstorm, and flash flood warnings, you would step through the response array, checking the details.type to see if it matches either TO.W, SV.W, or FF.W.

Implementing localized alert type filtering allows you to limit actions to the specific alerts needed while quickly and easily adjusting the alerts filtering as your needs evolve over time.

Next Steps

Webhooks are a powerful tool to help monitor how severe weather may affect employees, clients, facilities, and other assets, while also helping to control costs. Reach out today to learn more.

For more information on Webhooks, check out these other resources: 

Share this post:

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

AerisWeather
{{page_content}}