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 \
--compressedParameters
point_idsRequired-
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_dateRequired-
Start date for requested data, in
YYYY-MM-DDformat. The maximum date span allowed is 400 days. end_dateRequired-
Inclusive end date for requested data, in
YYYY-MM-DDformat. The maximum date span allowed is 400 days. date-
Convenience to request a single date of data, in
YYYY-MM-DDformat. If this parameter is specified,start_dateandend_datemay be omitted. If all 3 parameters are supplied,datetakes 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:
auto5min(only valid if span <= 10 days)15min(only valid if span <= 31 days)30min(only valid if span <= 31 days)1hr1day1moraw(only valid if span is 1 day)
Defaults to auto.
If raw is specified, the frame is not resampled. Only
the recorded timestamps are returned, and the aggregate
parameter is ignored.
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
},
...
]
}