Tomorrow.io’s 2022 ESG Impact Report is here. Download It Today.

X
Save your seat for ClimaCon 2022 now!
Learn how to build entire alert systems based on calls to the Tomorrow.io weather API.

Weather Alert API: Emergency Assistant in Severe Situations

Weather catastrophes are devastating for communities for both businesses and individuals. The impact from a massive tornado, fire, flood, hurricane and many more severe weather conditions can destroy homes, cost people their lives, and leave businesses unproductive for days affecting their revenue. Using a weather alert API, you can get much more accurate and predictable weather forecasts, which will help people better prepare for disaster, and emergency assistance personnel can take the necessary steps to be ready for a quick response.

Preparing for Weather Conditions and Natural Disasters

FEMA details the response protocols after a natural disaster. From their documentation, you’ll notice that local authorities are responsible for being the primary first responders to a disaster. If you look at the steps involved, phase one of emergency response is to prepare for an upcoming natural disaster. 

Before response teams prepare, they must know the severity of the situations. For example, a Category 3 hurricane will generally cause far less damage than a Category 5 hurricane. Before emergency assistance can assess the number of people and resources needed to respond, they need to know the severity of hurricane winds, where the hurricane will hit land, and the number of residents and businesses that will be affected.

In 2021, a massive snow storm hit Texas and caused a power crisis across Houston and surrounding areas. Texas was unprepared for the snow storm, which unfortunately cost lives. Residents were left without power and heat with no warning that a power outage would be possible so that they could prepare and protect themselves. The snowy weather was unprecedented in Houston, but it gave officials a new benchmark for emergency preparedness.

Now in 2022, freezing weather was tracked better to give residents time to prepare. They reported that temperatures could be as cold as the mid -20s Feirenheit in some areas, so residents and emergency responders could better prepare this time. Most importantly, power companies prepared utility lines so that they would resist severe weather conditions similar to the previous year.

Local and federal assistance are there for residents shortly after any disaster, but they first need to have the resources to help affected areas. This requires the right vehicles, food and water resources, first aid, and the ability to offer shelter to people who need it. In some cases, it’s necessary for emergency responders to travel to other locations to help other US cities in a time of need.

How Can You Help Your Local Community Protect Themselves?

Using a weather API, you can help facilitate emergency assistance in severe situations. Your applications can be used to alert your local community of upcoming weather emergencies, and you can publish your data publicly so that local authorities and emergency responders can get updates. These government agencies usually have their own data, but communication channels are often cut in severe weather. For example, it’s not uncommon for the phone systems to go out during a hurricane and take days for it to recover after the hurricane weather passes.

Local news stations report the weather, but cable may go out in severe weather conditions. Provided that you keep the internet up and connected, you can have your own weather app to track the status of a severe storm. Before the storm reaches, you can help your local community by monitoring weather conditions to warn them. For our example, we’ll use hurricane weather to track wind speeds so that your local community knows when weather conditions are at their worst.

Before getting into code, a little bit about hurricanes – a common reason for deaths during a hurricane is the eye. When a hurricane passes over an east coast state, the state gets the “left” side of the storm first. Next, the eye passes over the state. The eye of the storm is completely calm, especially if there is a well-formed distinct eye. After the eye passes, the “right” side of the storm hits. The wind from this side blows in a different direction than the first phase of the storm, which means buildings are pummeled in a new way. When people unfamiliar with the way hurricanes hit see the eye pass over their house, they will often think the storm is over and go outside.

The storm returns quickly after the eye passes, and anyone who stays outside risks flying debris that could harm them or threaten their life. Residents used to hurricane weather know not to go outside right away, even if the storm has officially passed. Instead, the right protocol is to stay indoors until cleanup crews fix power lines, remove dangerous debris, and repair roadways. With a weather API, you can help communities better prepare before, during, and after severe weather conditions, including a hurricane.

Capturing Wind Data During a Hurricane

Now, let’s take an example of wind events during a hurricane. You can build event queries based on a premade “wind” insight category. There are several pre-made insight categories that collect data for extreme weather events, such as hurricanes (wind). You can use these insight categories for most weather events that could damage your community and threaten lives. It can then be used in emergency assistance situations to prepare for the worst.

Notice from the insight categories that they respond with “level” data. This data tells you if the wind conditions are at an emergency level (among other stages during a hurricane). There is also a “statement” level that occurs after the event and warns users of the dangerous aftermath of a hurricane, and there is an “outlook” level to warn users of the impending dangerous conditions about to affect their area. These levels, along with the others, can be used to provide minute by minute (or hour by hour) information to emergency responders.

Notice in the wind insight category documentation, that an event is returned if wind speeds match specific values. A storm is considered a hurricane when wind speeds reach 74mph, but other dangerous storms have sustained winds at slower speeds, so this is why the weather API reports warnings for wind speeds starting at 40mph and higher. Extreme wind speeds of 115mph and higher can seriously impact a community, and you can use this information to warn residents. The Route API endpoint is a premium option, but it can be used to map a path for a hurricane to determine the communities most affected, but note that some hurricanes have historically changed their path drastically without warning. For example, Hurricane Ivan in 2004 made a loop in an unexpected return to land that threatened Florida after already impacting other adjacent states.

Capturing Wind Data During a Hurricane
Hurricane Ivan from 2004 took a very unusual and unexpected path across several US states.

Now let’s take a look at a small snippet of Python code that pulls data from the wind insight category.

import requests

url = “https://api.tomorrow.io/v4/events?location=607f3e4188a6a60007947b82&insights=wind&buffer=1&apikey=YOUR_KEY”

headers = {“Accept”: “application/json”}
response = requests.request(“GET”, url, headers=headers)
print(response.text)

 

For this particular query, no data will be returned because there is currently no severe wind conditions in this area, but here is a sample JSON response that would be returned should the location currently experience hurricane conditions:

 

{
  “data”: {
    “events”: [
      {
        “insight”: “wind”,
        “startTime”: “2020-10-13T18:12:00Z”,
        “endTime”: “2020-10-14T15:06:26.261668224Z”,
        “updateTime”: “2020-10-13T18:12:00Z”,
        “severity”: “extreme”,
        “certainty”: “likely”,
        “urgency”: “immediate”,
        “response”: “shelter”,
        “eventValues”: {
          “title”: “Hurricane winds”,
          “distance”: 0.156,
          “direction”: -7.481822
        }
      },
      {
        “insight”: “38f689d83c264eb0b084ba095f2ea772”,
        “startTime”: “2020-05-10T07:49:34+0000”,
        “endTime”: “2020-05-10T07:49:34+0000”,
        “eventValues”: {
          “precipitationIntensity”: 1,
          “mepIndex”: 300
        }
      },
      “…”
    ]
  }
}

 

The “events” section is where you identify if the threat is immediate, the likelihood that severe wind conditions will affect your location, and the severity of the threat. These three data points are important in emergency assistance when tracking weather. The response code defines suggestions for residents. In this example, the suggestion is to shelter, but it will also tell residents to prepare, monitor, assess, evacuate and several more.

In an emergency response situation, the severity indicates the possibility of life-threatening events. The certainty data point gives you a sense of the likelihood of experiencing the event. In this example, the value is set to “likely,” which indicates a very strong possibility that residents at the given location will experience extreme weather conditions. 

The final value to pay attention to is the “urgency” data point. The “immediate” value indicates that the event is happening now or in the immediate future, but the API offers information on past events or indicates if it will happen in the future.  The “urgency” data point works well with the response and severity data to indicate if an emergency response will be necessary after the event.

Alerts and Notifications from Events and Insights

Once you have the query set up to detect and monitor severe events, you can then create alerts and notifications that you can send to key people. The key people in your application could be organizational personnel, emergency responders, family members, or anyone else that needs to know when the threat is ongoing and when it is over. 

You can write your own code to use the alerts and notification endpoints to send messages to key people when severe weather passes through your location. An alert is a record that contains information when a threshold is reached. For example, you can create an alert when hurricane conditions reach extreme severity.

Here is sample Python code that creates can alert:

import requests

url = “https://api.tomorrow.io/v4/alerts?apikey=YOUR_KEY”

payload = {“isActive”: True, “insight”: “wind”, “notifications”: [ “type”: “PUBLISH” ]}
headers = {
    “Accept”: “application/json”,
    “Content-Type”: “application/json”
}

response = requests.request(“POST”, url, json=payload, headers=headers)
print(response.text)

 

This Python code sets up an alert for wind conditions. 

 

The response is:

 

{
    “data”: {
        “alert”: {
            “id”: “38f689d83c264eb0b084ba095f2ea743”,
            “insight”: “38f689d83c264eb0b084ba095f2ea332”,
            “name”: “Hurricane Winds Alert”,
            “isActive”: true,
            “notifications”: [“…notifications”],
            “createdAt”: “2020-05-10T06:49:34+0000”
        },
    }
}

 

Notice that the alert ties in with a notification object with the type “PUBLISH” set. This setting will send a notification when severe weather conditions are reached. Alerts tie into notifications by sending a notification when an alert is triggered from the given insight. In this example, wind conditions must be severe to trigger the alert, and then it will send notifications.

You can see a list of your notifications using the notification endpoint. Here is a small Python example that returns notifications:

 

import requests

url = “https://api.tomorrow.io/v4/notifications?apikey=YOUR_KEY”

headers = {“Accept”: “application/json”}
response = requests.request(“GET”, url, headers=headers)
print(response.text)

 

Of course, this example is very simplistic, but you can build entire alert systems based on calls to the Tomorrow.io weather API. The people you alert can be anyone, including emergency response and assistant organizations. The benefit of using your own custom application versus standard web applications is that a custom application can be used for specific geo-locations and events, and it can be used to notify people instead of relying on them to monitor weather websites.

Because a weather API also gives you predicted weather conditions, it can help emergency responders and the community prepare for the worst. Using the Tomorrow.io API, you can more quickly build an application that fits your specific needs rather than use standard weather tools that only report basic weather information such as temperature, rain, and current events. 

In addition to being more customizable, your application gets access to numerous data points that can be used for better predictions and more granular access to specific events. You have access to data around the globe, and you can use it to help emergency responders in any location at any time of the day or night.

With the right weather API, you can help your community save lives and respond more efficiently to dangerous weather. The Tomorrow.io API will help you accomplish your goals.

 

Tomorrow.io's weather API offers a best-in-class interface with 80+ data layers to choose from historical, real-time, and forecast weather data.

More from Tomorrow.io

Register for ClimaCon 2021

ClimaCon is a completely free, digital conference. Register below.