Trips

Get vehicle trips

🚧 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>

get/v1/fleet/trips

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Query parameters

vehicleIdinteger required

Vehicle ID to query.

startMsinteger required

Beginning of the time range, specified in milliseconds UNIX time. Limited to a 90 day window with respect to startMs and endMs

endMsinteger required

End of the time range, specified in milliseconds UNIX time.

Response

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

Example response

{
  "trips": [
    {
      "assetIds": [
        122
      ],
      "codriverIds": [
        122
      ],
      "distanceMeters": 2500,
      "driverId": 719,
      "endAddress": {
        "address": "123 Main St, Sunnyvale, CA 94089",
        "id": 581,
        "name": "Ramen Tatsunoya"
      },
      "endCoordinates": {
        "latitude": 23.413702345,
        "longitude": -91.502888123
      },
      "endLocation": "571 S Lake Ave, Pasadena, CA 91101",
      "endMs": 1462881998034,
      "endOdometer": 210430500,
      "fuelConsumedMl": 75700,
      "startAddress": {
        "address": "123 Main St, Sunnyvale, CA 94089",
        "id": 581,
        "name": "Ramen Tatsunoya"
      },
      "startCoordinates": {
        "latitude": 29.443702345,
        "longitude": -98.502888123
      },
      "startLocation": "16 N Fair Oaks Ave, Pasadena, CA 91103",
      "startMs": 1462878398034,
      "startOdometer": 210430450,
      "tollMeters": 32000
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.