OpenWeather Lightning API
The OpenWeather Lightning API provides observed lightning events detected by a global sensor network.
The data is derived from the ERA5 reanalysis model, offering global coverage and a historical archive starting from 2023-06-26.
Each record represents an individual lightning discharge with geographic coordinates, timestamp, and an estimated positional uncertainty.
- Data type: Observed lightning strikes (cloud-to-ground and intra- cloud, where available).
- Spatial input: Point (lat/lon) + search radius ≤ 50 km. All parameters are required.
- Temporal input: start_date, end_date (UTC, ISO-8601) — maximum 7-day window.
- Output: List of lightning events, each with:
- datetime — timestamp of detection
- lat, lon — strike location
- quality — detection confidence
- error — horizontal location error
- Update frequency: Near-real-time, available within minutes of occurrence.
- Historical range: Historical lightning data available from 2023-06-26 to present
Authentication
Every request requires an API key.
Endpoints
Historical Lightning Data
HTTP
GET
https://demo.openweathermap.org/lightning/1.0/data?lat={LATITUDE}&lon={LONGITUDE}&radius={RADIUS}&start_date={START_DATE}&end_date={END_DATE}
&apikey={YOUR_API_KEY}Query Parameters
All parameters are required.
Name | Type | Description |
lat | number | Latitude in decimal degrees (−90…90). Global coverage (±90). |
lon | number | Longitude in decimal degrees (−180…180). Global coverage (±180). |
radius | number | Search radius in kilometres (0–50, decimal values allowed). |
start_date | string (ISO-8601 UTC or with timezone offset) | Start of the requested time window. |
end_date | string (ISO-8601 UTC or with timezone offset) | End of the requested time window (maximum 7 days 23:59:59 after start_date). |
apikey | string | OpenWeather API key. |
Date & Time Rules
start_datemust be less than or equal toend_date- Maximum allowed range between dates: 7 days 23 hours 59 minutes 59 seconds
- Minimum available date: 2023-06-26T09:56:38.000Z
Supported formats:
- ISO-8601 with UTC (
Z), e.g.2023-09-08T21:00:00Z - ISO-8601 with timezone offset, e.g.
2023-09-08T21:00:00+02:00
Important:
- Both dates must use the same format
- Mixing formats is not allowed (e.g.
Zand+02:00)
URL Example
https://demo.openweathermap.org/lightning/1.0/data?lat=34.360371&lon=22.617449&radius=20&start_date=2023-09-08T21:00:00Z&end_date=2023-09-08T21:10:00Z&apik
ey={YOUR_API_KEY}Response (200) — JSON
{
"lat": 34.360371,
"lon": 22.617449,
"radius": 20.0,
"start_date": "2023-09-08T21:00:00Z",
"end_date": "2023-09-08T21:10:00Z",
"lightnings": [
{
"id": "9db73abd-a064-4cd5-8086-ba1053e49e6b",
"datetime": "2023-09-08T21:03:54+00:00",
"lat": 34.362811,
"lon": 22.614233,
"quality": "good",
"error": 4.5
},
{
"id": "91b5581a-4005-44a9-9d01-0c6daf2567f9",
"datetime": "2023-09-08T21:07:21+00:00",
"lat": 34.359114,
"lon": 22.619822,
"quality": "medium",
"error": 12.5
}
]
}Field Descriptions
Field | Type | Description |
id | string (UUID) | Unique record identifier. |
datetime | string (UTC, ISO-8601) | Detection time of lightning strike (always returned in UTC). |
lat, lon | number | Location of detected discharge. |
quality | string | Quality level of detection (good, medium, bad, undefined). |
error | number (km) | Estimated horizontal location uncertainty. |
Error Handling
HTTP | Meaning | Example Payload |
400 | Validation error (missing/invalid parameters) | {"code":"400","message": "Invalid parameter format","parameters":["lat"]} |
401 | Unauthorized (invalid API key) | {"code":"401","message": Unauthorized"} |
403 | Forbidden | {"code":"403","message":"Forbidden"} |
404 | Not found | {"code":"404","message":"Not Found"} |
429 | Rate limited | {"code":"429","message":"Too many requests"} |
500 | Internal server error | {"code":"500","message":"Internal server error"} |