Documentation / API
Telemetry
Read a channel's measurements over a period (raw or aggregated automatically), export a device's data as CSV, read organization statistics, and follow a device in real time over WebSocket.
All paths are relative to https://apiv1.opensensorcloud.com/api/v1; any member of the organization can read. To send measurements, see Ingestion.
Query a channel
GET /orgs/{orgId}/devices/{deviceId}/telemetry
| Parameter | Required | Meaning |
|---|---|---|
key |
yes | channel key, e.g. temperature |
from |
yes | start of the period (ISO 8601) |
to |
no | end of the period, default now; must be after from |
curl -b jar.txt "https://apiv1.opensensorcloud.com/api/v1/orgs/$ORG/devices/$DEVICE/telemetry?key=temperature&from=2026-11-12T09:00:00Z"
{
"key": "temperature",
"interval": "raw",
"points": [
{ "ts": "2026-11-12T09:10:00.000Z", "value": 21.4 },
{ "ts": "2026-11-12T09:20:00.000Z", "value": 21.9 }
]
}
Intervals
The granularity follows the length of the period, so that a chart never receives millions of points:
| Period length | interval |
Points |
|---|---|---|
| up to 24 h | raw |
the measurements as received, at most the latest 10,000 of the period |
| up to 7 days | 1m |
one point per minute |
| up to 90 days | 1h |
one point per hour |
| beyond | 1d |
one point per day |
Aggregated points carry the average in value and the extremes of the bucket:
{ "ts": "2026-11-06T10:00:00.000Z", "value": 22.31, "min": 19.8, "max": 25.1 }
Only number channels are aggregated; bool and string channels always return raw points (interval: "raw"). An unknown channel returns { "key": "…", "interval": "raw", "points": [] }. Hourly and daily averages are kept even when the organization's raw-data retention has deleted the raw measurements.
Per-period values
GET /orgs/{orgId}/devices/{deviceId}/telemetry/buckets
One value per hour, day, week or month, computed by the server: what the bars, stat, heatmap and counter widgets display.
| Parameter | Required | Meaning |
|---|---|---|
key |
yes | channel key (a number channel; otherwise points is empty) |
from |
yes | start of the period (ISO 8601) |
to |
no | end of the period, default now; must be after from |
bucket |
yes | 1h, 1d, 1w (weeks start on Monday) or 1M |
fn |
yes | avg, min, max, count, integral or delta |
tz |
no | IANA time zone of day, week and month boundaries, e.g. Europe/Paris; default UTC |
curl -b jar.txt "https://apiv1.opensensorcloud.com/api/v1/orgs/$ORG/devices/$DEVICE/telemetry/buckets?key=power&from=2026-11-01T00:00:00%2B01:00&bucket=1d&fn=integral&tz=Europe/Paris"
{
"key": "power", "bucket": "1d", "fn": "integral", "unit": "kW·h",
"points": [
{ "ts": "2026-10-31T23:00:00.000Z", "value": 18.42 },
{ "ts": "2026-11-01T23:00:00.000Z", "value": null }
]
}
Every bucket starting in the period is returned, in order; ts is its start. value is null for a bucket without data (0 for count).
fn |
Value of a bucket | Computed from |
|---|---|---|
avg, min, max |
average (weighted by the number of readings), lowest, highest reading | hourly and daily aggregates |
count |
number of readings | hourly and daily aggregates |
integral |
Σ hourly average × 1 h, over the hours that hold readings: kW → kWh, m³/h → m³. Hours without readings count for nothing (no interpolation over gaps) | hourly aggregates |
delta |
increase of an index that only grows (energy or water meter): last reading of the bucket − last reading before it, so consecutive buckets add up exactly | raw measurements |
unit is the channel's unit, <unit>·h for integral, null for count or a channel without unit. Aggregates are read from hourly buckets starting in the period, so a from that is not on a full hour starts at the next hour. delta reads the raw measurements: it needs them within the organization's retention, and is null for buckets whose raw data has been deleted. The reading before the first bucket is looked up to one bucket width before from; without one, the increase up to the first reading of the range is not counted. A decreasing index (counter reset) gives a negative increase.
At most 1,000 buckets per request (counting 23-hour days and 28-day months), otherwise 400; an unknown time zone also gives 400.
Latest values
There is no dedicated endpoint: GET /orgs/{orgId}/devices/{deviceId} returns each channel's lastValue and lastTs (see Devices), and dashboard data returns them for many devices at once (see Dashboards).
CSV export
GET /orgs/{orgId}/devices/{deviceId}/export.csv
| Parameter | Default |
|---|---|
from |
the beginning (1970) |
to |
now |
Raw measurements of every channel, streamed, ordered by time then channel key:
time,channel,value
2026-11-12T09:10:00.000Z,door,false
2026-11-12T09:10:00.000Z,humidity,62
2026-11-12T09:10:00.000Z,temperature,21.4
The file is sent as an attachment named after the device. At most 1,000,000 rows; beyond, the last line is # export truncated at 1000000 rows. Text values starting with =, +, -, @ are prefixed with ' so that spreadsheets do not run them as formulas.
Organization statistics
GET /orgs/{orgId}/stats and GET /orgs/{orgId}/usage return stored volumes and today's message count: see Auth & organizations.
Real time (WebSocket)
GET /live (WebSocket upgrade)
wss://apiv1.opensensorcloud.com/api/v1/live, authenticated by the session cookie. The connection is only accepted from the web UI's origin (403 bad_origin otherwise): it is meant for the UI, not for scripts.
One connection follows one device at a time. Client → server:
{ "type": "subscribe", "orgId": "7dd446ca-…", "deviceId": "8dec3c85-…", "debug": true }
{ "type": "unsubscribe" }
A new subscribe replaces the previous one. With debug: true, the stream also carries every received message, accepted or rejected (the "Live debug" view).
Server → client:
{ "type": "subscribed", "deviceId": "8dec3c85-…" }
{ "type": "telemetry", "deviceId": "8dec3c85-…", "receivedAt": "2026-11-13T10:27:48.120Z",
"points": [ { "ts": "2026-11-13T10:27:48.120Z", "key": "temperature", "value": 23.4 } ] }
{ "type": "debug", "event": {
"ts": "2026-11-13T10:27:49.002Z", "orgId": "7dd446ca-…", "deviceId": "8dec3c85-…", "protocol": "http",
"payload": "{\"temperature\": \"hot\"}", "bytes": "eyJ0ZW1wZXJhdHVyZSI6ICJob3QifQ==", "size": 22,
"status": "rejected", "error": "(corps) : Invalid input" } }
{ "type": "error", "error": "not_found" }
Debug events are never stored. payload and bytes (base64) hold at most the first 2,048 bytes; a gzip message also has encoding: "gzip" and decodedSize. Errors: invalid_message, not_found (no access to the device), access_revoked (the member was removed or the device deleted; checked every minute, then the socket closes).