---
title: "Get vehicle trips"
method: GET
path: "/v1/fleet/trips"
tags: ["Trips"]
---

# Get vehicle trips

`GET /v1/fleet/trips`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/v1/fleet/trips`
- Auth: HTTP bearer

> 🚧 This endpoint is still on our legacy API.

Get historical trips data for specified vehicle. This method returns a set of historical trips data for the specified vehicle in the specified time range. 

 **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

To use this endpoint, select **Read Vehicle Trips** under the Vehicles category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

## Query parameters

- `vehicleId` integer, required
- `startMs` integer, required
- `endMs` integer, required

## Response `200`

List of trips taken by the requested vehicle within the specified timeframe. Ongoing trips will be returned with 9223372036854775807 as their endMs.

- V1TripResponse: Contains the trips for the vehicle in the requested timeframe. A trip is represented as an object that contains startMs, startLocation, startAddress, startCoordinates, endMs, endLocation, endAddress and endCoordinates. Ongoing trips will be returned with 9223372036854775807 as their endMs.
  - `trips` V1TripResponseTrips[]
    - `assetIds` integer[]: List of associated asset IDs
    - `codriverIds` integer[]: List of codriver IDs
    - `distanceMeters` integer: Length of the trip in meters. This value is calculated from the GPS data collected by the Samsara Vehicle Gateway.
    - `driverId` integer: ID of the driver.
    - `endAddress` V1TripResponseEndAddress: Text representation of nearest identifiable location to the end (latitude, longitude) coordinates.
      - `address` string: The formatted address
      - `id` number: The ID of the address
      - `name` string: The name of the address
    - `endCoordinates` V1TripResponseEndCoordinates: End (latitude, longitude) in decimal degrees.
      - `latitude` number, double
      - `longitude` number, double
    - `endLocation` string: Geocoded street address of start (latitude, longitude) coordinates.
    - `endMs` integer: End of the trip in UNIX milliseconds. Ongoing trips are indicated by an endMs value of 9223372036854775807.
    - `endOdometer` integer: Odometer reading (in meters) at the end of the trip. This is read from the vehicle's on-board diagnostics. If Samsara cannot read the vehicle's odometer values from on-board diagnostics, this value will be 0.
    - `fuelConsumedMl` integer: Amount in milliliters of fuel consumed on this trip.
    - `startAddress` V1TripResponseStartAddress: Text representation of nearest identifiable location to the start (latitude, longitude) coordinates.
      - `address` string: The formatted address
      - `id` number: The ID of the address
      - `name` string: The name of the address
    - `startCoordinates` V1TripResponseStartCoordinates: Start (latitude, longitude) in decimal degrees.
      - `latitude` number, double
      - `longitude` number, double
    - `startLocation` string: Geocoded street address of start (latitude, longitude) coordinates.
    - `startMs` integer: Beginning of the trip in UNIX milliseconds.
    - `startOdometer` integer: Odometer reading (in meters) at the beginning of the trip. This is read from the vehicle's on-board diagnostics. If Samsara cannot read the vehicle's odometer values from on-board diagnostics, this value will be 0.
    - `tollMeters` integer: Length in meters trip spent on toll roads.

## Other responses

- `default`: Unexpected error.

---

[API](https://skmtc.dev/samsara/apis/samsara-api.md) - [All operations](https://skmtc.dev/samsara/apis/samsara-api/llms.txt) - [OpenAPI document](https://skmtc.dev/samsara/apis/samsara-api/revisions/a9e35d4999be?raw)
