# What format is tempest's historical data in API?

**URL:** <https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078>\
**Category:** Developers\
**Tags:** udp, history, tempest\
**Created:** [December 5, 2023, 2:31am UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078 "2023-12-05T02:31:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Best\_codes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/best_codes/32/16121_2.png) [@Best\_codes](https://community.tempest.earth/u/Best_codes)\
**Post date:** [December 5, 2023, 2:31am UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/1 "2023-12-05T02:31:19Z")

</div>

# What format is tempest’s historical data in API?

## Question:

If I visit the tempest API (historical) at say  
`https://swd.weatherflow.com/swd/rest/stats/device/291045?api_key=...&build=...&token=...etc...`

I get a response _like_ this:

```json
{
    "device_id": XXXXXX,
    "type": "device_stats_st",
    "first_ob_day_local": "YYYY-MM-DD",
    "last_ob_day_local": "YYYY-MM-DD",
    "stats_day": [
        [
            "YYYY-MM-DD",
            977.4,
            978.4,
            976.5,
            27.8,
            33.5,
            23,
            58,
            72,
            41,
            22746,
            119657,
            0,
            2,
            10.79,
            0,
            190,
            997,
            0,
            1.2,
            4.91,
            0,
            2,
            3,
            0,
            null,
            751,
            2.7,
            6.19345,
            0.130062,
            12,
            12,
            2,
            1
        ],
        [
            "YYYY-MM-DD",
            985.7,
            988.2,
            978.3,
            27.2,
            33.6,
            21,
            70,
            82,
            54,
            35558,
            115046,
            0,
            3.3,
            10.57,
            0,
            296,
            959,
            0,
            1.6,
            4.85,
            0,
            63,
            3,
            0,
            null,
            1433,
            2.7,
            0,
            0,
            0,
            0,
            0,
            0
        ]
   ]
}

```

But my question is, what is each number? I see for UDP docs that the data for it is formatted like

| Index | Field | Units |
| --- | --- | --- |
| 0 | Time Epoch | Seconds |
| 1 | Wind Lull (minimum 3 second sample) | m/s |
| 2 | Wind Avg (average over report interval) | m/s |
| 3 | Wind Gust (maximum 3 second sample) | m/s |
| 4 | Wind Direction | Degrees |
| 5 | Wind Sample Interval | seconds |
| 6 | Station Pressure | MB |
| 7 | Air Temperature | C |
| 8 | Relative Humidity | % |
| 9 | Illuminance | Lux |
| 10 | UV | Index |
| 11 | Solar Radiation | W/m^2 |
| 12 | Rain amount over previous minute | mm |
| 13 | Precipitation Type | 0 = none, 1 = rain, 2 = hail, 3 = rain + hail (experimental) |
| 14 | Lightning Strike Avg Distance | km |
| 15 | Lightning Strike Count | |
| 16 | Battery | Volts |
| 17 | Report Interval | Minutes |

> **[WeatherFlow Tempest UDP Reference - v171](https://weatherflow.github.io/Tempest/api/udp/v171/)**

So what is each number in the historical version? Is it each one’s high and low, is it in the same order, etc. See below:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/3X/c/2/c287e7d1027f75bbf38a45d7cbd954db538b0d1f.png)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![mabeatty1978](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/mabeatty1978/32/15139_2.png) [@mabeatty1978](https://community.tempest.earth/u/mabeatty1978)\
**Post date:** [December 6, 2023, 4:59pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/2 "2023-12-06T16:59:25Z")

</div>

> [@Best\_codes](#):
>
> [https://swd.weatherflow.com/swd/r](https://swd.weatherflow.com/swd/r)

It’s documented in a different location. I’m can say I understand why there are two sources of documentation, but the one below seems to be a “new” version.

> **[Statistics for a Station](https://apidocs.tempestwx.com/reference/get_stats-station-station-id)**
>
> Get a summary of observation data and Statistics for a station. A stats\_day array is returned in the response object. The table below describes the values shown at each index location for each stats\_day array returned in the date range given....

TLDR;

| Index | Parameter | Description |
| --- | --- | --- |
| 0 | Pressure | (mb) |
| 1 | Pressure (high) | (mb) |
| 2 | Pressure (low) | (mb) |
| 3 | Temperature | (°C) |
| 4 | Temperature (high) | (°C) |
| 5 | Temperature (low) | (°C) |
| 6 | Humidity | (%) |
| 7 | Humidity (high) | (%) |
| 8 | Humidity (low) | (%) |
| 9 | Lux | (lx) |
| 10 | Lux (high) | (lx) |
| 11 | Lux (low) | (lx) |
| 12 | UV | (index) |
| 13 | UV (high) | (index) |
| 14 | UV (low) | (index) |
| 15 | Solar radiation | (W/m²) |
| 16 | Solar radiation (high) | (W/m²) |
| 17 | Solar radiation (low) | (W/m²) |
| 18 | Wind (average) | (m/s) |
| 19 | Wind (gust) | (m/s) |
| 20 | Wind (lull) | (m/s) |
| 21 | Wind direction | (°) |
| 22 | Wind interval | |
| 23 | Strike count | |
| 24 | Strike average distance | (km) |
| 25 | Record count | |
| 26 | Battery | |
| 27 | Local precipitation accumulation (today) | (mm) |
| 28 | Local precipitation accumulation (final) | (mm) |
| 29 | Local precipitation minutes (today) | |
| 30 | Local precipitation minutes (final) | |
| 31 | Precipitation type | 0 = none, 1 = rain, 2 = hail, 3 = rain + hail (experimental) |
| 32 | Precipitation analysis type | 0 = none, 1 = Nearcast value with display on, 2 = Nearcast value with display off |

---

<div class="post-metadata">

**Author:** ![Best\_codes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/best_codes/32/16121_2.png) [@Best\_codes](https://community.tempest.earth/u/Best_codes)\
**Post date:** [December 6, 2023, 11:00pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/3 "2023-12-06T23:00:00Z")

</div>

Thanks, @mabeatty1978, that fixed the issue. Just wondering, is the

> [@mabeatty1978](#):
>
> 0 Pressure (mb)

> [@mabeatty1978](#):
>
> 3 Temperature (°C)

etc. Just the average since it isn’t a high or a low?

Thanks so much, again!

---

<div class="post-metadata">

**Author:** ![iladyman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/iladyman/32/2305_2.png) [@iladyman](https://community.tempest.earth/u/iladyman)\
**Post date:** [December 7, 2023, 12:54pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/4 "2023-12-07T12:54:49Z")

</div>

Hi @Best_codes,

I doubt that they are averages.  
Simple to confirm though.  
What do you see when you look at what is returned compared to your days history?  
Let us know what you discover.

cheers Ian 🙂

---

<div class="post-metadata">

**Author:** ![Best\_codes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/best_codes/32/16121_2.png) [@Best\_codes](https://community.tempest.earth/u/Best_codes)\
**Post date:** [December 7, 2023, 6:17pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/5 "2023-12-07T18:17:24Z")

</div>

The API says something like this:

```json
[
            "2023-08-17",
            977.4,
            978.4,
            976.5,
            27.8,
            33.5,
            23,
            58,
            72,
            41,
            22746,
            119657,
            0,
            2,
            10.79,
            0,
            190,
            997,
            0,
            1.2,
            4.91,
            0,
            2,
            3,
            0,
            null,
            751,
            2.7,
            6.19345,
            0.130062,
            12,
            12,
            2,
            1
        ],
        [
            "2023-08-18",
            985.7,
            988.2,
            978.3,
            27.2,
            33.6,
            21,
            70,
            82,
            54,
            35558,
            115046,
            0,
            3.3,
            10.57,
            0,
            296,
            959,
            0,
            1.6,
            4.85,
            0,
            63,
            3,
            0,
            null,
            1433,
            2.7,
            0,
            0,
            0,
            0,
            0,
            0
        ],

```

But I can’t find where the daily stats are for those days on [tempestwx.com](http://tempestwx.com).

So, I don’t know…

---

<div class="post-metadata">

**Author:** ![iladyman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/iladyman/32/2305_2.png) [@iladyman](https://community.tempest.earth/u/iladyman)\
**Post date:** [December 7, 2023, 10:24pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/6 "2023-12-07T22:24:40Z")

</div>

Hi @Best_codes,  
If you do that again but for yesterdays data and supply the link to your station assuming it is public then I can have a look for you.  
Cheers Ian 🙂

---

<div class="post-metadata">

**Author:** ![Best\_codes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/best_codes/32/16121_2.png) [@Best\_codes](https://community.tempest.earth/u/Best_codes)\
**Post date:** [December 8, 2023, 4:16am UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/7 "2023-12-08T04:16:02Z")

</div>

Sorry, @iladyman, my station is not public. 😕

Here is yesterday’s data from the API:

```json
[
            "2023-12-06",
            792.5,
            793.6,
            791.5,
            9.7,
            16.8,
            3,
            54,
            73,
            35,
            14683,
            64377,
            0,
            0.7,
            2.91,
            0,
            122,
            536,
            0,
            2.2,
            8.29,
            0,
            144,
            3,
            0,
            null,
            1435,
            2.7,
            0.011624,
            0.000244,
            1,
            1,
            1,
            1
        ],
        [
            "2023-12-07",
            793.1,
            794,
            792.4,
            13.9,
            19.8,
            9,
            63,
            80,
            54,
            14899,
            63170,
            0,
            0.7,
            2.86,
            0,
            124,
            526,
            0,
            4.3,
            13.54,
            0,
            175,
            3,
            0,
            null,
            1328,
            2.7,
            0,
            0,
            0,
            0,
            0,
            0
        ]

```

If you can access the link (if you are an admin or something), it is [https://tempestwx.com/station/116095/](https://tempestwx.com/station/116095/). I have gone to the history chart for temp:

> ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/3X/2/7/27cbefa36f1a64e541e40a76d4221205bec18ccb.png)  
> Historical data for station 116095

But it goes by minute, not daily.

---

<div class="post-metadata">

**Author:** ![Best\_codes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/best_codes/32/16121_2.png) [@Best\_codes](https://community.tempest.earth/u/Best_codes)\
**Post date:** [December 8, 2023, 4:18am UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/8 "2023-12-08T04:18:56Z")

</div>

@iladyman @mabeatty1978 Aha! I went to  
`https://tempestwx.com/history/116095/day/2023/12/6`  
I see this (after changing my settings to degrees C):

![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/3X/2/8/2876738995eb3595302c1a20b3de1eccade8afc5.png)

```json
[
            "2023-12-06",
            792.5,
            793.6,
            791.5,
            9.7,
            16.8,
            3,
            54,
            73,
            35,
            14683,
            64377,
            0,
            0.7,
            2.91,
            0,
            122,
            536,
            0,
            2.2,
            8.29,
            0,
            144,
            3,
            0,
            null,
            1435,
            2.7,
            0.011624,
            0.000244,
            1,
            1,
            1,
            1
        ]

```

Which matches the data in the API for high, low, and average. Thanks, everyone, for your help!

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [December 8, 2023, 7:50pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/9 "2023-12-08T19:50:17Z")

</div>

Nice. Sure wish @wfsupport would link this one into their [WeatherFlow Tempest API & Developer Platform](https://weatherflow.github.io/Tempest/api/) page next to the current link to the swagger play around page they point to now for REST.

---

<div class="post-metadata">

**Author:** ![mabeatty1978](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/mabeatty1978/32/15139_2.png) [@mabeatty1978](https://community.tempest.earth/u/mabeatty1978)\
**Post date:** [December 11, 2023, 5:49pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/10 "2023-12-11T17:49:57Z")

</div>

Those are current observations.

---

<div class="post-metadata">

**Author:** ![Best\_codes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/best_codes/32/16121_2.png) [@Best\_codes](https://community.tempest.earth/u/Best_codes)\
**Post date:** [December 11, 2023, 7:59pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/11 "2023-12-11T19:59:15Z")

</div>

I think they are the average for the day, actually.

> [@Best\_codes](#):
>
> @iladyman @mabeatty1978 Aha! I went to  
> `https://tempestwx.com/history/116095/day/2023/12/6`  
> I see this (after changing my settings to degrees C):
> 
> ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/3X/2/8/2876738995eb3595302c1a20b3de1eccade8afc5.png)
> 
> ```auto
> [
> "2023-12-06",
> 792.5,
> 793.6,
> 791.5,
> 9.7,
> 16.8,
> 3,
> 54,
> 73,
> 35,
> 14683,
> 64377,
> 0,
> 0.7,
> 2.91,
> 0,
> 122,
> 536,
> 0,
> 2.2,
> 8.29,
> 0,
> 144,
> 3,
> 0,
> null,
> 1435,
> 2.7,
> 0.011624,
> 0.000244,
> 1,
> 1,
> 1,
> 1
> ]
> 
> ```
> 
> Which matches the data in the API for high, low, and average. Thanks, everyone, for your help!

Do you see something specific in the docs that states otherwise?

---

<div class="post-metadata">

**Author:** ![mabeatty1978](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/mabeatty1978/32/15139_2.png) [@mabeatty1978](https://community.tempest.earth/u/mabeatty1978)\
**Post date:** [December 11, 2023, 8:41pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/12 "2023-12-11T20:41:43Z")

</div>

No, you’re right. Freudian slip. My brain was on the observations/ endpoint, not the stats

---

<div class="post-metadata">

**Author:** ![Best\_codes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/best_codes/32/16121_2.png) [@Best\_codes](https://community.tempest.earth/u/Best_codes)\
**Post date:** [December 12, 2023, 2:43pm UTC](https://community.tempest.earth/t/what-format-is-tempests-historical-data-in-api/23078/13 "2023-12-12T14:43:29Z")

</div>

No problem 😃 We have it all figured out now, I guess. Thanks, all, for your help!

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/3X/9/c/9cf32575a232aaf5a3a40ec70f3e9e1e38209984.png)
