# Wind speed from Rest API?

**URL:** <https://community.tempest.earth/t/wind-speed-from-rest-api/8541>\
**Category:** Developers\
**Created:** [August 8, 2020, 10:23pm UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541 "2020-08-08T22:23:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![EdmontonTom](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@EdmontonTom](https://community.tempest.earth/u/EdmontonTom)\
**Post date:** [August 8, 2020, 10:23pm UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541/1 "2020-08-08T22:23:36Z")

</div>

Hey there 👋

Can anyone explain how to the wind average is calculated for the rest API?

I accessed my station via the API at: [https://swd.weatherflow.com/swd/rest/observations/station/25764?api\_key=20c70eae-e62f-4d3b-b3a4-8586e90f3ac8](https://swd.weatherflow.com/swd/rest/observations/station/25764?api_key=20c70eae-e62f-4d3b-b3a4-8586e90f3ac8)

the values I get for wind speeds are:  
“units\_wind”: “kph”,  
“wind\_avg”,  
“wind\_direction”,  
“wind\_gust”,  
“wind\_lull”,  
“wind\_chill”,  
“wind\_avg”: 2.3,  
“wind\_direction”: 120,  
“wind\_gust”: 3.1,  
“wind\_lull”: 1.1,  
“wind\_chill”: 27.1,

At the same time, I get very different values from the app/webinterface at: [Tempest](https://tempestwx.com/station/25764/grid)

The average has never matched between the two so I’m wondering what I’m missing to understand this.

Than you!

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [August 9, 2020, 12:54am UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541/2 "2020-08-09T00:54:07Z")

</div>

Yes. It is the average of the wind speeds during the last 60 seconds. There is a specific formula for the calculation of speed and direction.

---

<div class="post-metadata">

**Author:** ![EdmontonTom](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@EdmontonTom](https://community.tempest.earth/u/EdmontonTom)\
**Post date:** [August 9, 2020, 2:28am UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541/3 "2020-08-09T02:28:18Z")

</div>

Thanks for the answer, Gary.

Would it be correct in thinking that this is also the average over 1 minute too? Shouldn’t these numbers be the same between the app and api?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/2X/7/7c714ae865483b0d99e6c86f50c76be9fc402a82.jpeg)

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [August 9, 2020, 3:14am UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541/4 "2020-08-09T03:14:53Z")

</div>

They will be depending on when the call is made. The applications Apple, Android and website get the data via a websocket. The REST API gets the data from the same database as the websocket.

---

<div class="post-metadata">

**Author:** ![EdmontonTom](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@EdmontonTom](https://community.tempest.earth/u/EdmontonTom)\
**Post date:** [August 9, 2020, 7:38pm UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541/5 "2020-08-09T19:38:47Z")

</div>

The average hasn’t gone below 5 km/h all day today and yet it’s still always in the low 2 km/h range. I still don’t understand what I’m missing. It seems off to me but I’m sure it’s my misunderstanding.

I’ve been comparing the two for most of the day.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/2X/5/5631e51e85c4855fc73c0cd379496d2b42923e03.jpeg)

---

<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:** [August 9, 2020, 8:00pm UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541/6 "2020-08-09T20:00:19Z")

</div>

I think it is the units that is confusing you. Despite the `units_wind` field reading `kph`, wind speeds in the API are reported in meters per second. The `units_wind` field refers to what units you use in the app. You will need to convert the value in the API to kph to match what you see in the app

---

<div class="post-metadata">

**Author:** ![EdmontonTom](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@EdmontonTom](https://community.tempest.earth/u/EdmontonTom)\
**Post date:** [August 9, 2020, 8:08pm UTC](https://community.tempest.earth/t/wind-speed-from-rest-api/8541/7 "2020-08-09T20:08:03Z")

</div>

That is exactly what has thrown me off! Thank you, Peter!
