Difference between revisions of "Data readout example"
From PhotoVoltaic Logger new generation
(Created page with "For full list of supported request parameters refer to the API parameters documentation == Time period == If the queried time period (end – AP...") |
m |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | For full list of supported request parameters refer to the [[API parameters]] documentation | + | {{TOCright}}[[Category:API]][[Category:Example]] |
+ | == Parameters == | ||
+ | |||
+ | For full list of supported request parameters refer to the [[API#Data_readout|API parameters]] documentation | ||
== Time period == | == Time period == | ||
− | If the queried time period ([[API | + | If the queried time period ([[API#Parameters|end]] – [[API#Parameters|start]]) is less than the [[API#Parameters|consolidation period]], the result can be only one line by design. |
(Remember the defaults: <tt>start=00:00</tt>, <tt>end=24:00</tt>) | (Remember the defaults: <tt>start=00:00</tt>, <tt>end=24:00</tt>) | ||
Line 28: | Line 31: | ||
== Returned content type == | == Returned content type == | ||
− | + | see [[API#Requested format|explanation]] | |
− | |||
− | |||
− | |||
== Examples == | == Examples == | ||
Line 61: | Line 61: | ||
'''Get data as above, but on a weekly basis''' | '''Get data as above, but on a weekly basis''' | ||
− | http://your.domain.here/api/r1/{GUID}.csv?start=1/1&period=1week | + | <nowiki>http://your.domain.here/api/r1/{GUID}.csv?start=1/1&period=1week</nowiki> |
'''Get all data for last 7 days''' | '''Get all data for last 7 days''' | ||
Line 76: | Line 76: | ||
<nowiki>http://your.domain.here/api/r3/data/{GUID}.csv?start=1/1&period=1year</nowiki> | <nowiki>http://your.domain.here/api/r3/data/{GUID}.csv?start=1/1&period=1year</nowiki> | ||
− | |||
− |
Latest revision as of 13:09, 19 December 2014
Parameters
For full list of supported request parameters refer to the API parameters documentation
Time period
If the queried time period (end – start) is less than the consolidation period, the result can be only one line by design.
(Remember the defaults: start=00:00, end=24:00)
Time declarations
Here are some useful examples for relative start and end declarations
What | Request as start or end |
---|---|
1-Jan this year | 1/1 first day of this year |
1-Jan of last year | 1/1-1year first day of last year |
1st day of this month | first day of this month |
1st day of last month | first day of last month |
Don't forget to URL encode your parameters, e.g. as first+day+of+this+year
Returned content type
see explanation
Examples
Get all feed-in power values from today as CSV, so many lines as data records exists
http://your.domain.here/api/r3/data/{GUID}.csv
As above, but as JSON array of objects
http://your.domain.here/api/r3/data/{GUID}.json
Get only one CSV line of the last stored data record today
http://your.domain.here/api/r3/data/{GUID}.csv?period=last
Get CSV lines of data on daily basis.
Because of the queried time period (00:00 – now), the result will be one line...
http://your.domain.here/api/r3/data/{GUID}.csv?period=1day
Get CSV lines on daily basis, start at begin of the year
This will return one line for each day in the time period.
http://your.domain.here/api/r3/data/{GUID}.csv?start=1/1&period=1day
Get data as above, but on a weekly basis
http://your.domain.here/api/r1/{GUID}.csv?start=1/1&period=1week
Get all data for last 7 days
http://your.domain.here/api/r3/data/{GUID}.csv?start=-7days
Get the monthly data since commissioning
http://your.domain.here/api/r3/data/{GUID}.csv?start=0&period=1month
Get CSV lines of data on yearly basis
Because of the queried time period ("1-Jan this year" ... "now" is lower than aggregation period), the result will be one line...
http://your.domain.here/api/r3/data/{GUID}.csv?start=1/1&period=1year