Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lightning density gridded data product.

Overview

Spire’s lightning product provides gridded lightning strike density data derived from real-time cloud-to-ground lightning strike observations. The product generates a density grid that tallies recent lightning activity.

Key Specifications

PropertyValue
CoverageCONUS (Continental United States)
Grid5 km × 5 km equal-area
Update frequencyEvery 5 minutes
Time windowRolling 60-minute cloud-to-ground strike count
File formatNetCDF

Endpoints

MethodEndpointDescription
GET/lightning/fileList lightning density files
GET/lightning/file/{file_id}Download a lightning density file

List Lightning Files

GET /lightning/file

Retrieve a list of available lightning density files.

Parameters

ParameterTypeRequiredDescription
timestringNoISO 8601 timestamp or time range
regionsstringNoRegion name

Example Request

Shell
Python
Node.js
curl -X GET \
  'https://api.wx.spire.com/lightning/file' \
  -H 'spire-api-key: YOUR_API_KEY'

Response

{
  "meta": {
    "count": 288
  },
  "files": [
    "lightning.20250130.t21m15.05km.core.conus-equal-area.f01m00.nc",
    "lightning.20250130.t21m20.05km.core.conus-equal-area.f01m00.nc",
    "lightning.20250130.t21m25.05km.core.conus-equal-area.f01m00.nc"
  ]
}

File Naming Convention

Lightning density files follow a specific naming pattern:

lightning.{date}.{time}.{resolution}.{bundle}.{region}.{window}.nc
ComponentExampleDescription
lightningProduct identifier
20250130DateFile date (YYYYMMDD)
t21m15TimeFile time — hour 21, minute 15 UTC
05kmResolution5 km grid spacing
coreBundleData bundle
conus-equal-areaRegionCONUS equal-area grid
f01m00Window1-hour (01m00 = 1 hour, 0 minutes) rolling window
.ncFormatNetCDF format

Download Lightning File

GET /lightning/file/{file_id}

Download a specific lightning density file.

Path Parameters

ParameterTypeRequiredDescription
file_idstringYesFilename to download

Example Request

Shell
Python
Node.js
curl -OJL -X GET \
  'https://api.wx.spire.com/lightning/file/lightning.20250130.t21m15.05km.core.conus-equal-area.f01m00.nc' \
  -H 'spire-api-key: YOUR_API_KEY'

Data Description

Each lightning density file is a NetCDF gridded dataset covering the CONUS region. Each grid cell (5 km × 5 km) contains a count of cloud-to-ground lightning strikes detected within the rolling 60-minute time window ending at the file’s timestamp.

FieldDescriptionUnits
strike_densityCount of cloud-to-ground strikes per grid cell in the rolling 60-minute windowcount

Python Example

Load and visualize lightning density data:

import requests
import xarray as xr

headers = {'spire-api-key': 'YOUR_API_KEY'}

# Get list of available files
response = requests.get(
    'https://api.wx.spire.com/lightning/file',
    headers=headers
)

files = response.json()['files']
latest_file = files[-1]
print(f"Downloading: {latest_file}")

# Download latest file
file_response = requests.get(
    f'https://api.wx.spire.com/lightning/file/{latest_file}',
    headers=headers,
    allow_redirects=True
)

with open(latest_file, 'wb') as f:
    f.write(file_response.content)

# Load with xarray
ds = xr.open_dataset(latest_file)
print(ds)

Visualize Lightning Density

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature

fig, ax = plt.subplots(
    figsize=(12, 8),
    subplot_kw={'projection': ccrs.LambertConformal(
        central_longitude=-96, central_latitude=39
    )}
)

ax.add_feature(cfeature.LAND, alpha=0.3)
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.BORDERS, linestyle=':')
ax.add_feature(cfeature.STATES, linewidth=0.5)
ax.set_extent([-125, -66, 24, 50])

# Plot the density grid (adjust variable name based on actual file contents)
ds['strike_density'].plot(
    ax=ax,
    transform=ccrs.PlateCarree(),
    cmap='hot_r',
    add_colorbar=True
)

plt.title(f'Lightning Strike Density\n{latest_file}')
plt.show()