scshih
(Sheng-chi)
2 June 2025 09:14
1
Hi all,
I have a question on the parameters of api calls.
However, I did not find any documentation on it.
So I try to ask here and hope someone would know the answer.
Now I use the following url to call api:
https://emoncms.org/feed/data.json?id={device_id}&start={start_date}&end={end_date}&apikey={app_key}&interval={interval}&average=0
My question is what is the “average” parameter?
What is the definition of it being 0,1,2, etc?
Thanks
Welcome, @scshih , to the OEM forum.
Have you logged in to emoncms.org and looked at the Feeds page? On this page is a link
Feed API Help
The link leads here:
If you click the drop-down for “average”, the choices are No & Yes. Therefore 0 = No & 1 = Yes, and I think the value returned will be the average of all stored numbers between start time and end time over consecutive intervals of “interval” seconds.
I tried this API command
http://192.168.1.74/feed/data.json?id=1&start=01/06/2025%2021:08:00&end=02/06/2025%2009:10:00&interval=216000&average=1&timeformat=unixms&skipmissing=0&limitinterval=0&delta=0
on this Feed (with 10 s feed interval)
and the result:
0
0 1736197680000
1 130.21364593753108
1
0 1736413680000
1 156.49252458590723
2
0 1736629680000
1 131.45849737917936
3
0 1736845680000
1 153.61874476759522
4
0 1737061680000
1 170.37699035450265
5
0 1737277680000
1 133.07260881635878
6
0 1737493680000
1 138.5047359724398
7
0 1737709680000
1 184.90201745599003
8
0 1737925680000
1 153.9026868863459
9
0 1738141680000
1 170.8216441768711
10
0 1738357680000
1 138.49253699694972
11
0 1738573680000
1 134.4875379059933
12
0 1738789680000
1 173.58246752191474