ezeio2:apiref:samplelog

Return data from the sample log

#### Description

`https://api.eze.io/v1/samplelog/{serial}/from={datetime}/to={datetime}/[fields]/[interval[,aggregation]]/["raw"]`

#### Parameters

 `serial` The serial number of the ezeio (XYZ987) `from=datetime` The beginning of the range. Format per RFC3339. `to=datetime` The end of the range. Format per RFC3339. `fields` (optional) Comma separated list of fields. Possible fields are 1-90, GPSx, GPSy, GPSz, GPSsignal. If not given, all fields are returned. `interval` (optional) Sample interval. Given as a number followed by 'd', 'h' or 'm' for day, hour or minute. `aggregation` (optional) Method of aggregation. Only valid if interval is given. `“raw”` (optional) Only return values actually stored in database.

If no interval is given, an automatic interval will be calculated based on the size of the range. This is to ensure the amount of data returned is reasonable.

If range >= 365 days, interval will be 1 day.
If range >= 60 days, interval will be 1 hour.
If range >= 7 days, interval will be 10 minutes.
If range >= 24 hours, interval will be 1 minute.
For smaller ranges than 24 hours, the interval will be 1 seconds.

Under no circumstances will the call return more than 15000 rows of data.

Aggregation modes:

`mean` : The mean (average) of samples in the interval
`mode` : The mode (most common value)
`median` : The middle value of sorted samples in the interval
`min` : The smallest value
`max` : The largest value
`sum` : The sum of all samples in the interval

Only data from fields configured for higher logging rates than 10 minutes will be returned. See the syslog API for other fields.

#### Example usage

15 day interval using defaults:

`https://api.eze.io/v1/samplelog/XYZ987/from=2017-03-01/to=2017-03-15`

Specifying fields:

`https://api.eze.io/v1/samplelog/XYS987/from=2018-10-05T06:30:00Z/to=2018-10-06T06:30:00Z/fields=2,4,12,GPSx,GPSy`

Hourly max values:

`https://api.eze.io/v1/samplelog/XYZ987/from=2019-02-01/to=2019-03-01/fields=1,2/interval=1h,max`

#### Return value

JSON formatted data

```Example query:
https://api.eze.io/v1/samplelog/baa157/from=2019-02-01/to=2019-03-01/fields=1,2

{
"reqtime":"2019-06-16T22:51:49Z",
"data":[
{
"time":"2019-02-01T00:00:00Z",
"f1":null,
"f2":null
},
{
"time":"2019-02-01T00:10:00Z",
"f1":432609,
"f2":25.67
},
{
"time":"2019-02-01T00:20:00Z",
"f1":433209,
"f2":25.709999
},
{
"time":"2019-02-01T00:30:00Z",
"f1":433809,
"f2":25.709999
},
// ** Entries removed for brevity **
{
"time":"2019-02-28T22:00:00Z",
"f1":786047.1666666666,
"f2":25.016666666666666
},
{
"time":"2019-02-28T23:00:00Z",
"f1":789648,
"f2":25.151667000000003
}
],
"status":"OK",
"exec_time":0.027250051498413086
}```
• ezeio2/apiref/samplelog.txt
{"ft_lang_label":"__label__en","ft_lang_prob":0.5065489,"math_prob":0.8605776,"size":2719,"snap":"2021-21-2021-25","text_gpt3_token_len":880,"char_repetition_ratio":0.13517496,"word_repetition_ratio":0.01764706,"special_character_ratio":0.3961015,"punctuation_ratio":0.22934233,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9579451,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-13T08:21:25Z\",\"WARC-Record-ID\":\"<urn:uuid:bb656893-d70d-445e-8a0d-b55d8dec5a26>\",\"Content-Length\":\"33507\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2129f2f0-2423-4376-8675-09f15013417c>\",\"WARC-Concurrent-To\":\"<urn:uuid:0abf93a7-a8c3-46fe-b6a9-c6f0df7afa90>\",\"WARC-IP-Address\":\"18.237.147.146\",\"WARC-Target-URI\":\"https://doc.eze.io/ezeio2/apiref/samplelog\",\"WARC-Payload-Digest\":\"sha1:H4IVX4NJ23LSWCELK6DNSKIZYUNHEDM3\",\"WARC-Block-Digest\":\"sha1:OMBKK3BSWD7COZTLOGTWWA2BXXHGHIXV\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243990584.33_warc_CC-MAIN-20210513080742-20210513110742-00370.warc.gz\"}"}