Skip to content
Docs

Get Variable Data Series

Returns the recorded time series data for the specified variable. By default, the API returns data for the last 6 hours. You can also request data for a custom time range of up to 6 hours.

GET /rest/v1/workspaces/{workspace_uuid}/devices/{device_identifier}/variables/{variable_identifier}/data
HeaderValue
AuthorizationBearer <YOUR_API_KEY>
Content-Typeapplication/json
ParameterTypeRequiredDescription
workspace_uuidStringYesUnique identifier of the workspace.
device_identifierStringYesUnique identifier of the device within the workspace.
variable_identifierStringYesUnique identifier of the variable within the device.
ParameterTypeRequiredDescription
fromInteger (Unix ms)NoStart of the time range in Unix milliseconds. Must be provided together with to.
toInteger (Unix ms)NoEnd of the time range in Unix milliseconds. Must be provided together with from.
  • If neither from nor to is provided, the API returns data for the last 6 hours, ending at the current UTC time.
  • The from and to parameters must always be provided together.
  • The requested time range (to - from) cannot exceed 6 hours.
  • Future timestamps are not allowed.
  • The to timestamp must be greater than the from timestamp.
GET /rest/v1/workspaces/01KXYZ123456789/devices/PLANT/variables/CURRENT/data
Authorization: Bearer <YOUR_API_KEY>
GET /rest/v1/workspaces/01KXYZ123456789/devices/PLANT/variables/CURRENT/data?from=1783653843000&to=1783664643000
Authorization: Bearer <YOUR_API_KEY>

Status: 200 OK

{
"data": {
"size": 6,
"data_points": [
{ "t": 1784027551299, "v": 230.13978 },
{ "t": 1784027672208, "v": 48.96483 },
{ "t": 1784027794580, "v": 76.26026 },
{ "t": 1784027915526, "v": 138.98396 },
{ "t": 1784028036612, "v": 191.62514 },
{ "t": 1784028157462, "v": 224.28469 }
]
},
"meta": {
"message": "Variable data series fetched successfully",
"success": true
}
}
FieldDescription
data.sizeTotal number of data points returned.
data.data_pointsArray of recorded data points.
data.data_points[].tTimestamp of the recorded value in Unix milliseconds (UTC).
data.data_points[].vRecorded value at the specified timestamp. The value type depends on the variable’s data type (for example, Number, Boolean, or String).
HTTP StatusDescription
400 Bad RequestOne or more request parameters are invalid. This includes missing path parameters, providing only one of from or to, invalid timestamp formats, to earlier than from, a time range exceeding 6 hours, or future timestamps.
401 UnauthorizedAuthentication failed due to a missing or invalid API key.
404 Not FoundThe specified workspace, device, or variable could not be found.
500 Internal Server ErrorAn unexpected error occurred while retrieving the requested data.