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...") |
(No difference)
|
Revision as of 14:20, 27 February 2014
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
The returned content type is deteced by the requested file extension
- .json or not set → JSON
- .csv → Semicolon separated values
- .tsv → TAB separated values
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