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

KEYTYPEDESCRIPTION
variable || sstring || array
Get variablesquerystring

Query pre-defined by Tago
qty string: Maximum number of data to be returned
start_date string: Start date
end_date string: End date
detai bool: Add more JSON fields on result
fields
string || arrayFields to be returned

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 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 the array to get more variables: https://api.tago.io/data?variable[]=temperature&variable[]=pressure

Query

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

QUERYDESCRIPTIONmaxGet data with the highest valueminGet data with the lowest valuecountReturn the number of data located in the bucketlast_valueGet the last data with field value not emptylast_locationGet the last data with field location not emptylast_itemGet the last data, not checking if the fields location or value is empty

* Need additional parameters

Quantity

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

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.

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)”
“1 hour”
“1 day”
“1 month”
“1 year”

  • Relative dates will be subtracted or added to the current time.

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