Get Started with the Tempest API
The Tempest API empowers developers to build useful applications, data feeds and integrations by providing easy access to all the data the Tempest System offers. This API provides much more than just the raw data the Tempest sensor hardware measures - you also get derived data (like sea level pressure, daily rain accumulation, wet bulb globe temperature), historical data, daily/monthly/yearly statistics, and a 10-day forecast that's guaranteed to be more accurate!
This is the same API we use for the official Tempest apps & personal apps as well our official Tempest integrations like Amazon Alexa, Google Home & IFTTT. Many third-party Tempest integrations are built by our alliance partners who create custom integrations for the decision tools they use internally or for use in the products & services they provide their customers. Many other fun and useful Tempest apps are designed by individual developers for use by a single Tempest System owner. The use cases are limited only by your imagination!
Commercial API Users
For uses that go beyond our self-serve developer tools, to discuss an app or integration that would require access to data from the broader Tempest network, or to learn about direct hardware integration options, please contact us with a description of your idea - we’d love to hear about it.
Getting started is simple:
Step 1. Authenticate
To start using the REST or WS API, all you need is an access token. Your app or integration must ensure that the user viewing the station data is the owner of that station by authenticating the user’s account. There are two options for authentication: Oauth or the Personal Access Token.
OAuth Access Token
OAuth is an open standard for authentication that provides a seamless integration between your app and the user’s Tempest account. OAuth is the way our official integrations (Amazon Echo, Google Home, IFTTT, etc.) work, and we strongly encourage you to use OAuth in any app with a web-based interface, including mobile apps. For more information on Oauth, please see the Tempest OAuth 2.0 Support section.
Personal Access Token
If you have a simple app or integration that does not have a web-based interface (e.g., a downloadable script or a smart home configuration that does not have a graphical user interface), you should use the personal access token method. Your users will need to sign in to the Tempest Web App, then go to Settings -> Data Authorizations -> Create Token
, then copy & paste that token into your app.
Which method should I use?
While OAuth is the preferred authentication method for production applications, the Personal Access Token is the simplest way to get started with the API - just sign in to your own account and generate one. You can add OAuth once your app or integration is ready for external testing.
Step 2. Dive in!
Once you have an access token (either a personal or Oauth), you’re ready to start playing with the API. See our full REST and WebSocket documentation for complete details, or get started with a few quick examples below.
REST Examples
GET Station Meta Data
Retrieve a list of your stations along with all connected devices.
https://swd.weatherflow.com/swd/rest/stations?token=[your_access_token]
GET Latest Station Observation
Get the latest most recent observation for your station.
https://swd.weatherflow.com/swd/rest/observations/station/[your_station_id]?token=[your_access_token]
GET Latest Device Observation
Get the latest observation from one of your devices.
https://swd.weatherflow.com/swd/rest/observations/?device_id=[your_device_id]&token=[your_access_token]
WebSocket Examples
Open a WebSocket Connection
wss://ws.weatherflow.com/swd/data?token=[your_access_token]
Listen for observations
Send a JSON message over the WebSocket connection to start listening for observations from the device. After sending this message, your connected WebSocket client should receive a new observation JSON message every minute.
{
"type": "listen_start",
"device_id": [your_device_id],
"id": "random-id-12345"
}
Step 4. Join the Community.
If you haven’t already, head over to the Developers area of our Community Forum, where friendly users swap ideas, information and help (WeatherFlow staff is known to lurk there regularly).
Step 5. Share your Creation.
Tell the world how great your awesome new application or integration is! An announcement to our Community Forum is a great place to start.
Can I access data from the hardware locally?
To ensure access to the best data, all third-party applications and integrations should use the remote interfaces (REST & WebSocket) as their primary source for data, even if they are running on the same network as the local Tempest device. There is also a local UDP interface available for those applications that require completely off-grid applications, but this should only be used as a backup to the remote interfaces.