Location Tracking
Access real-time and historical location data for your devices
Retrieve current and historical location data for any tracked device.
Get current location
Returns the most recent location for a device.
/trackables/{trackableId}/locationsGet current location for your device. Sign in to auto-populate your trackable ID.
Path Parameters
Response
{
"locations": [
{
"id": "loc_abc123",
"trackableId": "trk_xyz789",
"name": "Delivery Van #3",
"latitude": 37.7749,
"longitude": -122.4194,
"timestamp": "2024-01-15T10:30:00Z",
"horizontalAccuracy": 10.0,
"batteryLevel": 1
}
]
}Response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique location record ID |
trackableId | string | Device identifier |
name | string | Device name from Find My |
latitude | number | Latitude coordinate |
longitude | number | Longitude coordinate |
timestamp | string | ISO 8601 UTC timestamp |
horizontalAccuracy | number | Accuracy in meters |
batteryLevel | number | 0=full, 1=medium, 2=low, 3=critical |
isInaccurate | boolean | true if location may be imprecise |
Tip
Lower horizontalAccuracy values mean more precise locations. Values under 20m are typically reliable.
Get location history
Retrieve historical locations within a time range.
Query parameters
| Parameter | Type | Description |
|---|---|---|
start_time | string | Start of range (ISO 8601) |
end_time | string | End of range (ISO 8601) |
limit | number | Max results (default: 50) |
skip | number | Results to skip for pagination |
Example
curl -X GET "https://api.airpinpoint.com/v1/trackables/trk_xyz789/locations?start_time=2024-01-14T00:00:00Z&end_time=2024-01-15T23:59:59Z&limit=100" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"locations": [
{
"id": "loc_001",
"trackableId": "trk_xyz789",
"latitude": 37.7749,
"longitude": -122.4194,
"timestamp": "2024-01-15T16:00:00Z",
"horizontalAccuracy": 10.0,
"batteryLevel": 1
},
{
"id": "loc_002",
"trackableId": "trk_xyz789",
"latitude": 37.7748,
"longitude": -122.4192,
"timestamp": "2024-01-15T15:30:00Z",
"horizontalAccuracy": 15.0,
"batteryLevel": 1
}
],
"total": 2
}Timestamps
All timestamps use ISO 8601 UTC format:
2024-01-15T10:30:00Z
Note
Store timestamps as-is in your database. Convert to local time only when displaying to users.
Polling strategies
Location updates depend on your plan's refresh rate:
| Plan | Refresh Rate | Best Practice |
|---|---|---|
| Business | 1 minute | Poll every 1min, geofence alerts included |
| Enterprise | 1 minute | Poll every 1min, or use webhooks |
Warning
Polling too frequently won't give you more data and may hit rate limits. Match your polling interval to your plan's refresh rate.