# Getting station data

**URL:** <https://community.tempest.earth/t/getting-station-data/17879>\
**Category:** Developers\
**Tags:** tempest\
**Created:** [June 30, 2022, 5:46pm UTC](https://community.tempest.earth/t/getting-station-data/17879 "2022-06-30T17:46:42Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [June 30, 2022, 5:46pm UTC](https://community.tempest.earth/t/getting-station-data/17879/1 "2022-06-30T17:46:42Z")

</div>

Using the documentation here: [WeatherFlow Tempest API & Developer Platform](https://weatherflow.github.io/Tempest/api/)  
I’ve gotten my device ID from the response from swd/rest/stations

And am passing it to: [https://swd.weatherflow.com/swd/rest/observations/?device\_id=[your\_device\_id]&token=[your\_access\_token]](https://swd.weatherflow.com/swd/rest/observations/?device_id=%5Byour_device_id%5D&token=%5Byour_access_token%5D) (substituting the values, of course)

But am getting: {“status”:{“status\_code”:3,“status\_message”:“REQUEST\_INPUT\_ERROR - device\_id required”},“type”:null,“source”:“db”,“obs”:null}

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![sunny](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/sunny/32/16368_2.png) [@sunny](https://community.tempest.earth/u/sunny)\
**Post date:** [June 30, 2022, 6:31pm UTC](https://community.tempest.earth/t/getting-station-data/17879/2 "2022-06-30T18:31:58Z")

</div>

try this one? Does that work? `https://swd.weatherflow.com/swd/rest/observations/device/168731?day_offset=0&format=csv&token=bcf4754a-886b-4b84-9ce7-5b70c22e5299`

I think the error message is telling you that you are using the wrong device id.

---

<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:** [June 30, 2022, 6:43pm UTC](https://community.tempest.earth/t/getting-station-data/17879/3 "2022-06-30T18:43:28Z")

</div>

> [@sunny](#):
>
> [https://swd.weatherflow.com/swd/rest/observations/device/168731?day\_offset=0&format=csv&token=bcf4754a-886b-4b84-9ce7-5b7](https://swd.weatherflow.com/swd/rest/observations/device/168731?day_offset=0&format=csv&token=bcf4754a-886b-4b84-9ce7-5b7)

401 Not Authorized. Where would I get the device ID from? I grabbed it from the response from the station request:  
`{"stations":[{"location_id":76713,"station_id":76713,"name":"Home","public_name":"Conrad St","latitude":41.4593,"longitude":-82.05627,"timezone":"America/New_York","timezone_offset_minutes":-240,"station_meta":{"share_with_wf":true,"share_with_wu":true,"elevation":191.08578491210938},"last_modified_epoch":1656428823,"created_epoch":1655642627,"devices":[{"device_id": **204795** ,"serial_number":"HB-00068027","location_id":76713,"device_meta":{"agl":1.8288,"name":"HB-00068027","environment":"indoor","wifi_network_name":""},"device_type":"HB","hardware_revision":"1","firmware_revision":"177"},{"device_id": **204805** ,"serial_number":"ST-00061881","location_id":76713,"device_meta":{"agl":3.749040046334267,"name":"ST-00061881","environment":"outdoor","wifi_network_name":""},"device_settings":{"show_precip_final":true},"device_type":"ST","hardware_revision":"1","firmware_revision":"165"}],"station_items":[{"location_item_id":633647,"location_id":76713,"device_id":204805,"item":"air_temperature_humidity","sort":0,"station_id":76713,"station_item_id":633647},{"location_item_id":633649,"location_id":76713,"device_id": **204805** ,"item":"barometric_pressure","sort":1,"station_id":76713,"station_item_id":633649},{"location_item_id":639677,"location_id":76713,"device_id": **204795** ,"item":"diagnostics","station_id":76713,"station_item_id":639677},{"location_item_id":639678,"location_id":76713,"device_id":204805,"item":"diagnostics","station_id":76713,"station_item_id":639678},{"location_item_id":633651,"location_id":76713,"device_id":204805,"item":"light","sort":4,"station_id":76713,"station_item_id":633651},{"location_item_id":633648,"location_id":76713,"device_id":204805,"item":"lightning","sort":2,"station_id":76713,"station_item_id":633648},{"location_item_id":633650,"location_id":76713,"device_id":204805,"item":"rain","sort":5,"station_id":76713,"station_item_id":633650},{"location_item_id":633652,"location_id":76713,"device_id":204805,"item":"wind","sort":3,"station_id":76713,"station_item_id":633652}],"is_local_mode":false}],"status":{"status_code":0,"status_message":"SUCCESS"}}`

---

<div class="post-metadata">

**Author:** ![sunny](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/sunny/32/16368_2.png) [@sunny](https://community.tempest.earth/u/sunny)\
**Post date:** [June 30, 2022, 6:51pm UTC](https://community.tempest.earth/t/getting-station-data/17879/4 "2022-06-30T18:51:38Z")

</div>

you didn’t copy and paste the complete url in the test link I just posted. It is missing the last 8 characters.

But indeed you get the device id from the call you did. In your case your tempest has device id 204805 (I’m assuming you added the asterix)

---

<div class="post-metadata">

**Author:** ![gizmoev](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/gizmoev/32/941_2.png) [@gizmoev](https://community.tempest.earth/u/gizmoev)\
**Post date:** [June 30, 2022, 6:58pm UTC](https://community.tempest.earth/t/getting-station-data/17879/5 "2022-06-30T18:58:28Z")

</div>

> [@mabeatty1978](#):
>
> Where would I get the device ID from?

You can also get the Device ID from the app in the Station Status page. An easy way to get it is from the Web page of your station. At the bottom is ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/2X/9/9146668ea51be26c781470ba8573899d410067f7.png). Just click on it and you get a screen similar to this from one of my stations. I’ve circled the Station ID and Device ID.

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

---

<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:** [June 30, 2022, 7:44pm UTC](https://community.tempest.earth/t/getting-station-data/17879/6 "2022-06-30T19:44:53Z")

</div>

Yes, I attempted to “bold” them in the code block which puts on the asterix, but I guess that doesn’t work in code blocks.

I retried it and that works, but not the request I’m trying to get. I’m looking to get current devic data, not current location data.

---

<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:** [June 30, 2022, 7:50pm UTC](https://community.tempest.earth/t/getting-station-data/17879/7 "2022-06-30T19:50:47Z")

</div>

I’ve resolved the issue. I had a “=” in the wrong spot in the device\_id. My apologizes, but thank you for helping.
