---
agentTools:
  projectIndex: https://developer-docs.gomotive.com/llms.txt
---

# Fetch a vehicle's location using its ID (v3)

**Purpose**: Use this API to fetch the location of a particular vehicle using its ID. You must also specify the date for which you want to check the information of the vehicle as a query parameter.

> 📘 NOTE
>
> This is the v3 of the "Fetch the location of a vehicle using its ID" endpoint. For this API, you must specify the following **Query Parameters**:
>
> * **start\_date**: Provide the start date from which you want to check the location history of the vehicle.
> * **end\_date**: Provide the end date for when you want to check the location history of the vehicle.\
>   **IMPORTANT**: The duration between the start date and the end date must not exceed 3 months.
> * **updated\_after**: Provide the date after which the location records have been updated.

```ruby Ruby (OAuth 2.0)
require 'uri'
require 'net/http'
require 'json'

url = URI("https://api.gomotive.com/v3/vehicle_locations/<id>?start_date=<yyyy-mm-dd>&end_date=<yyyy-mm-dd>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
response = http.request(request)
puts response.read_body
```

> 📘 NOTE
>
> This endpoint has a limit of 10 simultaneous requests at a time.

> 👍 ODOMETER vs TRUE ODOMETER
>
> Motive’s Vehicle Gateway captures virtual odometer readings from the vehicle. However, depending on the vehicle type (OBD-II or Non-OBD-II), these readings may vary in accuracy.\
> For precise odometer tracking, it is recommended to use the Motive Bulk Upload tool to input verified and accurate readings.
>
> So, when you pull the vehicle data, it will include the following parameters:
>
> * **odometer**: The virtual odometer readings captured by the Vehicle Gateway.
> * **true\_odometer**: The accurate odometer readings, after using the upload tool. These readings can be shared with third-party maintenance tools.
>
> **NOTE**: It is always recommended to pull the true\_odometer readings as these are more accurate. For a Non-OBD2 vehicle, the values of **odometer** and the **true\_odometer** will remain same.
>
> This logic applies to **engine\_hours** vs **true\_engine\_hours** as well.

## Response Parameters

### id

* **Type**: String
* **Description**: The unique identifier for the vehicle location.

### located\_at

* **Type**: String
* **Description**: The timestamp of when the vehicle was located.

### lat

* **Type**: Number
* **Description**: The latitude value of the vehicle's location.

### lon

* **Type**: Number
* **Description**: The longitude value of the vehicle's location.

### bearing

* **Type**: Number
* **Description**: The direction the vehicle is heading in degrees.

### battery\_voltage

* **Type**: Number
* **Description**: The voltage of the vehicle's battery at the time of location.

### engine\_hours

* **Type**: Number
* **Description**: The virtual engine hours at the time of location.

### type

* **Type**: String
* **Description**: The type of location data (e.g., "vehicle\_moving").

### description

* **Type**: String
* **Description**: A textual description of the vehicle's location.

### speed

* **Type**: Number
* **Description**: The speed of the vehicle at the time of location in miles per hour (mph).

### odometer

* **Type**: Number
* **Description**: The virtual odometer readings captured by the Vehicle Gateway.

### fuel

* **Type**: Number
* **Description**: The fuel level of the vehicle in gallons at the time of location.

### fuel\_primary\_remaining\_percentage

* **Type**: Number
* **Description**: The percentage of fuel remaining in the primary fuel tank.

### fuel\_secondary\_remaining\_percentage

* **Type**: Number
* **Description**: The percentage of fuel remaining in the secondary fuel tank.

### true\_odometer

* **Type**: Number
* **Description**: The accurate odometer readings that can be shared with third-party maintenance tools.

### true\_engine\_hours

* **Type**: Number
* **Description**: The accurate engine hour readings that can be shared with third-party maintenance tools.

### veh\_range

* **Type**: Number
* **Description**: The remaining range of the vehicle based on current fuel levels.

### hvb\_state\_of\_charge

* **Type**: Number
* **Description**: The state of charge of the High Voltage Battery (HVB) as a percentage.

### hvb\_charge\_status

* **Type**: Number
* **Description**: The charge status of the High Voltage Battery (HVB).

### hvb\_charge\_source

* **Type**: Number
* **Description**: The source of charge for the High Voltage Battery (HVB).

### hvb\_lifetime\_energy\_output

* **Type**: Number
* **Description**: The lifetime energy output of the High Voltage Battery (HVB).

### id

* **Type**: Number
* **Description**: The unique identifier for the driver.

### first\_name

* **Type**: String
* **Description**: The first name of the driver.

### last\_name

* **Type**: String
* **Description**: The last name of the driver.

### username

* **Type**: String
* **Description**: The username associated with the driver.

### email

* **Type**: String
* **Description**: The email address of the driver.

### driver\_company\_id

* **Type**: String
* **Description**: The company identifier associated with the driver.

### status

* **Type**: String
* **Description**: The status of the driver (e.g., "active").

### role

* **Type**: String
* **Description**: The role of the driver (e.g., "driver").

### id

* **Type**: Number
* **Description**: The unique identifier for the ELD device.

### identifier

* **Type**: String
* **Description**: The identifier of the ELD device.

### model

* **Type**: String
* **Description**: The model of the ELD device.

***

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Motive",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.gomotive.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v3/vehicle_locations/{id}": {
      "get": {
        "summary": "Fetch a vehicle's location using its ID (v3)",
        "description": "",
        "operationId": "fetch-a-vehicles-location-using-its-id-v3",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Specify the unique identifier of the vehicle.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Specify the start date (timestamp) from which you want to fetch the vehicle's location history.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "Provide the end date (timestamp) for when you want to check the location history of the vehicle.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Provide a date-time after which the location records have been updated. <b>Example</b>: updated_after=2025-03-19T19:43:00Z.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "X-Time-Zone",
            "in": "header",
            "description": "Specify the timezone for formatting the timestamps.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Metric-Units",
            "in": "header",
            "description": "Specify if you want to use the Metric units or the Imperial units. TRUE: Metric units. FALSE: Imperial Units",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "X-User-Id",
            "in": "header",
            "description": "Specify the ID of the Fleet Admin or the Fleet Manager who is accessing this endpoint.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Fetch a vehicle's location using its ID (v3)": {
                    "value": "   {\n  \"vehicle_locations\":[\n    {\n      \"vehicle_location\":{\n        \"id\":\"af5b6e0d-c442-414c-88d2-d95e5cb7affe\",\n        \"located_at\":\"2016-05-24T06:01:11Z\",\n        \"lat\":123.0,\n        \"lon\":456.0,\n        \"bearing\":1.24,\n        \"battery_voltage\": 14.0,\n        \"engine_hours\":234.22,\n        \"type\":\"vehicle_moving\",\n        \"description\":\"6.2 mi N of San Francisco, CA\",\n        \"speed\":50.1,\n        \"odometer\":7.58693991,\n        \"fuel\":2.96665156,\n        \"fuel_primary_remaining_percentage\": 50.5,\n        \"fuel_secondary_remaining_percentage\": 90.5,\n        \"true_odometer\":160.2742,\n        \"true_engine_hours\":38.5,\n        \"veh_range\": 10.1,\n        \"hvb_state_of_charge\": 20.2,\n        \"hvb_charge_status\": 0,\n        \"hvb_charge_source\": 1,\n        \"hvb_lifetime_energy_output\": 30.3,\n        \"driver\":{\n          \"id\":464394,\n          \"first_name\":\"John\",\n          \"last_name\":\"Doe\",\n          \"username\":\"john.doe\",\n          \"email\":null,\n          \"driver_company_id\":\"kt002\",\n          \"status\":\"active\",\n          \"role\":\"driver\"\n        },\n        \"eld_device\":{\n          \"id\":7224,\n          \"identifier\":\"00012835\",\n          \"model\":\"lbb-2\"\n        }\n      },\n      \"vehicle_location\":{\n        \"id\":\"d1671b6d-d2ba-49f4-b8c3-8d0782a50d44\",\n        \"located_at\":\"2016-05-24T09:01:11Z\",\n        \"lat\":123.0,\n        \"lon\":456.0,\n        \"bearing\":2.24,\n        \"battery_voltage\": 12.5,\n        \"engine_hours\":244.22,\n        \"type\":\"breadcrumb\",\n        \"description\":\"6.2 mi N of San Francisco, CA\",\n        \"speed\":40.4,\n        \"odometer\":5.58623553,\n        \"fuel\":1.34645126,\n        \"fuel_primary_remaining_percentage\": 50.5,\n        \"fuel_secondary_remaining_percentage\": 90.5,\n        \"true_odometer\":160.2742,\n        \"true_engine_hours\":38.5,\n        \"veh_range\": 10.1,\n        \"hvb_state_of_charge\": 20.2,\n        \"hvb_charge_status\": 0,\n        \"hvb_charge_source\": 1,\n        \"hvg_lifetime_energy_output\": 30.3\n        \"driver\":{\n          \"id\":464394,\n          \"first_name\":\"John\",\n          \"last_name\":\"Doe\",\n          \"username\":\"john.doe\",\n          \"email\":null,\n          \"driver_company_id\":\"kt002\",\n          \"status\":\"active\",\n          \"role\":\"driver\"\n        },\n        \"eld_device\":{\n          \"id\":7224,\n          \"identifier\":\"00012835\",\n          \"model\":\"lbb-2\"\n        }\n      }\n    }\n  ]\n}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "66acf64a829e88001980fbf2:66bba6599c5f5c0012e8feef"
}
```