Getting Unauthorized when requesting stats/station

I just got my Tempest and am writing some code for personal use with the REST API.

https://swd.weatherflow.com/swd/rest/observations/station/{myStation}?token={myToken} works great.

https://swd.weatherflow.com/swd/rest/stats/station/{myStation}?token={myToken} returns {“status”:{“status_code”:401,“status_message”:“UNAUTHORIZED”}}

What am I doing wrong?

I think there might be an error in the API address you are using. I have never heard of a /stats/ endpoint for stations.

The stations end point looks like this

https://swd.weatherflow.com/swd/rest/stations?token=[your_access_token]

Stats is documented here: Station
It provides “Daily, weekly, monthly, annual and all-time high/low/averages for a station.”

1 Like

I’m seeing the same behavior (401 error) for that station stats API, using a Personal Use Token that works fine with the station observations API.

Anyone figure out how to address this? I’m having the same issue trying to utilize this API on my personal station

What issue specifically ? What did you try ? What did you see ?

All the REST examples at WeatherFlow Tempest API & Developer Platform worked for me.

Like this one here for getting hi/low statistics from station (same one referenced above):

https://swd.weatherflow.com/swd/rest/stats/station/{station_id}?api_key={api_key}

Using my station_id and my API token

Returns:
{
“status”: {
“status_code”: 401,
“status_message”: “UNAUTHORIZED”
}
}

:confused:

My wild guess is that a token for the REST API is not the same as an api_key for the URL you posted, but that’s really a wild guess. Their ‘Tempestone API’ docs are very unhelpful to me.

I would hazard a guess that this is a paid-for endpoint for Tempest One subscribers. The endpoints available for free to home users are detailed here: Tempest API

Well that stinks. Would be nice to be able to pull high/low data for our own stations. :frowning: Oh well.

Interesting thing I note too is parts of the full API shows when you need a paid subscription, but parts that don’t seem to work don’t have the same notice. Wonder if there’s a different free API key you need for the expanded API that gives you additional access but still isn’t the full commercial paid version.

For instance, forecast is flagged as a commercial service:

Just an interesting side-note. That expanded API is pretty well documented, except for access requirements.

It’s possible that some of the endpoints in the expanded documents will eventually be available for free, but they just aren’t live yet. I believe there was always an intention from WF to make the stats/historical endpoint available, but I haven’t heard anything more regarding that for a long time.

It’s not that much more work to calculate the max/min yourself (you can download data from any time span) from the free API, or you could check out Weewx which will do it for you: https://weewx.com/

Yeah, definitely some workarounds I can do. Hopefully they’ll open up some of the basic stuff at least (surely it is less load on their servers to service a single api call for max/min than multiple calls to get all the data so it can be calculated locally).

As with anything, work within the constraints that you have. But if anyone from WF is looking through threads, maybe they’ll see it would be a win/win to open up some basic things like this. I’ll keep my fingers crossed.