Data Viewer stats by API call

I did answer on that thread :slight_smile: (although it did get buried by significant side tracking)

Looking closer at the code, there are api endpoints for average but not for min and max etc

This tallies with the phpfina engine only having functions for average but no mention of min and max functions.

However, there doesn’t appear to be any mention of average in the phptimeseries engine so use of the “average” feed api must be limited to phpfina only.

The graphs calculate these things “on page” as it were, I too think it would be very useful to have api endpoints (and the functions in the feed engines if needed) so that we could query that data directly, as then could the graphs page and apps etc thus reducing the need for any duplication of the calculations, it would offer consistent results from one place (per engine?).

I believe use of millis is indeed due to the use of JS, but the lowest resolution emoncms can work to is 1 second so the end 3 zeros in any unixmillis timestamp are just padding.