@shmaplex/xplant-sdk 0.7.0 is out: what's new →
xPlantAPI
API referenceSensor readings

List sensor readings

The workspace's environmental readings, newest first, a page at a time. Narrow them to one device, one growing room or one kind of measurement, and use since and until to fetch only the readings taken within a window.

GET/api/v1/sensor-readings
Scope read:sensor_readings

Pages are larger here than on other lists: 100 readings by default and up to 1,000. To read further back than one page reaches, follow meta.next_cursor with the same filters until it comes back null. Readings taken at the same moment keep a fixed order, so none is skipped or repeated.

Query parameters

NameTypeRequiredDescription
device_idstring (uuid)NoOnly readings from this device.
room_idstring (uuid)NoOnly readings for this growing room.
type"temperature" | "humidity" | "ph" | "co2" | "light" | "other"NoOnly this kind of reading.
sincestring (date-time)NoOnly readings taken at or after this time, as an ISO 8601 timestamp in UTC or with an offset. Write an offset's + as %2B.
untilstring (date-time)NoOnly readings taken at or before this time, as an ISO 8601 timestamp in UTC or with an offset. Write an offset's + as %2B. Must not be earlier than since.
limitintegerNoPage size. Values above 1,000 are capped at 1,000. Default 100. From 1 to 1000.
offsetintegerNoNumber of records to skip. Prefer cursor where a list offers it: an offset shifts when records are added ahead of it. Default 0. At least 0.
cursorstringNoContinue from the previous page: pass its meta.next_cursor unchanged, with the same filters. Treat it as opaque. Not combinable with offset. Up to 2048 characters.

Example

curl "https://app.xplantpro.com/api/v1/sensor-readings?device_id=5f7a9c1e-3b5d-4f7a-9c1e-3b5d7f9a1c3e&type=temperature&since=2026-09-24T00%3A00%3A00Z&until=2026-09-25T00%3A00%3A00Z&limit=1000" \
  -H "Authorization: Bearer $XPLANT_API_KEY"

Response

200 with { "ok": true, "data": … }. data is an array. To get the next page, pass meta.next_cursor back as cursor; it is null on the last page. See Pagination.

FieldTypeRequiredDescription
idstring (uuid)Yes—
device_idstring (uuid)Yes—
team_idstring (uuid)YesThe id of the workspace the reading belongs to.
room_idstring | null (uuid)Yes—
typestringYesWhat was measured: temperature, humidity, ph, co2, light, other.
valuenumberYes—
unitstringYes—
recorded_atstringYesWhen the reading was taken, as an ISO 8601 timestamp.
notesstring | nullYes—
created_atstringYes—
Response
{
  "ok": true,
  "data": [
    {
      "id": "f1a7c3e9-2b4d-4f6a-8c0e-3d5b7a9c1e24",
      "device_id": "8e3b1f52-6c0d-4a7e-9b21-5f4d8c2a7e13",
      "team_id": "5d2e8b17-9c4a-4e3f-b6d0-1a7c9e2f4b83",
      "room_id": "2c6f9a41-7d3e-4b8a-a1c5-9e0d4f7b3a26",
      "type": "temperature",
      "value": 24.1,
      "unit": "°C",
      "recorded_at": "2026-09-25T14:00:00.000Z",
      "notes": null,
      "created_at": "2026-09-25T14:00:31.000Z"
    }
  ]
}

The envelope can also carry meta:

FieldTypeRequiredDescription
next_cursorstring | nullYesPass as cursor to fetch the next page. null means this is the last page.
Response headerMeaning
X-RateLimit-LimitThe request budget this answer reports on, per minute: your key's or device token's (1,000) or your workspace's (3,000), whichever has fewer requests left. Left out when the budget could not be read.
X-RateLimit-RemainingRequests left in that budget this minute, after this one. 0 on a 429. A workspace's other keys spend its budget too, so this can fall faster than your own requests alone would.
X-RateLimit-ResetWhole seconds until that budget's minute ends and it is full again. Never more than 60.
X-Request-IdIdentifies this request. Include it when you contact support.

Errors

StatusCodeWhen
401UNAUTHORIZEDThe key is missing, malformed or revoked, or its owner is no longer a member of the workspace.
402PAID_PLAN_REQUIREDThe workspace's plan does not include the API. The full API is included with xPlant+ Teams and Enterprise; on Hobby and Pro Lab, keys can connect devices only.
403FORBIDDENThe key lacks a scope this operation requires, or its owner's current role in the workspace cannot use it — a key never does more than its owner can in xPlant. error names the scope, and for a role, the role it needs.
403DEVICE_TOKEN_NOT_ACCEPTEDA device token was sent; this operation needs a workspace API key.
422VALIDATION_ERRORBoth cursor and offset were sent; use one.
422INVALID_CURSORThe cursor is malformed, or came from a different list or different filters. Start again without it.
422VALIDATION_ERRORA query parameter is malformed: device_id or room_id is not a UUID, since or until is not a timestamp, since is later than until, or limit is not a whole number. error names the parameter, for example device_id: must be a UUID.
429RATE_LIMIT_EXCEEDEDToo many requests for this key, device token or workspace. Wait Retry-After seconds.
500READINGS_QUERY_FAILEDThe readings could not be read. Retry later.

Branch on code, never on the error text. See Errors.

On this page