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

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

**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 v2 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.

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

url = URI("https://api.gomotive.com/v2/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.

## Response Parameters

### id

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

### located\_at

* **Type**: String (ISO 8601 Date-Time)
* **Description**: The timestamp when the vehicle was located.

### lat

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

### lon

* **Type**: Number
* **Description**: The longitude coordinate 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 total engine hours at the time of location.

### type

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

### 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 odometer reading of the vehicle in miles at the time of location.

### fuel

* **Type**: Number
* **Description**: Denotes the lifetime fuel consumption of the vehicle.

### 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.

### oil\_life\_remaining\_percentage

* **Type**: Number
* **Description**:  This is the estimated percentage of the engine oil’s usable service life remaining—not the current oil quantity or oil-level percentage. It is derived from the vehicle’s **veh\_oil\_life\_remaining** signal.

### 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 vehicle gateway.

### identifier

* **Type**: String
* **Description**: The identifier of the vehicle gateway.

### model

* **Type**: String
* **Description**: The model of the vehicle gateway.

***

# 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": {
    "/v2/vehicle_locations/{id}": {
      "get": {
        "summary": "Fetch a vehicle's location using its ID (v2)",
        "description": "",
        "operationId": "fetch-a-vehicles-location-using-its-id-v2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Specify the unique identifier of the vehicle.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Specify the start date 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 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 the date after which the location records have been updated.",
            "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": {
                  "Result": {
                    "value": "{\n  \"vehicle_locations\": [\n    {\n      \"vehicle_location\": {\n        \"id\": \"d1671b6d-d2ba-49f4-b8c3-8d0782a50d44\",\n        \"located_at\": \"2016-05-24T09:01:11Z\",\n        \"lat\": 123,\n        \"lon\": 456,\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\t\t\t\t\"oil_life_remaining_percentage\": 76.0,\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}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "vehicle_locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vehicle_location": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "d1671b6d-d2ba-49f4-b8c3-8d0782a50d44"
                              },
                              "located_at": {
                                "type": "string",
                                "example": "2016-05-24T09:01:11Z"
                              },
                              "lat": {
                                "type": "integer",
                                "example": 123,
                                "default": 0
                              },
                              "lon": {
                                "type": "integer",
                                "example": 456,
                                "default": 0
                              },
                              "bearing": {
                                "type": "number",
                                "example": 2.24,
                                "default": 0
                              },
                              "battery_voltage": {
                                "type": "number",
                                "example": 12.5,
                                "default": 0
                              },
                              "engine_hours": {
                                "type": "number",
                                "example": 244.22,
                                "default": 0
                              },
                              "type": {
                                "type": "string",
                                "example": "breadcrumb"
                              },
                              "description": {
                                "type": "string",
                                "example": "6.2 mi N of San Francisco, CA"
                              },
                              "speed": {
                                "type": "number",
                                "example": 40.4,
                                "default": 0
                              },
                              "odometer": {
                                "type": "number",
                                "example": 5.58623553,
                                "default": 0
                              },
                              "fuel": {
                                "type": "number",
                                "example": 1.34645126,
                                "default": 0
                              },
                              "fuel_primary_remaining_percentage": {
                                "type": "number",
                                "example": 50.5,
                                "default": 0
                              },
                              "fuel_secondary_remaining_percentage": {
                                "type": "number",
                                "example": 90.5,
                                "default": 0
                              },
                              "oil_life_remaining_percentage": {
                                "type": "integer",
                                "example": 76,
                                "default": 0
                              },
                              "driver": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "integer",
                                    "example": 464394,
                                    "default": 0
                                  },
                                  "first_name": {
                                    "type": "string",
                                    "example": "John"
                                  },
                                  "last_name": {
                                    "type": "string",
                                    "example": "Doe"
                                  },
                                  "username": {
                                    "type": "string",
                                    "example": "john.doe"
                                  },
                                  "email": {},
                                  "driver_company_id": {
                                    "type": "string",
                                    "example": "kt002"
                                  },
                                  "status": {
                                    "type": "string",
                                    "example": "active"
                                  },
                                  "role": {
                                    "type": "string",
                                    "example": "driver"
                                  }
                                }
                              },
                              "eld_device": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "integer",
                                    "example": 7224,
                                    "default": 0
                                  },
                                  "identifier": {
                                    "type": "string",
                                    "example": "00012835"
                                  },
                                  "model": {
                                    "type": "string",
                                    "example": "lbb-2"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid vehicle ID": {
                    "value": "{\n    \"error_message\": \"vehicle_id is invalid\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error_message": {
                      "type": "string",
                      "example": "vehicle_id is invalid"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "66acf64a829e88001980fbf2:66bb7097cacd870010e21ef0"
}
```