Industries

Products

Developer

Blog

Blog

/

API & mapping

Forecast lightning threats with the lightning/threats endpoint

3.19.2024//API & mapping, Tutorials, API & Mapping

Blog post banner

Lee Huffman

Head of DaaS

Where is lightning occurring? Where will lightning strikes occur in 15 minutes? In the next hour? When it comes to client, employee, and asset safety, these are all valid questions — the answers to which have the potential to alleviate damage and harm. Vaisala Xweather has already been providing answers to the first question through our suite of premium lightning datasets and mapping tools, with access to lightning strikes globally. The answers to questions 2 and 3 were a bit more complicated to pin down, but with access to Vaisala's world-renowned lightning network, we're pleased to announce that we've cracked lightning forecasting and can now provide an answer to where lightning will occur through the next hour globally.

Lightning threat zones can now be determined using the lighting/threats endpoint, accessible through the Xweather API. Lightning/threats provides access to global lightning forecasts in 10-minute intervals for the next hour, with data updating every 2 minutes to ensure lightning forecast accuracy across the globe.

What is a lighting threat?

Xweather's lightning data is the leader in quality, accuracy, and coverage - and with over 30 years of experience in lightning detection, it's no wonder it's the industry's most-trusted global lightning network.

More than a supplier of current global lightning data, Xweather's innovative team has expanded to generate lightning nowcasts that forecast lightning threats out through the next hour in 10-minute intervals. Lightning/threats is a global endpoint with polygon functionality for monitored threat areas.

Visualize lightning forecasts using Maps

Lightning threats as storms

When generating lightning threats through the next hour, the 10-minute forecasts are grouped into individual thunderstorms ("storm threats"). The storms include up to six 10-minute forecasts and the direction and speed of the storm. 

Lighting storm threat around La Grange, Texas

Accessing lighting/threats

Lighting threats are leveraged via the Xweather API's lightning/threats endpoint. available with Flex subscriptions. New users can explore all of ourAPI and mapping offerings with a free trial.

Querying by location:

The most common method of querying lightning threats is by passing a location. This location can be a latitude/longitude, "city, state/country," ICAO, or any other supported place format

The API will return all storms where the location is within at least one 1-minute lighting threat forecast period. The response will include complete storm information, including all 10-minute forecast periods. Returning the complete storm is helpful if you want to plot the storm on a map.

Querying the closest storm threats:

Another popular method of querying lightning threats is finding the closest threats to a location. This query method helps find nearby lightning threats approaching or surrounding a requested location. 

By default, the API returns all storms with at least one 10-minute threat polygon within a 25km radius of the location. Using the radius parameter, you can expand to a 100km radius:

Finding cities within the storm/lightning threats:

When the API returns a storm threat, it will include a storm ID in the ID field. If you pass the storm ID to the Affects action of the lightning/threats endpoint, the API will return the cities within any of the 10-minute lightning threat periods, descending based on population:

With the above query, the API will return up to 10 cities within the entire storm forecast. Note that with the affects endpoint, the returned result matches the places endpoint. For example:

Alternatively, within each of the storm period arrays, each 10-minute period will contain an ID that will look similar to: 16420143-1671467760

This ID represents the 10-minute lightning threat forecast and can be passed to the affects action to limit the returned cities to only those within the 10-minute forecast period.

Advanced lightning forecast queries

Let's explore some more advanced lightning threat queries. Note that while the previous queries are available for those using a free trial or Flex subscription, the following queries access our premium lightning datasets and each query made by Flex users will have a multiplier associated with it.

Querying storm threats using the within action:

The API provides the functionality to fetch all storm threats within a bounding box or polygon via the within action. This is beneficial when fetching lightning threats to plot on a map.

Within a bounding box:

The following query will return up to 1000 storm threats that are within a bounding box surrounding the Continental US (CONUS)

Within a polygon:

The following query will return up to 1,000 storm threats that are within a polygon surrounding the Continental US (CONUS)

Get the lightning forecast for your location today.

Try out the lighting/threats endpoint and the other features Xweather Flex with our free 30-day trial, which allows lightning queries for up to 20 locations.

Contact our Accounts Team for assistance tracking lightning for more than 20 locations or integrating lightning into mobile applications.

Lee Huffman

Head of DaaS

Related Resources

Related
Resources

Resource

Lightning data and mapping

Resource

Lightning API demo

=

Next

Understand how weather affects your EV's range