# WeatherFlow REST API -- Station Observations

**URL:** <https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386>\
**Category:** Developers\
**Created:** [June 29, 2020, 6:50am UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386 "2020-06-29T06:50:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aj6b](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@aj6b](https://community.tempest.earth/u/aj6b)\
**Post date:** [June 29, 2020, 6:50am UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/1 "2020-06-29T06:50:07Z")

</div>

A new Tempest owner here and finishing up my WeatherFlow REST API to CWOP/APRS integration…

A few questions… these all relate to the **STATION** federated observation AP at /observations/station/{station\_id}:

1. There is an array of “station\_units” although those units do not seem to correlate to the obs array. Example: station\_units says units\_temp is ‘f’ but the obs is in centigrade. It also appears that the obs for wind is in m/s, but I can’t be certain as it has not been very windy.

2. The CWOP specification wants precipitation as inches per last 24 hours and last calendar day. Obviously obs precip\_accum\_local\_day has today’s precipitation since midnight local time, but to calculate last 24 hours I am assuming I will need store the precipitation values every x minutes and sum up the last 24 hours observations. What is shown in “precip” in obs in the station federated API observation, is this “The Rain Rate description is set according to the latest one minute accumulation, extrapolated to an hourly rate?” The documentation is extremely light on the API and the forums have some conversation about precipitation but it is was related to UDP and/or the device observations. Are the units in obs actually inches?? We haven’t had any rain yet for me to test…

3. Is it fair to say the wind\_avg on the station federated observation is the last 1 minute average?

4. Is a 1 minute cadence on API requests for station observations considered too aggressive for an application? Especially if we need to record the rain every x minutes, depends on answer for question #2.

5. What are other values for the “status” array? Offline? Delayed?

6. Is the timestamp in obs the last observation received as from WeatherFlow’s servers? Would it be fair to say I should record the last timestamp and make sure it is greater than my last API fetch to know that I am receiving new data?

7. There is reference that the “default” device is one that is returned by the federated station API. Does this mean that if there are multiple devices for the station only 1 obs will always be returned at array pos 0 or will there multiple still in the obs array yet 0 is always the preferred?

8. I chose to use the federated station observation API because I wanted to use the adjusted precipitation numbers from WeatherFlow (do the WeatherFlow adjustments only work on precip\_accum\_local\_yesterday\_final?) as well as I do not have to keep a local computer running here 24x7 to do the uploading every x minutes, although it depends on WeatherFlow continued access to the “hosted” API as well as no WeatherFlow outages…

Thanks!

Sean, AJ6B

---

<div class="post-metadata">

**Author:** ![peter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/peter/32/1365_2.png) [@peter](https://community.tempest.earth/u/peter)\
**Post date:** [June 29, 2020, 7:59am UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/2 "2020-06-29T07:59:45Z")

</div>

> [@aj6b](#):
>
> There is an array of “station\_units” although those units do not seem to correlate to the obs array. Example: station\_units says units\_temp is ‘f’ but the obs is in centigrade. It also appears that the obs for wind is in m/s, but I can’t be certain as it has not been very windy.

The array of “station\_units” show what units the user has selected to display their data. The data in the `obs` array will always be in metric (see here for details: [Tempest API](https://weatherflow.github.io/SmartWeather/api/swagger/) and click “expand operations” in the top right).

> [@aj6b](#):
>
> The CWOP specification wants precipitation as inches per last 24 hours and last calendar day. Obviously obs precip\_accum\_local\_day has today’s precipitation since midnight local time, but to calculate last 24 hours I am assuming I will need store the precipitation values every x minutes and sum up the last 24 hours observations. What is shown in “precip” in obs in the station federated API observation, is this “The Rain Rate description is set according to the latest one minute accumulation, extrapolated to an hourly rate?” The documentation is extremely light on the API and the forums have some conversation about precipitation but it is was related to UDP and/or the device observations. Are the units in obs actually inches?? We haven’t had any rain yet for me to test…

Yes, you will need to store the individual rain accumulation readings to calculate the accumulation over the last 24 hours. The `precip` value in the `obs` array is the total amount of rain accumulated over the last reporting period, which in the case of the station API end point is 1 minute. You will need to sum-up 1440 individual `precip` values from the `obs` array to get the total rainfall over 24 hours. The units of `precip` will be in mm.

> [@aj6b](#):
>
> Is it fair to say the wind\_avg on the station federated observation is the last 1 minute average?

Yes

> [@aj6b](#):
>
> Is a 1 minute cadence on API requests for station observations considered too aggressive for an application? Especially if we need to record the rain every x minutes, depends on answer for question #2.

No, 1 minute should be fine. Have you considered using the Websocket rather than the API? This will automatically send new observations every time they are received by the WF servers, saving you from making a new API request each minute.

> [@aj6b](#):
>
> What are other values for the “status” array? Offline? Delayed?

I think the `status` array refers to the status of the API request, rather than the status of the device. If you use an incorrect API key on purpose, you should see the `status` array change.

> [@aj6b](#):
>
> Is the timestamp in obs the last observation received as from WeatherFlow’s servers? Would it be fair to say I should record the last timestamp and make sure it is greater than my last API fetch to know that I am receiving new data?

It is the last timestamp given to the observation by either the hub or the Tempest (I don’t know which), not the time that it is received by the WF servers. Unless you switch to using the Websocket, yes you will need to make sure that each observation is newer than the previous one you received.

> [@aj6b](#):
>
> There is reference that the “default” device is one that is returned by the federated station API. Does this mean that if there are multiple devices for the station only 1 obs will always be returned at array pos 0 or will there multiple still in the obs array yet 0 is always the preferred?

I believe it will still only return the observations for a single device (the default). There is currently no way to change the default without getting in touch with support.

> [@aj6b](#):
>
> I chose to use the federated station observation API because I wanted to use the adjusted precipitation numbers from WeatherFlow (do the WeatherFlow adjustments only work on precip\_accum\_local\_yesterday\_final?) as well as I do not have to keep a local computer running here 24x7 to do the uploading every x minutes, although it depends on WeatherFlow continued access to the “hosted” API as well as no WeatherFlow outages…

Remember that the adjusted precipitation numbers for a given day are not available until 8 am at the latest on the following day. If you want to take advantage of these numbers, then your uploading to CWOP will be 24 hours delayed.

---

<div class="post-metadata">

**Author:** ![aj6b](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@aj6b](https://community.tempest.earth/u/aj6b)\
**Post date:** [June 30, 2020, 6:17am UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/3 "2020-06-30T06:17:31Z")

</div>

Thanks Peter for everything!

All changes have been implemented and are live…

---

<div class="post-metadata">

**Author:** ![register](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@register](https://community.tempest.earth/u/register)\
**Post date:** [November 22, 2020, 3:09pm UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/4 "2020-11-22T15:09:36Z")

</div>

Hi,

is there a way to get archived data? I only get the actual values via rest but not the old ones.

Is there maybe already some program(PC windows) to get the archived data and save it as csv?

---

<div class="post-metadata">

**Author:** ![btst.online](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/btst.online/32/16538_2.png) [@btst.online](https://community.tempest.earth/u/btst.online)\
**Post date:** [November 22, 2020, 3:50pm UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/5 "2020-11-22T15:50:55Z")

</div>

The REST API allows you to get historical data, with caveats…

> **[Tempest API](https://weatherflow.github.io/Tempest/api/swagger/#!/observations/getObservationsByDeviceId)**

  
You will not be able to get the high-resolution data (3-second, etc)… you will be able to 1-minute under some calls, depending on the timeframe selects. Some will only return daily averages, etc.  
YMMV

---

<div class="post-metadata">

**Author:** ![register](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@register](https://community.tempest.earth/u/register)\
**Post date:** [November 22, 2020, 4:32pm UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/6 "2020-11-22T16:32:01Z")

</div>

ah, thank you. I diddnt get this optional parameters 🙂

---

<div class="post-metadata">

**Author:** ![lewtesco](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lewtesco](https://community.tempest.earth/u/lewtesco)\
**Post date:** [November 30, 2020, 12:48pm UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/7 "2020-11-30T12:48:09Z")

</div>

I have an issue  
the Tempest API says there should be 17 fields in the Sky device starting with 0-16  
I only have 9  
How come? and how do I find out what mine actually are?  
device\_id=35103  
{“status”:{“status\_code”:0,“status\_message”:“SUCCESS”},“device\_id”:35103,“type”:“obs\_sky”,“source”:“cache”,“summary”:{“precip\_total\_1h”:0.080386,“precip\_accum\_local\_yesterday”:0.0,“precip\_analysis\_type\_yesterday”:0},“obs”:[[1606739573,898,0.03,0,0.63,2.62,4.43,270,3.31,1,7,0.147142,0,15,null,null,0]]}

---

<div class="post-metadata">

**Author:** ![eric](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/eric/32/13553_2.png) [@eric](https://community.tempest.earth/u/eric)\
**Post date:** [November 30, 2020, 12:52pm UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/8 "2020-11-30T12:52:08Z")

</div>

I count 16 items in obs you show (the coma is the separator)

obs”:[[1606739573,898,0.03,0,0.63,2.62,4.43,270,3.31,1,7,0.147142,0,15,null,null,0]]}

and they are ordered as mentioned on [this page](https://weatherflow.github.io/Tempest/api/ws.html)

---

<div class="post-metadata">

**Author:** ![lewtesco](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lewtesco](https://community.tempest.earth/u/lewtesco)\
**Post date:** [December 1, 2020, 8:17am UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/9 "2020-12-01T08:17:14Z")

</div>

Sorry I must have been looking at the Air instead of Sky for some stupid reason.  
Thanks for the link though, it’s a good explanation of Request Messages

---

<div class="post-metadata">

**Author:** ![lewtesco](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lewtesco](https://community.tempest.earth/u/lewtesco)\
**Post date:** [December 1, 2020, 8:23am UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/10 "2020-12-01T08:23:02Z")

</div>

One last question from the Sky device  
Index 3 Rain Accumulated mm  
What time period is that accumulation ie how long has it been accumulating ?

---

<div class="post-metadata">

**Author:** ![peter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/peter/32/1365_2.png) [@peter](https://community.tempest.earth/u/peter)\
**Post date:** [December 1, 2020, 9:01am UTC](https://community.tempest.earth/t/weatherflow-rest-api-station-observations/7386/11 "2020-12-01T09:01:34Z")

</div>

Just the previous 1 minute
