---
title: "Historical locations"
method: GET
path: "/fleet/vehicles/locations/history"
tags: ["Vehicle Locations"]
---

# Historical locations

`GET /fleet/vehicles/locations/history`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/fleet/vehicles/locations/history`
- Auth: HTTP bearer

***NOTE: The Vehicle Locations API is an older API that does not combine GPS data with onboard diagnostics. Try our new [Vehicle Stats API](ref:getvehiclestatshistory) instead.***

Returns all known vehicle locations during the given time range. This can be optionally filtered by tags or specific vehicle IDs.

Related guide: <a href="/docs/vehicle-locations-1" target="_blank">Vehicle Locations</a>. 

 **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 Statistics** under the Vehicle 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

- `after` string
- `startTime` string, required
- `endTime` string, required
- `parentTagIds` string[]
- `tagIds` string[]
- `vehicleIds` string[]

## Response `200`

List of all locations for the specified vehicles and time range.

- VehicleLocationsListResponse: List of vehicle location events and pagination info.
  - `data` VehicleLocationsListResponseData[], required: A list of vehicles and an array of location events for each vehicle.
    - `id` string, required: The unique Samsara ID of the Vehicle. This is automatically generated when the Vehicle object is created. It cannot be changed.
    - `locations` VehicleLocation[], required: A list of location events for the given vehicle.
      - `heading` number, double: Heading of the vehicle in degrees.
      - `latitude` number, double, required: GPS latitude represented in degrees
      - `longitude` number, double, required: GPS longitude represented in degrees
      - `reverseGeo` ReverseGeo: Reverse geocoded information.
        - `formattedLocation` string: Formatted address of the reverse geocoding data.
      - `speed` number, double: GPS speed of the vehicle in miles per hour. See `isEcuSpeed` to determine speed data source.
      - `time` string, required: UTC timestamp in RFC 3339 format. Example: `2020-01-27T07:06:25Z`.
    - `name` string, required: The human-readable name of the Vehicle. This is set by a fleet administrator and will appear in both Samsara’s cloud dashboard as well as the Samsara Driver mobile app. **By default**, this name is the serial number of the Samsara Vehicle Gateway. It can be set or updated through the Samsara Dashboard or through the API at any time.
  - `pagination` PaginationResponse, required: Pagination parameters.
    - `endCursor` string, string, required: Cursor identifier representing the last element in the response. This value should be used in conjunction with a subsequent request's 'after' query parameter. This may be an empty string if there are no more pages left to view.
    - `hasNextPage` boolean, required: True if there are more pages of results immediately available after this endCursor.

## Other responses

- `default`: Error response

---

[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)
