Current Lightning API
Nearest and most recent lightning observations for a requested location.
This API returns the nearest location, and time of lightning observations from a given point. Lightning data is derived from lightning sensors on board geostationary satellites, as well as weather radar in regions without sensor coverage.
Lightning sensor data is available from 180 West (-180) to 80 East (+80) longitude - covering North/South America, Europe, Africa, and eastern Asia. Sensor data is updated once every 5 minutes. Radar based lightning estimates are available from 80 East (+80) to 180 East (+180) longitude - covering western Asia including China, India, Japan, Australia, and other countries in this area. Radar estimates are updated every 15 minutes.
*NOTE: Usage of this API consumes 10 requests against your account quotas per actual API request. It can return data up to 45 minutes back. For historical lightning beyond this, please use the Historical Lightning API.
Request Parameters
| Field | Optional/Required | Type | Data Type | Description |
|---|---|---|---|---|
lat
|
Required | query | number | Latitude component of location. |
lon
|
Required | query | number | Longitude component of location. |
limit
|
Optional | query | integer | Limit result lightning. (Default 20) |
skip
|
Optional | query | integer | Number of results to skip in response. (Offset) |
search_distance_km
|
Optional | query | integer | Radial search distance from point in KM. (Default 20 KM - Max 75 KM) |
search_mins
|
Optional | query | integer | Search time backwards from current time in minutes. (Default 30 minutes - Max 45 minutes) |
sort
|
Optional | query | string | Sort results by either most recent occurrence, or least distance from point. (Default distance) |
output_type
|
Optional | query | string | Data type of reponse JSON or GeoJSON. Default JSON. |
key
|
Required | query | string | Your registered API key. |
Example Request
lat/lon (recommended)
https://api.weatherbit.io/v2.0/current/lightning?search_distance_km=100&search_mins=15&limit=20&sort=distance&key=API_KEY&lat=35.7796&lon=-78.6382
curl -s "https://api.weatherbit.io/v2.0/current/lightning?search_distance_km=100&search_mins=15&limit=20&sort=distance&key=API_KEY&lat=35.7796&lon=-78.6382"
require 'uri'
require 'net/http'
require 'json'
uri = URI("https://api.weatherbit.io/v2.0/current/lightning?search_distance_km=100&search_mins=15&limit=20&sort=distance&key=API_KEY&lat=35.7796&lon=-78.6382")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == "https")
request = Net::HTTP::Get.new(uri)
response = http.request(request)
json = JSON.parse(response.body)
puts JSON.pretty_generate(json)
const https = require("https");
https.get("https://api.weatherbit.io/v2.0/current/lightning?search_distance_km=100&search_mins=15&limit=20&sort=distance&key=API_KEY&lat=35.7796&lon=-78.6382", (res) => {
let raw = "";
res.on("data", (chunk) => { raw += chunk; });
res.on("end", () => {
const json = JSON.parse(raw);
console.log(JSON.stringify(json, null, 2));
});
}).on("error", (err) => {
console.error(err.message);
});
Example Response HTTP 200
{
"count": 249,
"date": "2024-08-22",
"lat": 28.5384,
"lightning": [
{
"bearing_cardinal": "ENE",
"bearing_degrees": 56,
"distance_km": 11.99,
"distance_mi": 7.45,
"id": 57938,
"lat": 28.603,
"lon": -81.281,
"past_mins": 10.6,
"source": "glm",
"timestamp_local": "2024-08-22T16:36:57",
"timestamp_utc": "2024-08-22T20:36:57",
"type": "flash"
},
{
"bearing_cardinal": "NNW",
"bearing_degrees": 346,
"distance_km": 15.6,
"distance_mi": 9.69,
"id": 55145,
"lat": 28.676,
"lon": -81.414,
"past_mins": 14.3,
"source": "glm",
"timestamp_local": "2024-08-22T16:33:15",
"timestamp_utc": "2024-08-22T20:33:15",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 45,
"distance_km": 15.6,
"distance_mi": 9.7,
"id": 55591,
"lat": 28.645,
"lon": -81.274,
"past_mins": 13.7,
"source": "glm",
"timestamp_local": "2024-08-22T16:33:51",
"timestamp_utc": "2024-08-22T20:33:51",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 46,
"distance_km": 16.12,
"distance_mi": 10.02,
"id": 58183,
"lat": 28.646,
"lon": -81.268,
"past_mins": 10.3,
"source": "glm",
"timestamp_local": "2024-08-22T16:37:18",
"timestamp_utc": "2024-08-22T20:37:18",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 35,
"distance_km": 16.32,
"distance_mi": 10.14,
"id": 56657,
"lat": 28.664,
"lon": -81.292,
"past_mins": 12.4,
"source": "glm",
"timestamp_local": "2024-08-22T16:35:12",
"timestamp_utc": "2024-08-22T20:35:12",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 42,
"distance_km": 17.59,
"distance_mi": 10.93,
"id": 54649,
"lat": 28.663,
"lon": -81.268,
"past_mins": 15,
"source": "glm",
"timestamp_local": "2024-08-22T16:32:35",
"timestamp_utc": "2024-08-22T20:32:35",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 42,
"distance_km": 17.98,
"distance_mi": 11.17,
"id": 30325,
"lat": 28.665,
"lon": -81.264,
"past_mins": 12.4,
"source": "glm",
"timestamp_local": "2024-08-22T16:35:12",
"timestamp_utc": "2024-08-22T20:35:12",
"type": "flash"
},
{
"bearing_cardinal": "ENE",
"bearing_degrees": 59,
"distance_km": 18.43,
"distance_mi": 11.45,
"id": 32539,
"lat": 28.631,
"lon": -81.223,
"past_mins": 10.3,
"source": "glm",
"timestamp_local": "2024-08-22T16:37:18",
"timestamp_utc": "2024-08-22T20:37:18",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 47,
"distance_km": 18.69,
"distance_mi": 11.61,
"id": 27389,
"lat": 28.661,
"lon": -81.247,
"past_mins": 15,
"source": "glm",
"timestamp_local": "2024-08-22T16:32:35",
"timestamp_utc": "2024-08-22T20:32:35",
"type": "flash"
},
{
"bearing_cardinal": "N",
"bearing_degrees": 359,
"distance_km": 18.78,
"distance_mi": 11.67,
"id": 57088,
"lat": 28.708,
"lon": -81.381,
"past_mins": 11.7,
"source": "glm",
"timestamp_local": "2024-08-22T16:35:50",
"timestamp_utc": "2024-08-22T20:35:50",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 44,
"distance_km": 18.92,
"distance_mi": 11.76,
"id": 27996,
"lat": 28.669,
"lon": -81.254,
"past_mins": 14.4,
"source": "glm",
"timestamp_local": "2024-08-22T16:33:09",
"timestamp_utc": "2024-08-22T20:33:09",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 50,
"distance_km": 19.11,
"distance_mi": 11.88,
"id": 28794,
"lat": 28.656,
"lon": -81.237,
"past_mins": 13.7,
"source": "glm",
"timestamp_local": "2024-08-22T16:33:51",
"timestamp_utc": "2024-08-22T20:33:51",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 45,
"distance_km": 19.24,
"distance_mi": 11.96,
"id": 62704,
"lat": 28.669,
"lon": -81.249,
"past_mins": 4.4,
"source": "glm",
"timestamp_local": "2024-08-22T16:43:11",
"timestamp_utc": "2024-08-22T20:43:11",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 42,
"distance_km": 19.3,
"distance_mi": 11.99,
"id": 61451,
"lat": 28.675,
"lon": -81.256,
"past_mins": 6,
"source": "glm",
"timestamp_local": "2024-08-22T16:41:36",
"timestamp_utc": "2024-08-22T20:41:36",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 42,
"distance_km": 19.39,
"distance_mi": 12.05,
"id": 57702,
"lat": 28.675,
"lon": -81.255,
"past_mins": 10.9,
"source": "glm",
"timestamp_local": "2024-08-22T16:36:39",
"timestamp_utc": "2024-08-22T20:36:39",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 43,
"distance_km": 19.42,
"distance_mi": 12.07,
"id": 58838,
"lat": 28.674,
"lon": -81.254,
"past_mins": 9.4,
"source": "glm",
"timestamp_local": "2024-08-22T16:38:08",
"timestamp_utc": "2024-08-22T20:38:08",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 51,
"distance_km": 19.44,
"distance_mi": 12.08,
"id": 31841,
"lat": 28.656,
"lon": -81.232,
"past_mins": 10.9,
"source": "glm",
"timestamp_local": "2024-08-22T16:36:39",
"timestamp_utc": "2024-08-22T20:36:39",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 43,
"distance_km": 19.51,
"distance_mi": 12.12,
"id": 60646,
"lat": 28.674,
"lon": -81.252,
"past_mins": 7,
"source": "glm",
"timestamp_local": "2024-08-22T16:40:35",
"timestamp_utc": "2024-08-22T20:40:35",
"type": "flash"
},
{
"bearing_cardinal": "NE",
"bearing_degrees": 54,
"distance_km": 20.18,
"distance_mi": 12.54,
"id": 33503,
"lat": 28.654,
"lon": -81.219,
"past_mins": 9.4,
"source": "glm",
"timestamp_local": "2024-08-22T16:38:08",
"timestamp_utc": "2024-08-22T20:38:08",
"type": "flash"
},
{
"bearing_cardinal": "NNW",
"bearing_degrees": 348,
"distance_km": 20.66,
"distance_mi": 12.84,
"id": 30998,
"lat": 28.722,
"lon": -81.418,
"past_mins": 11.7,
"source": "glm",
"timestamp_local": "2024-08-22T16:35:50",
"timestamp_utc": "2024-08-22T20:35:50",
"type": "flash"
}
],
"limit": 20,
"lon": -81.3789,
"search_distance_km": 100,
"search_mins": 15,
"skip": 0,
"sort": "distance",
"timezone": "America/New_York"
}
Additional observation-filled examples: Lightning can be sparse, so these reference responses show populated observation payloads.
Example Response (JSON): [Download]
Example Response (GeoJSON): [Download]
HTTP Statuses
| Code | Description | Example |
|---|---|---|
| 200 | Lightning data. | - |
| 204 | No Data Found | - |
| 400 | Client Error |
|
| 403 | Unauthorized/No Access for current plan level |
|
| 429 | Daily or Velocity limit exceeded See rate limit guidance. |
|
| 500 | Internal Server Error |
|
Return Fields
| Field | Data Type | Description |
|---|---|---|
count
|
integer | Total count of lightning events. |
date
|
string | Valid date of data in response (YYYY-MM-DD). |
limit
|
integer | Count of results in response (determined by limit parameter). |
lat
|
number | Latitude of point. |
lon
|
number | Longitude of point. |
search_distance_km
|
integer | Distance searched for lightning (radially) in KM. |
search_mins
|
['number', 'null'] | Time backwards from current time searched for lightning. |
skip
|
integer | Number of results that were skipped in response (same as offset). |
sort
|
string | Ascending sort key of data (time or distance). |
timezone
|
string | Timezone of valid date. |
lightning
|
array<LightningObs> | |
lightning[].lat
|
number | Latitude of lightning event |
lightning[].lon
|
number | Longitude of lightning event |
lightning[].bearing_cardinal
|
string | Cardinal direction of lightning event relative to point |
lightning[].bearing_degrees
|
integer | Direction of lightning event relative to point in degrees |
lightning[].distance_km
|
number | Distance of lightning event from point in kilometers |
lightning[].distance_mi
|
number | Distance of lightning event from point in miles |
lightning[].id
|
integer | Internal identifier of lightning event |
lightning[].timestamp_utc
|
string | Timestamp of lightning event at UTC timezone (YYYY-MM-DDTHH:MM:SS) |
lightning[].timestamp_local
|
string | Timestamp of lightning event at local timezone (YYYY-MM-DDTHH:MM:SS) |
lightning[].past_mins
|
number | Amount of time passed since lightning event (in minutes) |
lightning[].type
|
string | Type of lightning data |
lightning[].source
|
string | Source of lightning data |