A quick start guide to using the Tempest WebSocket API.
Endpoint
You can open a WebSocket connection with an API key or a token.
User Token
To open a WebSocket connection with a token, 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.
API Key
To open a WebSocket connection with an API key, use the URL below.
wss://ws.weatherflow.com/swd/data?api_key=[your_api_key]
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
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 Ground 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 Ground 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
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.