# API returning status\_code 2, DATA\_ERROR - null, when using time\_start and time\_end

**URL:** <https://community.tempest.earth/t/api-returning-status-code-2-data-error-null-when-using-time-start-and-time-end/26058>\
**Category:** Developers\
**Tags:** tempest\
**Created:** [December 16, 2024, 10:35am UTC](https://community.tempest.earth/t/api-returning-status-code-2-data-error-null-when-using-time-start-and-time-end/26058 "2024-12-16T10:35:33Z")\
**Posts on this page:** 5\
**Page:** 1

<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 16, 2024, 10:35am UTC](https://community.tempest.earth/t/api-returning-status-code-2-data-error-null-when-using-time-start-and-time-end/26058/1 "2024-12-16T10:35:33Z")

</div>

Since 4th December 2024 I have had a problem with my code not working and today I began looking into why.  
I suspect that it is because the API has been returning:  
{“status”:{“status\_code”:2,“status\_message”:“DATA\_ERROR - null”}  
when I request observations from any of my devices including Tempest, Sky or Air,  
and between a time\_start and time\_end.  
Either using curl, a browser or the Tempest API Explorer page here:  
[https://weatherflow.github.io/Tempest/api/swagger/#!/observations/getStationObservation](https://weatherflow.github.io/Tempest/api/swagger/#!/observations/getStationObservation)

If I use a day\_offset it works correctly for example returning  
“status”: {  
“status\_code”: 0,  
“status\_message”: “SUCCESS”  
},  
“device\_id”: 386494,  
“type”: “obs\_air”,  
“bucket\_step\_minutes”: 1,  
“obs”: [  
[  
1734220800,  
998.5,  
23.6,  
91,  
0,  
0,  
3.17,  
1  
],

But if I use time\_start and time\_end (without a day offset) it returns:  
“status”: {  
“status\_code”: 2,  
“status\_message”: “DATA\_ERROR - null”  
},  
“device\_id”: 386494,  
“type”: “obs\_air”,  
“bucket\_step\_minutes”: 1,  
“obs”: [  
[  
1734342720,  
997.9,  
22.7,  
94,  
0,  
0,  
3.16,  
1  
],

I am guessing Weatherflow changed something but perhaps I have a different problem?  
Before I change my code to adapt I am trying to check if Weatherflow did something to cause this.

But other thoughts I have it was within a day (but not the same time) of adding a new Air to my system which includes 3 hubs running 2 Tempests, 2 Skys and 2 Airs.  
Perhaps it might be a change to my raincheck settings or I accidentally touched an icon that changed something while installing the Air, but I doubt those thoughts.  
The problem appears on all my devices including 3 different hubs including old, not so old and almost new.  
I will log a support call and I thought I would ask here to let you know and hopefully publish a solution from some one.  
cheers Ian 🙂

---

<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:** [December 16, 2024, 10:49am UTC](https://community.tempest.earth/t/api-returning-status-code-2-data-error-null-when-using-time-start-and-time-end/26058/2 "2024-12-16T10:49:31Z")

</div>

I get that data error as well, but it still returns valid data. I’ve no idea why.

---

<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 16, 2024, 11:34am UTC](https://community.tempest.earth/t/api-returning-status-code-2-data-error-null-when-using-time-start-and-time-end/26058/3 "2024-12-16T11:34:21Z")

</div>

Hi Sunny,  
Do you mean when you look at it now it appears to be valid data?  
A data type or something may be different which I am still investigating.  
I went back to an old log file and checked that my same API call in the past returned:  
\_status {‘status\_code’: 0, ‘status\_message’: ‘SUCCESS’}

edit :And I just grabbed the actual call to the API from an old log file and tried it now and it returns the error now but it did not back when it ran about a year ago.  
cheers Ian 🙂

---

<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 16, 2024, 12:37pm UTC](https://community.tempest.earth/t/api-returning-status-code-2-data-error-null-when-using-time-start-and-time-end/26058/4 "2024-12-16T12:37:33Z")

</div>

Well I sort of fixed it for now by allowing it to ignore the error with this:  
if (\_status\_code == 0  
and \_status\_message == ‘SUCCESS’  
or \_status\_code == 2  
and \_status\_message == ‘DATA\_ERROR - null’  
):

Which confirms the data is still good and it is only the status code and status message which have changed.  
cheers Ian 🙂

---

<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 19, 2024, 12:54am UTC](https://community.tempest.earth/t/api-returning-status-code-2-data-error-null-when-using-time-start-and-time-end/26058/5 "2024-12-19T00:54:53Z")

</div>

And now the bug has been fixed and it appears back to normal.  
thanks Weatherflow Tempest support  
cheers Ian 🙂
