Skip to main content

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

ParameterTypeDescription
driver_idstring (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/api/tracking/location/{driver_id}
driver_id

Get Vehicle Location History

Retrieve historical tracking data for a vehicle.

GET /api/tracking/unit/{unit_id}/{days}

Path Parameters

ParameterTypeDescription
unit_idstring (UUID)The vehicle's unique identifier
daysintegerNumber 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/api/tracking/unit/{unit_id}/{days}
unit_id
days

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

ParameterTypeDescription
driver_idstring (UUID)The driver's unique identifier
datestringDate 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

FieldTypeDescription
idstring (UUID)Unique tracking point identifier
latfloatLatitude
longfloatLongitude
created_atstring (ISO 8601)Timestamp of the tracking point
created_timestring (ISO 8601)Timestamp of the tracking point
titlestringLabel (if any)
statestringUS state abbreviation
odometerfloatOdometer reading (miles)
eng_hoursfloatEngine hours
addressstringReverse-geocoded address
unit_idstring (UUID)The vehicle assigned to the driver at this point
speedintegerSpeed 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/api/tracking/driver/{driver_id}/{date}
driver_id
date

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

ParameterTypeDescription
driver_idstring (UUID)The driver's unique identifier

Query Parameters

ParameterTypeRequiredDescription
start_datestringYesStart date in YYYY-MM-DD format
end_datestringYesEnd date in YYYY-MM-DD format
pageintegerNoPage number (default: 1)
limitintegerNoItems per page (default: 1000, max: 5000)

Constraints

  • Maximum date range: 30 days
  • start_date must be on or before end_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

FieldTypeDescription
pageintegerCurrent page number
limitintegerItems per page
totalintegerTotal tracking points in the date range
total_pagesintegerTotal 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"
GET/api/tracking/driver/{driver_id}/range
driver_id
start_date*
end_date*
page
limit