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

# List all the vehicles and their locations (v3)

This API is only meant for vehicles with the Motive Vehicle Gateway. For others, you may use the V1 or V2 API.

**Purpose**: Use this API to fetch a list of all the company vehicles, and their information such as assigned drivers, their location, fuel type, and etc. The response will list out all the vehicles of your company with the corresponding details.

> 📘 NOTE
>
> Use the query parameters only if you want to fetch the details of a particular vehicle and its corresponding info. Otherwise, ignore the parameters to fetch all the vehicle information of the company.
>
> To use the API with the query parameters, add the following to the endpoint: "?vehicle\_id={vehicle\_id}\&vehicle\_status={vehicle\_status}". Your endpoint with the query parameters will look like this: <https://api.gomotive.com/v1/vehicle_locations?vehicle_id={vehicle_id}&vehicle_status={vehicle_status}>

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

url = URI('https://api.gomotive.com/v3/vehicle_locations')

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

<br />

## Response Parameters

### vehicles

* **Type**: Array of Objects
* **Description**: A list of vehicle objects, each containing detailed information about an individual vehicle.

***

### vehicle

* **Type**: Object
* **Description**: Contains detailed information about a specific vehicle including identifiers, specs, and telemetry.

### id

* **Type**: Number
* **Description**: The unique identifier assigned to the vehicle.

### number

* **Type**: String
* **Description**: The name or number assigned to the vehicle.

### year

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

### make

* **Type**: String
* **Description**: The manufacturer or brand of the vehicle.

### model

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

### vin

* **Type**: String
* **Description**: The Vehicle Identification Number, a unique code used to identify the vehicle.

***

### aux\_status

* **Type**: Object
* **Description**: Contains the statuses of auxiliary equipment installed in the vehicle.

### AUX1 / AUX2

* **Type**: Object
* **Description**: Information about a specific auxiliary input.

### present

* **Type**: Boolean
* **Description**: Indicates if the auxiliary equipment is installed and present.

### start\_time

* **Type**: String (DateTime)
* **Description**: The timestamp when the auxiliary input was engaged.

### end\_time

* **Type**: String (DateTime)
* **Description**: The timestamp when the auxiliary input was disengaged.

### is\_engaged

* **Type**: Boolean
* **Description**: Indicates whether the auxiliary input is currently engaged.

### aux\_equipment\_type

* **Type**: String
* **Description**: Describes the type of auxiliary equipment, e.g., `PTO`, `Generators`.

***

### current\_location

* **Type**: Object
* **Description**: Contains real-time or last known location data of the vehicle.

### lat

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

### lon

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

### bearing

* **Type**: Number or null
* **Description**: The compass direction the vehicle is facing.

### located\_at

* **Type**: String (DateTime)
* **Description**: The timestamp of the most recent known location.

### city

* **Type**: String
* **Description**: City in which the vehicle is located.

### state

* **Type**: String
* **Description**: State in which the vehicle is located.

### rg\_km

* **Type**: Number
* **Description**: Distance from a geofence or region in kilometers.

### rg\_brg

* **Type**: Number
* **Description**: Bearing from a geofence or region in degrees.

### rg\_match

* **Type**: Boolean
* **Description**: Indicates whether the vehicle matched a geofence region.

### kph

* **Type**: Number
* **Description**: Current speed of the vehicle in kilometers per hour.

#### vehicle\_state

* **Type**: String
* **Description**: Indicates whether the vehicle is `on` or `off`.

### current\_location

* **Type**: String
* **Description**: Human-readable location address of the vehicle.

***

# 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": {
      "get": {
        "summary": "List all the vehicles and their locations (v3)",
        "description": "This API is only meant for vehicles with the Motive Vehicle Gateway. For others, you may use the V1 or V2 API.",
        "operationId": "fetch-a-list-of-all-the-vehicles-and-their-locations-v3",
        "parameters": [
          {
            "name": "vehicle_ids[]",
            "in": "query",
            "description": "Enter the id of the vehicle for which you want to check the location. NOTE: The endpoint has a limit of 100 vehicles for fetching their locations.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "vehicle_status",
            "in": "query",
            "description": "Enter the status of the vehicle whose location you want to check. The status can be \"active\", or \"deactivated\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of records to return per page.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "page_no",
            "in": "query",
            "description": "Denotes the current page number.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "include_aux_details",
            "in": "query",
            "description": "Specify if you want to include the auxiliary status in the response.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "X-Time-Zone",
            "in": "header",
            "description": "Time zone used to format timestamps.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Metric-Units",
            "in": "header",
            "description": "System of units to use to convert different metrics. true for metric units and false for imperial units.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "X-User-Id",
            "in": "header",
            "description": "ID of the Fleet Admin accessing the API.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Fetch a list of all the vehicles of the company": {
                    "value": "{\n  \"vehicles\": [\n    {\n      \"vehicle\": {\n        \"id\": 998707,\n        \"number\": \"Angela Mahoney\",\n        \"year\": \"2014\",\n        \"make\": \"Ford\",\n        \"model\": \"Fusion\",\n        \"vin\": \"3FA6P0H97ER281302\",\n        \"aux_status\": {\n          \"AUX1\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-10T14:22:25+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:19:53+00:00\",\n            \"aux_equipment_type\": \"PTO\"\n          },\n          \"AUX2\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-28T14:17:29+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:14:48+00:00\",\n            \"aux_equipment_type\": \"PANIC_BUTTON\"\n          }\n        },\n        \"current_location\": {\n          \"lat\": 27.4637528,\n          \"lon\": -82.5783576,\n          \"bearing\": null,\n          \"located_at\": \"2024-05-24T16:34:49Z\",\n          \"city\": \"South Bradenton\",\n          \"state\": \"FL\",\n          \"rg_km\": 0.3439441534173073,\n          \"rg_brg\": 79.0852179704791,\n          \"rg_match\": true,\n          \"kph\": 0,\n          \"vehicle_state\": \"off\",\n          \"current_location\": \"18th Street West, Bradenton, FL 34205\"\n        }\n      }\n    },\n    {\n      \"vehicle\": {\n        \"id\": 1276678,\n        \"number\": \"Stacy's Ford Expedition\",\n        \"year\": \"2014\",\n        \"make\": \"Ford\",\n        \"model\": \"Expedition\",\n        \"vin\": \"1FMJU1K55EEF12950\",\n        \"aux_status\": {\n          \"AUX1\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-10T14:22:25+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:19:53+00:00\",\n            \"aux_equipment_type\": \"PTO\"\n          },\n          \"AUX2\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-28T14:17:29+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:14:48+00:00\",\n            \"aux_equipment_type\": \"PANIC_BUTTON\"\n          }\n        },\n        \"current_location\": {\n          \"lat\": 32.7197753,\n          \"lon\": -97.1188622,\n          \"bearing\": 8.34971046,\n          \"located_at\": \"2024-08-12T12:46:57Z\",\n          \"city\": \"Arlington\",\n          \"state\": \"TX\",\n          \"rg_km\": 2.0372548828913417,\n          \"rg_brg\": 214.15815353886194,\n          \"rg_match\": true,\n          \"kph\": 0,\n          \"vehicle_state\": \"off\",\n          \"current_location\": \"818 Cedar Ln, Arlington, TX 76013\"\n        }\n      }\n    },\n    {\n      \"vehicle\": {\n        \"id\": 1466941,\n        \"number\": \"Taylor's Test Vehicle\",\n        \"year\": \"2001\",\n        \"make\": \"HONDA\",\n        \"model\": \"CR-V\",\n        \"vin\": \"JHLRD28441S040279\",\n        \"aux_status\": {\n          \"AUX1\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-10T14:22:25+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:19:53+00:00\",\n            \"aux_equipment_type\": \"PTO\"\n          },\n          \"AUX2\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-28T14:17:29+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:14:48+00:00\",\n            \"aux_equipment_type\": \"PANIC_BUTTON\"\n          }\n        },\n        \"current_location\": {\n          \"lat\": 42.2326462,\n          \"lon\": -71.5193855,\n          \"bearing\": null,\n          \"located_at\": \"2024-08-09T22:07:33Z\",\n          \"city\": \"Milford\",\n          \"state\": \"MA\",\n          \"rg_km\": 10.320731939157243,\n          \"rg_brg\": 358.09846511284456,\n          \"rg_match\": false,\n          \"kph\": 0,\n          \"vehicle_state\": \"off\",\n          \"current_location\": \"26 Walcott Valley Dr, Hopkinton, MA 01748\"\n        }\n      }\n    },\n    {\n      \"vehicle\": {\n        \"id\": 1712719,\n        \"number\": \"Yonathan's Highlander\",\n        \"year\": \"2014\",\n        \"make\": \"TOYOTA\",\n        \"model\": \"Highlander\",\n        \"vin\": \"5TDDKRFH8ES033670\",\n        \"aux_status\": {\n          \"AUX1\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-10T14:22:25+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:19:53+00:00\",\n            \"aux_equipment_type\": \"PTO\"\n          },\n          \"AUX2\": {\n            \"present\": true,\n            \"end_time\": \"2023-03-28T14:17:29+00:00\",\n            \"is_engaged\": false,\n            \"start_time\": \"2023-03-10T14:14:48+00:00\",\n            \"aux_equipment_type\": \"PANIC_BUTTON\"\n          }\n        },\n        \"current_location\": {\n          \"lat\": 34.7153382,\n          \"lon\": -118.162218,\n          \"bearing\": 139.479324,\n          \"located_at\": \"2024-08-10T02:17:50Z\",\n          \"city\": \"Lancaster\",\n          \"state\": \"CA\",\n          \"rg_km\": 3.2592834979265475,\n          \"rg_brg\": 344.24655775018283,\n          \"rg_match\": true,\n          \"kph\": 0,\n          \"vehicle_state\": \"off\",\n          \"current_location\": \"1741 W Avenue H 4, Lancaster, CA 93534\"\n        }\n      }\n    }\n  ],\n  \"pagination\": {\n    \"per_page\": 25,\n    \"page_no\": 1,\n    \"total\": 5\n  }\n}\n"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "vehicles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vehicle": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 998707,
                                "default": 0
                              },
                              "number": {
                                "type": "string",
                                "example": "Angela Mahoney"
                              },
                              "year": {
                                "type": "string",
                                "example": "2014"
                              },
                              "make": {
                                "type": "string",
                                "example": "Ford"
                              },
                              "model": {
                                "type": "string",
                                "example": "Fusion"
                              },
                              "vin": {
                                "type": "string",
                                "example": "3FA6P0H97ER281302"
                              },
                              "aux_status": {
                                "type": "object",
                                "properties": {
                                  "AUX1": {
                                    "type": "object",
                                    "properties": {
                                      "present": {
                                        "type": "boolean",
                                        "example": true,
                                        "default": true
                                      },
                                      "end_time": {
                                        "type": "string",
                                        "example": "2023-03-10T14:22:25+00:00"
                                      },
                                      "is_engaged": {
                                        "type": "boolean",
                                        "example": false,
                                        "default": true
                                      },
                                      "start_time": {
                                        "type": "string",
                                        "example": "2023-03-10T14:19:53+00:00"
                                      },
                                      "aux_equipment_type": {
                                        "type": "string",
                                        "example": "PTO"
                                      }
                                    }
                                  },
                                  "AUX2": {
                                    "type": "object",
                                    "properties": {
                                      "present": {
                                        "type": "boolean",
                                        "example": true,
                                        "default": true
                                      },
                                      "end_time": {
                                        "type": "string",
                                        "example": "2023-03-28T14:17:29+00:00"
                                      },
                                      "is_engaged": {
                                        "type": "boolean",
                                        "example": false,
                                        "default": true
                                      },
                                      "start_time": {
                                        "type": "string",
                                        "example": "2023-03-10T14:14:48+00:00"
                                      },
                                      "aux_equipment_type": {
                                        "type": "string",
                                        "example": "PANIC_BUTTON"
                                      }
                                    }
                                  }
                                }
                              },
                              "current_location": {
                                "type": "object",
                                "properties": {
                                  "lat": {
                                    "type": "number",
                                    "example": 27.4637528,
                                    "default": 0
                                  },
                                  "lon": {
                                    "type": "number",
                                    "example": -82.5783576,
                                    "default": 0
                                  },
                                  "bearing": {},
                                  "located_at": {
                                    "type": "string",
                                    "example": "2024-05-24T16:34:49Z"
                                  },
                                  "city": {
                                    "type": "string",
                                    "example": "South Bradenton"
                                  },
                                  "state": {
                                    "type": "string",
                                    "example": "FL"
                                  },
                                  "rg_km": {
                                    "type": "number",
                                    "example": 0.3439441534173073,
                                    "default": 0
                                  },
                                  "rg_brg": {
                                    "type": "number",
                                    "example": 79.0852179704791,
                                    "default": 0
                                  },
                                  "rg_match": {
                                    "type": "boolean",
                                    "example": true,
                                    "default": true
                                  },
                                  "kph": {
                                    "type": "integer",
                                    "example": 0,
                                    "default": 0
                                  },
                                  "vehicle_state": {
                                    "type": "string",
                                    "example": "off"
                                  },
                                  "current_location": {
                                    "type": "string",
                                    "example": "18th Street West, Bradenton, FL 34205"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "per_page": {
                          "type": "integer",
                          "example": 25,
                          "default": 0
                        },
                        "page_no": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "total": {
                          "type": "integer",
                          "example": 5,
                          "default": 0
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "66acf64a829e88001980fbf2:66ba543e3faeee001f044c02"
}
```