Data raw series

Use this endpoint to retrieve raw data from one or multiple variables within a time range

To retrieve raw data from one or multiple variables within a time range, send a POST request to the following URL:

HTTP MethodURL
POSThttps://industrial.api.ubidots.com/api/v1.6/data/raw/series

Headers

The "X-Auth-Token" and "Content-Type" headers are required in your request:

HeaderValueRequired?Description
X-Auth-TokenTokenYesAccount authentication token.
Content-Typeapplication/jsonYesThe request body data type.

Body

An object containing the following key parameters:

ParameterTypeRequired?Description
variablesString ArrayYesAn array of variable IDs
columnsString ArrayYesInformation columns to retrieve from each variable.
See the note below for a detailed explanation.
join_dataframesBooleanNotrue: returns an array. Each element is an array containing the values for the period.
false: [Default] returns an array where each element is a separate time series per variable.
startNumberNoInitial timestamp in POSIX milliseconds format (inclusive).
endNumberNoFinal timestamp in POSIX milliseconds format (inclusive).
limitNumberNoLimits the number of returned values.
tzstringNoThe time zone in which the timestamps provided in the request are interpreted.
precisionintegerNoThe number of decimal places to use for data aggregation.
{
  "variables": ["618848b4b09758ded46bafda", ···, "618848b7b31be1cb509c0a3c"],
  "columns": ["value.value", "timestamp"],
  "join_dataframes": false,
  "start": 1636321611000,
  "end": 1636321629000,
  "limit": 3,
  "tz" : "America/New_York",
  "precision" : 2
}
📘

Columns parameter

Options are:

  • value.value
  • variable.id
  • variable.label
  • value.context
  • variable.name
  • variable.properties.color
  • device.name
  • device.label
  • timestamp
📘

Optional parameters

  • If neither start nor end is included, the request uses the last 100 values of each variable.
  • If only start is sent, the request includes values from that timestamp up until the last value in the time series, even if it is in the future.
  • If only end is sent, the request includes values from the beginning of data reception up until that timestamp.
  • If the precision key is not defined, decimal numbers are displayed according to the calculation.

Query Parameters

You can add optional parameters to the URL of your request:

ParameterTypeDescription
tokenStringThe token to authenticate the request.
Although sending it as a query parameter is supported, we strongly recommend using the X-Auth-Token header.

Examples

Get raw data from multiple variables:
Get 1 hour of raw data from multiple variables.

$ curl -X POST 'https://industrial.api.ubidots.com/api/v1.6/data/raw/series' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
  "variables": ["618848b4b09758ded46bafda", "618848b7b31be1cb509c0a3c"],
  "columns": ["value.value", "timestamp"],
  "join_dataframes": false,
  "start": 1636318800000,
  "end": 1636322400000,
  "tz" : "America/New_York",
  "precision" : 2
}'
{
  "results": [
    [
      [
        62982.21,
        1636322400000
      ],
      [
        62983.08,
        1636321200000
      ],
      [
        63038.95,
        1636320000000
      ],
      [
        62796.23,
        1636318800000
      ]
    ],
    [
      [
        62850.38,
        1636322101553
      ],
      [
        62883.23,
        1636321804316
      ],
      [
        62870.37,
        1636321503773
      ],
      [
        62983.08,
        1636321204195
      ],
      [
        63038.95,
        1636320901873
      ],
      [
        62954.97,
        1636320604142
      ],
      [
        62889.53,
        1636320302570
      ],
      [
        62804.11,
        1636320003317
      ],
      [
        62796.23,
        1636319701865
      ],
      [
        62773.11,
        1636319402894
      ],
      [
        62752.71,
        1636319101710
      ],
      [
        62704.72,
        1636318807253
      ]
    ]
  ],
  "columns": [
    [
      "5b17df86642ab66a5f6037d8.value.value",
      "timestamp"
    ],
    [
      "5ae73c56bbddbd669ed87e0a.value.value",
      "timestamp"
    ]
  ]
}
{
  "detail": "JSON parse error - Expecting value: line 4 column 22 (char 121)"
}
{
  "code": 401001,
  "message": "Authentication credentials were not provided."
}

Get the last 3 values from multiple variables:
Get the last 3 values for multiple variables.

$ curl -X POST 'https://industrial.api.ubidots.com/api/v1.6/data/raw/series' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
  "variables": ["618848b4b09758ded46bafda", "618848b7b31be1cb509c0a3c"],
  "columns": ["value.value", "timestamp"],
  "join_dataframes": false,
  "limit": 3,
  "tz" : "America/New_York",
  "precision" : 2
}'
{
  "results": [
    [
      [
        62982.21,
        1636322400000
      ],
      [
        62983.08,
        1636321200000
      ],
      [
        63038.95,
        1636320000000
      ]
    ],
    [
      [
        62850.38,
        1636322101553
      ],
      [
        62883.23,
        1636321804316
      ],
      [
        62870.37,
        1636321503773
      ]
    ]
  ],
  "columns": [
    [
      "5b17df86642ab66a5f6037d8.value.value",
      "timestamp"
    ],
    [
      "5ae73c56bbddbd669ed87e0a.value.value",
      "timestamp"
    ]
  ]
}
{
  "detail": "JSON parse error - Expecting value: line 4 column 22 (char 121)"
}
{
  "code": 401001,
  "message": "Authentication credentials were not provided."
}