Hi, like many folks here I’ve developed my own application for capturing the data from my weather station, saving it and displaying it how I like. What I’m curious about is finding out if there’s a way to download all the data that my station has logged here since it went online 9 months ago and putting that in my database as well. I thought I’d seen something in the API documentation that showed how to pull down single observation data from past days but I can’t find that anymore and it seems like an awkward and inefficient way to get the data anyway.
The API has a method to pull an entire days worth of data per device. Just start with day 1 and increment until you get three consecutive days with no data.
If you are familiar with simple coding it should be easy making a small script that exports data from the API to MySQL. I made a simple PHP-script and one year worth of data (676089 rows) took about 22minutes (local MySQL on my laptop). I used the json_decode() function and a loop for looping through day_offset=1 to day_offset=365. If you want all days you can loop through day_offset=1 to day_offset=1000 (or greater) and test if length on the json_decode() is greater than 0, if 0 then empty and no processing required.
Kind Regards
Waiting for my own WF to arrive so cant test with own data
Yes, I’ve done that. I just figured that it was an inefficient way of getting the data. I needed to make 300+ web requests to download about 45 MB of data and then code up & debug the routines for the derived metrics. I have it all now and won’t need to do that again (hopefully) but it just seemed like being able to make a request to download an entire station’s data all at once wouldn’t be too complicated, especially since it could be zipped up before sending which would significantly reduce the bandwidth.
There are a lot of changes coming in the API. As you know, the staff at WeatherFlow is extremely busy getting hardware produced, firmware updated and preparing for shipments to customers.
I’m as anxious as you to get the updated documentation.
One of my objectives of getting the station was to have access to historical data in an easy way. Unfortunately, since I have very little coding experience, I guess I won’t be able to do that right?