Metrics chart

Returns metric values sampled for a line chart: original samples when they are few enough, otherwise values aggregated per minute or per bucket.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Returns metric values ready to be plotted on a line chart. This is the same data used by the Things5 web app charts (Monitoring) and by the Grafana datasource, so the three always show the same values for the same time range.

How the resolution is chosen

The resolution is selected automatically for each metric from the requested time range and from how many samples the device sent:

ConditionresolutionPoints
Range ≤ 30 minutesrawOriginal samples sent by the device
At most 1000 samples in the rangerawOriginal samples sent by the device
At most 1000 minutes with data in the rangeminuteOne point per minute (bucket_seconds = 60)
OtherwisebucketOne point per bucket of range / 400 minutes (bucket_seconds gives the size)

When the points are aggregated (minute or bucket), each value is computed with the aggregate function over the bucket: avg (default, weighted on the number of samples), min, max or sum. With raw resolution the original values are returned and aggregate has no effect.

Gaps

With show_gaps=true (default) aggregated series contain a point with value: null for each bucket without data, so a chart can draw a gap instead of joining distant points. Use show_gaps=false to receive only buckets with data.

Limits

At most 50 metric_names[] per request. To read more metrics, split them over several requests.

To read the per-minute processed values (first, last, min, max, avg, sum, sample count) with pagination use Metrics read.

Path Params
string
required

Device id (UUID)

Query Params
metric_names[]
array of strings
required

Metric names to read, at most 50

metric_names[]*
date
required

Start of the range, timestamp ISO 8601. E.g. 2026-11-01T00:00:00Z

date
required

End of the range, timestamp ISO 8601. E.g. 2026-11-02T00:00:00Z

string
enum
Defaults to avg

Function used when points are aggregated (resolution minute or bucket). Ignored for raw data

Allowed:
boolean
Defaults to true

Return null points for buckets without data

Responses

Language
Credentials
Header
LoadingLoading…
Response
Choose an example:
application/json