Hello all at WeatherFlow!
Today, I want to share with you some feedback (and questions / suggestions) about the REST API. This feedback comes directly from the following use case:
I’ve developed an application (as a matter of fact it’s a plugin for a more “wide” application, but that does not change the substance of the subject) that has the following goals:
- to collect “current” data, on a regular basis, from a WF station
- to store it locally to compile historical data
- to display (locally stored) current or historical data (in widgets, graphs, charts, etc.)
As you may induce, the historical data is locally compiled and stored only when the application runs. If the application fails, or is stopped, the historical data will have “holes”. And of course, there’s no historical data prior to the application installation…
Now, I want to allows users of my application to “import” old data from WF: data that pre-dates the installation of this application.
And this is where it gets complicated
To collect data, I use the /observations/station/ endpoint which is fully adapted to what is wanted: to get a “best” view of all probes of the station in one consistent set. Great!
But, to import old data, /observations/station/ is not suitable. It provides only current data. So I must use /observations/device/ endpoint which, as its name suggests, is not based on a “aggregated” view of the station, but on a per device (probe) data set. And it’s a true paradigm shift. With all that implies in terms of new processing workflow.
So my first remark / question / suggestion (remove the useless word) is:
Why not to have an endpoint, similar to /observations/station/, to retrieve old data with the same “format” as /observations/station/? Do you have it in your backlog? Is it something realistic / feasible?
If not, I will use /observations/device/. And here is my second question:
How to simulate with it the view provided by the endpoint /observations/station/? What heuristics should I use?
I know that all this may seem odd, but I also know from experience that the value of an API appears when it is used in concrete cases. And this is my case
Maybe I missed something obvious. Maybe my explanation is betrayed by my English skills. In any case, do not hesitate to tell me …