Skip to main content
GET
/
device
/
{device_id}
/
trip
Trips
curl --request GET \
  --url https://api.pathstack.io/device/{device_id}/trip \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "start_latitude": 123,
      "start_longitude": 123,
      "end_latitude": 123,
      "end_longitude": 123,
      "system_trip_id": "<string>",
      "start_time": "<string>",
      "end_time": "<string>",
      "distance_metres": 123,
      "duration_seconds": 123,
      "driving_seconds": 123,
      "idling_seconds": 123,
      "auxiliary_seconds": 123,
      "is_valid": true,
      "validation_comments": "<string>",
      "id": "<string>",
      "device_id": "<string>"
    }
  ],
  "links": {
    "previous": "<string>",
    "current": "<string>",
    "next": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string<date>
default:2024-03-26

Path Parameters

device_id
string<uuid>
required

Device ID of the Trips to be returned

Query Parameters

start_time_utc
string<date-time>

Start time from when the data will be returned. Trips with end time >= start time will be returned

end_time_utc
string<date-time>

End time from when the data will be returned. Trips with end time <= specified end time will be returned

verify_data_collection
boolean
default:0

Verify data collection status, If true, checks data collection jobs for the time period and fails with a 424 status if any jobs have failed or are still running.

verify_trip_validity
boolean
default:true

Pathstack determines the validity of a trip during data collection. A trip can be deemed invalid if it has incorrect or incomplete data. Pathstack sets the validity of the trip via the field is_valid along with comments on the reason in validation comments

page
integer
default:0

Page number for pagination (zero-indexed)

Required range: x >= 0

Response

Successful Response

data
Trip · object[]
required

Successful response payload