Skip to content

Get device points

GET
/devices/id/points

Gets one or more points for a device, based on filtering.

Parameters

Path Parameters

id*

device id

Typenumber
Required
formatinteger

Query Parameters

filter

JSON Filter object

Typestring
Example{"limit":10,"order":["timestamp DESC"]}{"where":{"between":["2024-12-01T00:00:00.000Z","2024-12-01T23:59:59.999Z"]},"order":["timestamp DESC"]}
formatJSON

Responses

Request was successful
application/json
JSON
[
{
"location": {
"lat": 0,
"lng": 0
},
"timestamp": "string",
"speed": 0,
"altitude": 0,
"course": 0,
"num_value": "string",
"stringValue": "string",
"sendReason": 0,
"sats": 0,
"hdop": 0,
"accuracy": 0,
"locationType": "string",
"batteryVoltage": 0,
"batteryPct": 0,
"averageCharge": 0,
"created": "string",
"address": "string",
"alertType": 0,
"currentUsed": 0,
"gsmSignal": 0,
"correlationId": "string",
"id": 0,
"deviceId": 0
}
]

Samples

cURL
curl -X GET \
'https://api.lightbug.cloud/api/devices/id/points?filter=%7B%22limit%22%3A10%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D%2C%7B%22where%22%3A%7B%22between%22%3A%5B%222024-12-01T00%3A00%3A00.000Z%22%2C%222024-12-01T23%3A59%3A59.999Z%22%5D%7D%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.lightbug.cloud/api/devices/id/points?filter=%7B%22limit%22%3A10%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D%2C%7B%22where%22%3A%7B%22between%22%3A%5B%222024-12-01T00%3A00%3A00.000Z%22%2C%222024-12-01T23%3A59%3A59.999Z%22%5D%7D%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://api.lightbug.cloud/api/devices/id/points';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];
$query = http_build_query([
    'filter' => '{"limit":10,"order":["timestamp DESC"]},{"where":{"between":["2024-12-01T00:00:00.000Z","2024-12-01T23:59:59.999Z"]},"order":["timestamp DESC"]}',
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://api.lightbug.cloud/api/devices/id/points'
params = {
    'filter': [
        '{\'limit\':10,\'order\':[\'timestamp DESC\']}',
        '{\'where\':{\'between\':[\'2024-12-01T00:00:00.000Z\',\'2024-12-01T23:59:59.999Z\']},\'order\':[\'timestamp DESC\']}'
    ]
}
headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, params=params, headers=headers)
print(response.json())