# MQTT lightning feed

> GOES-19 GLM lightning strikes near your saved places, on your account's own MQTT topic, with a range you set per place up to 200 miles.

Developers · Reference · https://wxalerts.org/docs/developers/mqtt/lightning/

The MQTT lightning feed is rolling out. Until it reaches your account, lightning
  is on the [live map](/) and the [lightning API](/docs/api/lightning/).

GOES-19 GLM flashes near your places are published to your account's own topic
as they arrive. You set how far from each place you want to hear about, and a
flash inside that range of any of your places is sent to you.

This is not the feed the [live map](/) draws from. The map asks the
[lightning API](/docs/api/lightning/) every few seconds. The MQTT feed is for
your own software.

  The first lightning feed (V1, the geohash tree under `wxalerts/glm/v1/`, on
  the shared public login) is deprecated and **stops on Friday, January 1,
  2027**. This page is its replacement.

## Set a range for each place

On the [Places](/account/#places) page of your account, open a place, choose
**More alerts** and set its **Lightning range, in miles**: from 1 to 200, or leave it empty for none. The API
stores it as `lightning_radius_km`, 1 to 322, and a place with no range gets no
lightning. A place with a range of 25 miles sends you every flash within 25
miles of it.

An account with no place that has a range receives no lightning.

## Connecting

Use the same URL, credential and limits as the
[alerts feed](/docs/developers/mqtt/alerts/#connecting). Make the credential on
the [Credentials](/account/#credentials) page, which also shows your lightning
filter.

## The topic

```
V2/{user_id}/GLM/batch
```

QoS 0, not retained, one JSON message per account per ingest cycle. Subscribe to `V2/{user_id}/GLM/#` to stay inside what your
credential may read.

## The payload

Each message is a batch: the strikes from one ingest cycle that fall inside your
ranges, oldest first. The example shows the shape of the message; fields may be
added, so ignore any you do not know.

```json
{
  "v": 2,
  "satellite": "G19",
  "window_start": "2026-11-22T17:19:00Z",
  "window_end": "2026-11-22T17:19:20Z",
  "count": 2,
  "strikes": [
    { "t": "2026-11-22T17:19:07.000Z", "lat": 30.1235, "lon": -89.9877, "energy_j": 1.23e-15, "area_m2": 123000000.0, "places": ["Home"] },
    { "t": "2026-11-22T17:19:11.412Z", "lat": 30.2002, "lon": -89.9101, "energy_j": null, "area_m2": null, "places": ["Home", "Dock"] }
  ],
  "published_at": "2026-11-22T17:19:31Z"
}
```

- **`t`** is when GLM observed the flash, to the millisecond, in UTC. Fade on it,
  not on when the message arrived.
- **`lat`** and **`lon`** are rounded to four decimals, more than the
  instrument's few kilometres of accuracy.
- **`energy_j`** and **`area_m2`** are the flash's optical energy and area as GLM
  measured them, or `null`. They describe the light at the cloud top, not what
  reaches the ground.
- **`places`** is the label of each of your places whose range the strike is in.
  It is empty for a strike you received because you are a commercial account or
  chose an office.
- **`published_at`** is when the batch was recorded, so a repeat is identical.

A value that is absent is `null`. Ignore fields you do not know.

## Who gets which strikes

| Account | Receives |
| --- | --- |
| Regular | strikes within the range of any of your places |
| Meteorologist or EOC | the same, and every strike inside the area of an office you chose plus 50 miles |
| Commercial | every strike |

## Timing, and no history

Lightning is not retained and nothing is replayed: you hear strikes from the
moment you connect. A strike is typically 20 to 40 seconds old when it reaches
you, because a granule is 20 seconds long and is published after it closes.

For strikes from before you connected, ask the
[lightning API](/docs/api/lightning/), which keeps 24 hours, and see
[Merge lightning history with the live feed](/docs/developers/mqtt/merging-lightning/).
Per day counts are at
[`GET /v1/stats/lightning/daily`](/docs/api/stats/), which needs an
[API key](/docs/developers/api-keys/).

To write a client, see
[Build a reliable MQTT client](/docs/developers/mqtt/best-practices/).
