Skip to main content

Get Device Readings

Pull time-series measurements for a single device with GET /v5/devices/{device_id}/data — parameters, response schema, pagination, and code examples in five languages.

Get Device Readings

GET /v5/devices/{device_id}/data

Retrieves time-series measurements for a single device. Get the device_id from List Devices, then call this endpoint to pull the device's readings over a date or timestamp window.

Authentication

Authenticated with your API key in the X-API-Key header; the user is resolved from the key. Access requires an Administrator, Editor, or User role in the device's organization. See Authentication and Data access control in the Overview.

Request

GET https://api.zentracloud.io/v5/devices/{device_id}/data

Path parameters

Parameter

Type

Required

Description

device_id

string

Yes

The unique identifier of the device. Example: z6-12345.

Query Parameters

Parameter

Type

Default

Description

direction

string

descending

Order in which data is retrieved and displayed by date. One of ascending or descending.

start_datetime

string (ISO 8601)

-

Start of the window as an ISO datetime string. A datetime without a timezone is treated as UTC. Example: 2025-10-20T17:15+00:00. Use datetimes or timestamps, not both.

end_datetime

string (ISO 8601)

-

End of the window as an ISO datetime string. A datetime without a timezone is treated as UTC. Example: 2025-10-20T17:15+00:00. Use datetimes or timestamps, not both.

start_timestamp

integer

-

Start of the window as a Unix timestamp (seconds since 1970-01-01 UTC). Example: 1763445086. Use timestamps or datetimes, not both.

end_timestamp

integer

-

End of the window as a Unix timestamp (seconds since 1970-01-01 UTC). Example: 1763445086. Use timestamps or datetimes, not both.

units

string

metric

The units the data returns in. One of metric or imperial.

next_token

string

-

The token needed to retrieve the next pagination set. See Pagination below.

latest

boolean

false

Coming soon. Returns the latest datapoint; supersedes the datetime and timestamp parameters. Example: true.

expand

string

-

Coming soon. Returns more information on the field passed. Example: settings

Provide either the datetime pair (start_datetime / end_datetime) or the timestamp pair (start_timestamp / end_timestamp) — not both.

Example requests

cURL

curl --request GET \
--url 'https://api.zentracloud.io/v5/devices/z6-00930/data?start_datetime=2026-05-29T00%3A00%3A00-00%3A00&end_datetime=2026-05-30T23%3A59%3A00-00%3A00&direction=descending&units=metric' \
--header 'Accept: */*' \
--header 'X-API-Key: YOUR_API_KEY'

JavaScript — Fetch

const url = 'https://api.zentracloud.io/v5/devices/z6-00930/data?start_datetime=2026-05-29T00%3A00%3A00-00%3A00&end_datetime=2026-05-30T23%3A59%3A00-00%3A00&direction=descending&units=metric';
const options = {
method: 'GET',
headers: { 'X-API-Key': 'YOUR_API_KEY', Accept: '*/*' }
};

try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Python — Requests

import requests

url = "https://api.zentracloud.io/v5/devices/z6-00930/data"
querystring = {
"start_datetime": "2026-05-29T00:00:00-00:00",
"end_datetime": "2026-05-30T23:59:00-00:00",
"direction": "descending",
"units": "metric",
}
headers = {
"X-API-Key": "YOUR_API_KEY",
"Accept": "*/*",
}

response = requests.get(url, headers=headers, params=querystring)
print(response.json())

PHP — cURL

<?php
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zentracloud.io/v5/devices/z6-00930/data?start_datetime=2026-05-29T00%3A00%3A00-00%3A00&end_datetime=2026-05-30T23%3A59%3A00-00%3A00&direction=descending&units=metric",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: */*",
"X-API-Key: YOUR_API_KEY",
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

R — httr

library(httr)

url <- "https://api.zentracloud.io/v5/devices/z6-00930/data"

queryString <- list(
start_datetime = "2026-05-29T00:00:00-00:00",
end_datetime = "2026-05-30T23:59:00-00:00",
direction = "descending",
units = "metric"
)

response <- VERB("GET", url, query = queryString,
add_headers('X-API-Key' = 'YOUR_API_KEY'),
accept("*/*"))

content(response, "text")

Response

A 200 OK returns the device's measurements for the requested window, with a next_token when more pages are available.

metadata

Describes the device the readings belong to.

Field

Type

Description

device_id

string

The unique identifier (serial) of the device.

device_name

string

The device's display name. Defaults to the device_id when no custom name is set.

location

string

The device's location description.

coordinates

string

The device's latitude and longitude, comma-separated.

values []

Each item is a single measurement from one sensor port at one point in time. Ordering follows the direction parameter.

Field

Type

Description

port_num

integer

The sensor port the reading came from.

measurement

string

The measured quantity (e.g. Gust Speed).

unit

string

The unit of value, reflecting the requested units (e.g. m/s).

sensor_name

string

The sensor that produced the reading (e.g. ATMOS 41W).

value

number

The measured value.

timestamp

integer

The reading time as a Unix timestamp (seconds since the epoch, UTC).

datetime

string

The reading time as a human-readable datetime with UTC offset.

error_code

integer

The reading's error code. 0 indicates no error.

pagination

Field

Type

Description

num_readings

integer

The number of readings returned on this page.

next_token

string | null

The token to pass on the next request to fetch the following page, or null when there are no more pages. See Pagination below.

start_datetime

string (ISO 8601)

The start of the window covered by this page.

end_datetime

string (ISO 8601)

The end of the window covered by this page.

Example response

{
"metadata": {
"device_id": "A4100123",
"device_name": "JersyField",
"location": "Upper East Field",
"coordinates": "40.6673487, -74.61492299999999"
},
"values": [
{
"port_num": 1,
"measurement": "Gust Speed",
"unit": "m/s",
"sensor_name": "ATMOS 41W",
"value": 0.53,
"timestamp": 1771401600,
"datetime": "2026-02-18 00:00:00-08:00",
"error_code": 0
},
{
"port_num": 1,
"measurement": "Gust Speed",
"unit": "m/s",
"sensor_name": "ATMOS 41W",
"value": 0.57,
"timestamp": 1771400700,
"datetime": "2026-02-17 23:45:00-08:00",
"error_code": 0
}
// ... additional readings omitted for brevity
],
"pagination": {
"num_readings": 97,
"next_token": null,
"start_datetime": "2026-02-17T08:00:00Z",
"end_datetime": "2026-02-18T08:00:00Z"
}
}

Pagination

Readings are paginated using calendar-month windows aligned to UTC. Each page contains the data for a single calendar month, and a next_token is returned when additional pages are available. Pass that next_token on the next request to fetch the following page.

When requesting data in descending order (newest first), the first page contains only the portion of the current month up to your requested end_datetime or end_timestamp. As a result, this initial page is often smaller than subsequent pages, which each contain a full calendar month of data.

Rate limiting

Rate limited per user; requests beyond your limit return 429. See Rate Limiting.

Errors

Status

Endpoint-specific cause

403

You lack an Administrator/Editor/User role in the device's organization.

422

Mixing datetime and timestamp parameters, or an otherwise invalid parameter value.

See Errors for the full model, including 401 and 429.

Notes

  • Carry the device_id from List Devices into the path.
  • Timestamps are seconds since the Unix epoch (UTC).

How did we do?

List Devices

Contact