Get Data Series

This endpoint retrieves time-series data for one or more Variables.

Request

To retrieve time-series data for one or more Variables, make a POST request to the following URL:

HTTP MethodURL
POSThttps://industrial.api.ubidots.com/api/v2.0/data/series/

Query Parameters

ParameterTypeDefaultDescription
results_formatString"tabular"Format of each data point in the response. Options: tabular (arrays), object (named-key dicts)
results_dataBooleantrueWhen false, skips fetching time-series data and returns empty results arrays. Useful for validating variable existence and permissions without the cost of a data query
storageStringStorage tier to query. Options: hot, cold, auto. Optional

Body Parameters

ParameterTypeRequired?Description
startIntegerYesStart of the time range as a timestamp in milliseconds (epoch)
endIntegerYesEnd of the time range as a timestamp in milliseconds (epoch)
decimalPlacesIntegerNoNumber of decimal places for values (0–16). Defaults to the account setting
columnsString ArrayNoColumns to include. Options: timestamp, value, context, created_at
variablesObject ArrayYesList of variable references to query. Minimum 1 item. See Variables Array

Header

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
$ curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/data/series/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "start": 1700000000000,
    "end": 1700086400000,
    "decimalPlaces": 6,
    "columns": ["timestamp", "value", "context", "created_at"],
    "variables": [
        {
            "variable": "64a1b2c3d4e5f6a7b8c9d0e1"
        },
        {
            "variable": "~temperature",
            "device": "~my-device"
        }
    ]
}'
{
    "start": 1700000000000,
    "end": 1700086400000,
    "results": [
        {
            "device": {
                "id": "6e309da44fc8455a9cceb5aa",
                "label": "first-device",
                "name": "First Device",
                "createdAt": "2023-11-01T00:00:00.000000Z"
            },
            "variable": {
                "id": "64a1b2c3d4e5f6a7b8c9d0e1",
                "label": "temperature",
                "name": "Temperature",
                "createdAt": "2023-11-01T00:00:00.000000Z"
            },
            "code": 200,
            "columns": ["timestamp", "value", "context", "created_at"],
            "results": [
                [1700000100000, 23.5, {}, 1700000100001]
            ]
        }
    ]
}
{
    "start": 1700000000000,
    "end": 1700086400000,
    "results": [
        {
            "variable": {
                "id": "nonexistent_id"
            },
            "code": 404,
            "message": "Variable or Device not found"
        }
    ]
}
{
    "start": 1700000000000,
    "end": 1700086400000,
    "results": [
        {
            "variable": {
                "id": "64a1b2c3d4e5f6a7b8c9d0e1"
            },
            "code": 403,
            "message": "No permissions on this variable"
        }
    ]
}
{
    "detail": "Authentication credentials were not provided."
}

Response

Returns an object with start, end, and results. Each item in results corresponds to one requested variable and contains its own code, allowing a single request to partially succeed — some variables may return 200 while others return 403 or 404.

Successful entry fields:

FieldDescription
deviceObject with id, label, name, and createdAt of the Device
variableObject with id, label, name, and createdAt of the Variable
code200 on success
columnsThe columns included in each data point (omitted when results_format=object)
resultsArray of data points. Empty array when results_data=false

Data point format:

  • results_format=tabular (default) — each data point is an array matching the order of columns. Example: [1700000100000, 23.5, {}, 1700000100001]
  • results_format=object — each data point is an object with named keys. Example: {"timestamp": 1700000100000, "value": 23.5, "context": {}, "created_at": 1700000100001}. The columns field is omitted from the entry.

When results_data=false: The response structure is identical but all results arrays are empty. Use this to validate variable existence and permissions without fetching historical data.

Error entries (per variable):

CodeCause
404Variable or Device not found
403No permissions on the variable