Getting Data

Getting Data

HEADERS:
Authorization: Your-Device-Token

GET - https://api.tago.io/data

QUERYSTRINGS:

KEY
TYPE
DESCRIPTION
variable
string || array
Get variables
querystringpre-defined by Tago
qtystringMaximum number of data to be returned. 
start_datestringStart date (E.g 1 day or ISO String)
end_datestring
End date (E.g 1 day or ISO String)
detailboolAdd more JSON fields on result
fields

  

Response - Below is the data returned without any parameters. https://api.tago.io/data

{
    "status" : true,
    "result": [
        {
            "id": "547e42847dbf3af122c02582",
            "location": {
                "coordinates": [
                    41.878876,
                    -87.635915
                ],
                "type": "Point"
            },
            "time": "2014-12-02T22:51:48.005Z",
            "variable": "location"
        }, {
            "id": "547e353d7dbf3af122c0257d",
            "time": "2014-12-02T21:55:09.301Z",
            "unit": "%",
            "value": 32,
            "variable": "fuel_level"
        },  {
            "id": "547e41f97dbf3af122c02580",
            "time": "2014-12-02T22:49:29.777Z",
            "unit": "psi",
            "value": 25,
            "variable": "oil_pressure"
        }
    ]
}

Variables

variable - using the parameter variable you define the variable that should be returned with the GET method.

For example, to get data with the variable = temperature, use: https://api.tago.io/data?variable=temperature.

Also, you can use an array to get more variables: https://api.tago.io/data?variable[]=temperature&variable[]=pressure

Query

query - the query parameter returns some predefined functions to help you to obtain certain processed data. Note that you can not use two queries concurrently.

last_item - It will return the last information from the data based in the 'time'.

For example: https://api.tago.io/data?variable=temperature&query=last_item

last_value - It will return the last information from the data based in the 'time'. Only the data containing ‘value’ information will be returned.

For example: https://api.tago.io/data?variable=temperature&query=last_value

last_location - It will return the last information from the data based in the 'time'. Only the data containing ‘location’ information will be returned.

For example: https://api.tago.io/data?variable=temperature&query=last_location

Quantity

qty - Limit the number of results that will be returned from a query. The default value is 15.

For example: https://api.tago.io/data?variable=temperature&qty=99

It will return the last 99 registers from temperature.

Start Date - End Date

start_date - Define the start time for the data search. Only the data containing ‘time’ information newer than start_date will be returned.

end_date - Define the end time for the data search. Only the data containing ‘time’ information older than end_date will be returned.

For example: https://api.tago.io/data?variable=temperature&start_date=2014-12-25&end_date=2014-12-26

It will return the data from the variable temperature between the start_date & end_date. The default it will return the last 15 items from the variable.

If your interval has more than 15 items, you need to add the attribute qty.

For example: https://api.tago.io/data?variable=temperature&start_date=2014-12-25&end_date=2014-12-26&qty=999
Start/End date parameters accept different formats, which include selection based on relative time (e.g. to get data from the last 1 hour). Below are some examples:

DATE FORMATS
“2014-12-25”
“2014-12-25 23:33:22”
“Thu Dec 25 2014 23:33:22 GMT+1300 (NZDT)”
“2014-12-25T23:33:22.000Z”
“1 day”
“1 month”
“1 year”

  • Relative dates will be subtracted or added to the current time.
When executing requests to TagoIO, you will have a limit on the number of requests that can be made during a certain time period. Read more about our Rate Limits.

    • Related Articles

    • Data Output Service

      One transaction of Data Output is counted for each register read from a device's data storage. Learn more about Getting Data. You need to define the Data Output limit per month for each Profile where your applications are running. Here is one ...
    • Getting Started

      Welcome to TagoIO! Here are some options for you to start with TagoIO. Option 1 - Follow the manual steps described below to start quickly. Option 2 - Use our SIMULATOR to start right away even without having a real IoT device in hand. Option 3 - Go ...
    • Data Export

      At TagoIO, you have multiple options for exporting data. You can export device data directly from the Admin panel on your device's page, through the API, or directly from Widgets in either the Admin panel or the TagoRun portal. Exporting data will ...
    • Deleting Data

      DEL - https://api.tago.io/data Headers: Authorization: Your device token. Optional Query Strings KEY TYPE DESCRIPTION query string pre-defined by Tago qty string Maximum number of data to be returned start_date string Start date end_date string end ...
    • Data Records

      Data Record is related to the variables that are stored and fed by the devices. Each register is composed of a variable and all metadata associated with it. The data record limit will define the maximum storage capacity for the selected Profile at ...