A quick start guide to using the Tempest WebSocket API.
Endpoint
To open a WebSocket connection, use the URL below.
wss://ws.weatherflow.com/swd/data?token=[your_access_token]
See our Quickstart for instructions on how to obtain an access token.
Request Messages
Listen Start
Start listening for observations and events for a specific device. Each new observation sent by the device will be pushed to the client as soon as possible.
Request Message
{
"type":"listen_start",
"device_id":1110,
"id":"2098388936"
}
Response Messages
ack
, obs_air
, obs_sky
, obs_st
, evt_strike
, evt_precip
Listen Stop
Stop listening for observations and events for a specific device.
{
"type":"listen_stop",
"device_id":1110,
"id":"2098388936"
}
Response Messages
Station Events Listen Start
Start listening for station online and offline events.
{
"type":"listen_start_events",
"station_id":2594,
"id":"2098388541"
}
Response Messages
ack
, evt_station_online
, evt_station_offline
Station Events Listen Stop
Stop listening for event messages for a station.
{
"type":"listen_stop_events",
"station_id":2594,
"id":"2098388541"
}
Response Messages
Lightning Listen Start
{
"type":"geo_strike_listen_start",
"lat_min": 37.28,
"lat_max": 41.32,
"lon_min": -101.76,
"lon_max": -91.00 ,
"id": 12345
}
Cloud to Cloud strike types are returned by default. Add strike_type
to the geo_strike_listen_start
message to specify the type of strikes you would like to be returned. cg
returns Cloud to Cloud strikes only, ic
returns Cloud to Cloud strikes only and all
returns all strike types.
Response Messages
Response Messages
Acknowledgment
{
"type":"ack",
"id":"2098388936"
}
Rain Start Event
{
"type":"evt_precip",
"device_id":1110
}
Device Lightning Strike Event
{
"type":"evt_strike",
"device_id":1110,
"evt":[1493322445,27,3848]
}
evt
value returned is a Lightning event
Device Online Event
{
"type":"evt_device_online",
"device_id":1110
}
Device Offline Event
{
"type":"evt_device_offline",
"device_id":1110
}
Station Online Event
{
"type":"evt_station_online",
"station_id":4582
}
Station Offline Event
{
"type":"evt_station_offline",
"station_id":4582
}
Rapid Wind
{
"type":"rapid_wind",
"device_id":1110,
"ob":[1493322445,2.3,128]
}
obs
value returned is a Rapid Wind observation
Tempest Observation
{
"type":"obs_st",
"device_id":62009,
"obs": [[1603481377,0,0.09,0.54,33,6,1014.8,28.8,71,16639,1.83,139,0,0,0,0,2.42,1,0.07615,null,null,0]]
}
obs
value returned is a Tempest observation
Air Observation
{
"type":"obs_air",
"device_id":1110,
"obs":[[1493164835,835.0,10.0,45,0,0,3.46,1]]
}
obs
value returned is an AIR observation
Sky Observation
{
"type":"obs_sky",
"device_id":1110,
"obs":[[1493321340,9000,10,0.0,2.6,4.6,7.4,187,3.12,1,130,1.034,0,3,0.0,1.011,1]]
}
obs
value returned is a SKY observation
Lightning Strike
{
"type": "geo_strike",
"time": 1656008011,
"lat": 38.9981994,
"lon": 99.3110134,
"mag": 289,
"strike_type": "cg"
}
Additional Information
- A client should only open one WebSocket connection.
- A client will be disconnected after 10 minutes of idle time.
- All messages are JSON strings.