Trends
Retrieves trend data for a source on a given date span.
POST /v1/trends
curl https://api.novant.io/v1/trends \
-u ak_sample_123: \
-d date=2022-12-05 \
-d point_ids=s.1.1,s.1.2,s.1.3 \
--compressed
Parameters
point_ids
Required-
Points to request trend data for, where ids are formatted as a comma-separated list, i.e.:
"s.1.1,s.1.2,s.1.5"
. start_date
Required-
Start date for requested data, in
YYYY-MM-DD
format. The maximum date span allowed is 400 days. end_date
Required-
Inclusive end date for requested data, in
YYYY-MM-DD
format. The maximum date span allowed is 400 days. date
-
Convenience to request a single date of data, in
YYYY-MM-DD
format. If this parameter is specified,start_date
andend_date
may be omitted. If all 3 parameters are supplied,date
takes precedence. tz
-
Timezone to return results in. If not specified will default to the project timezone.
interval
-
Resample interval to apply to the trend data. Allowed values:
auto
15min
(only valid if span < 31 days)30min
(only valid if span < 31 days)1hr
1day
1mo
Defaults to auto
.
See also: Trend Resampling
aggregate
-
Aggregation function used when resampling data. Allowed values:
auto
,mean
,sum
,min
,max
,diff
.
Defaults to auto
.
See also: Trend Resampling
Returns
Returns trend values for given date and points.
{
"start": "2022-12-05T00:00:00-07:00",
"end": "2022-12-05T23:59:59-07:00",
"tz": "Denver",
"interval": "15min",
"aggregate": "auto",
"point_ids": [
"s.1.1",
"s.1.2",
"s.1.3"
],
"trends": [
{
"ts": "2022-12-05T00:00:00-07:00",
"s.1.1": 87.0,
"s.1.2": 1.0,
"s.1.3": 4.0
},
{
"ts": "2022-12-05T00:15:00-07:00",
"s.1.1": 86.0,
"s.1.2": 0.0,
"s.1.3": 2.0
},
{
"ts": "2022-12-05T00:30:00-07:00",
"s.1.1": 86.3,
"s.1.2": 0.8,
"s.1.3": 2.5
},
...
]
}