Tracking API
Real-time and historical vehicle tracking.
Get Driver Location
Get the current location of a driver.
GET /api/tracking/location/{driver_id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| driver_id | string (UUID) | The driver's unique identifier |
Response
{
"driver_id": "550e8400-e29b-41d4-a716-446655440000",
"location": {
"lat": 34.0522,
"long": -118.2437,
"address": "I-10 W, Los Angeles, CA 90015",
"state": "CA"
},
"speed": 62,
"heading": 270,
"updated_at": "2025-11-20T14:30:00Z"
}
Get Vehicle Location History
Retrieve historical tracking data for a vehicle.
GET /api/tracking/unit/{unit_id}/{days}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| unit_id | string (UUID) | The vehicle's unique identifier |
| days | integer | Number of days of history (max 7) |
Response
{
"unit_id": "660e8400-e29b-41d4-a716-446655440001",
"points": [
{
"lat": 34.0522,
"long": -118.2437,
"speed": 55,
"heading": 90,
"timestamp": "2025-11-20T10:00:00Z"
},
{
"lat": 34.0530,
"long": -118.2200,
"speed": 60,
"heading": 90,
"timestamp": "2025-11-20T10:05:00Z"
}
]
}
Get Driver Route History
Get the route history for a specific driver on a specific date. Returns all tracking points and stops for that day.
GET /api/tracking/driver/{driver_id}/{date}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| driver_id | string (UUID) | The driver's unique identifier |
| date | string | Date in YYYY-MM-DD format |
Response
{
"trackings": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lat": 34.0522,
"long": -118.2437,
"created_at": "2025-11-20T10:00:00Z",
"created_time": "2025-11-20T10:00:00Z",
"title": "",
"state": "CA",
"odometer": 123456.0,
"eng_hours": 5432.1,
"address": "I-10 W, Los Angeles, CA 90015",
"unit_id": "660e8400-e29b-41d4-a716-446655440001",
"speed": 62
}
],
"stops": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"lat": 34.0530,
"long": -118.2200,
"start_time": "2025-11-20T12:00:00Z",
"end_time": "2025-11-20T12:30:00Z",
"duration": 1800,
"address": "456 Elm St, Los Angeles, CA 90012"
}
]
}
Tracking Point Fields
| Field | Type | Description |
|---|---|---|
| id | string (UUID) | Unique tracking point identifier |
| lat | float | Latitude |
| long | float | Longitude |
| created_at | string (ISO 8601) | Timestamp of the tracking point |
| created_time | string (ISO 8601) | Timestamp of the tracking point |
| title | string | Label (if any) |
| state | string | US state abbreviation |
| odometer | float | Odometer reading (miles) |
| eng_hours | float | Engine hours |
| address | string | Reverse-geocoded address |
| unit_id | string (UUID) | The vehicle assigned to the driver at this point |
| speed | integer | Speed in mph |
Example
curl -X GET "https://api-gateway.motioneld.com/api/tracking/driver/550e8400-e29b-41d4-a716-446655440000/2025-11-20" \
-H "X-API-Key: YOUR_API_KEY"
Get Driver Route History (Date Range)
Get the route history for a specific driver across a date range with pagination. This is useful for historical backfills without needing to make a separate API call for each day.
GET /api/tracking/driver/{driver_id}/range?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| driver_id | string (UUID) | The driver's unique identifier |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| start_date | string | Yes | Start date in YYYY-MM-DD format |
| end_date | string | Yes | End date in YYYY-MM-DD format |
| page | integer | No | Page number (default: 1) |
| limit | integer | No | Items per page (default: 1000, max: 5000) |
Constraints
- Maximum date range: 30 days
start_datemust be on or beforeend_date- Default page size is 1000 tracking points (not 10 like other endpoints) due to the high volume of GPS data
Response
{
"trackings": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lat": 34.0522,
"long": -118.2437,
"created_at": "2025-11-20T10:00:00Z",
"created_time": "2025-11-20T10:00:00Z",
"title": "",
"state": "CA",
"odometer": 123456.0,
"eng_hours": 5432.1,
"address": "I-10 W, Los Angeles, CA 90015",
"unit_id": "660e8400-e29b-41d4-a716-446655440001",
"speed": 62
}
],
"stops": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"lat": 34.0530,
"long": -118.2200,
"start_time": "2025-11-20T12:00:00Z",
"end_time": "2025-11-20T12:30:00Z",
"duration": 1800,
"address": "456 Elm St, Los Angeles, CA 90012"
}
],
"pagination": {
"page": 1,
"limit": 1000,
"total": 4523,
"total_pages": 5
}
}
Pagination Metadata
| Field | Type | Description |
|---|---|---|
| page | integer | Current page number |
| limit | integer | Items per page |
| total | integer | Total tracking points in the date range |
| total_pages | integer | Total number of pages |
tip
Stops are always returned in full for the requested date range and are not paginated — only tracking points are paginated.
Example
Fetch the first page of tracking data for a 7-day range:
curl -X GET "https://api-gateway.motioneld.com/api/tracking/driver/550e8400-e29b-41d4-a716-446655440000/range?start_date=2025-11-14&end_date=2025-11-20&page=1&limit=1000" \
-H "X-API-Key: YOUR_API_KEY"
Fetch the next page:
curl -X GET "https://api-gateway.motioneld.com/api/tracking/driver/550e8400-e29b-41d4-a716-446655440000/range?start_date=2025-11-14&end_date=2025-11-20&page=2&limit=1000" \
-H "X-API-Key: YOUR_API_KEY"