# Method: providers.vehicles.list

- [HTTP request](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#body.request_body)
- [Response body](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#body.response_body)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#body.ListVehiclesResponse.SCHEMA_REPRESENTATION)
- [Viewport](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#Viewport)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#Viewport.SCHEMA_REPRESENTATION)

Returns a paginated list of vehicles associated with a provider that match the request options.

### HTTP request

`GET https://fleetengine.googleapis.com/v1/{parent=providers/*}/vehicles`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. Must be in the format `providers/{provider}`. The provider must be the Project ID (for example, `sample-cloud-project`) of the Google Cloud Project of which the service account making this call is a member. |

### Query parameters

| Parameters ||
|---|---|
| `header` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/RequestHeader`)`` The standard Fleet Engine request header. |
| `pageSize` | `integer` The maximum number of vehicles to return. Default value: 100. |
| `pageToken` | `string` The value of the `nextPageToken` provided by a previous call to `vehicles.list` so that you can paginate through groups of vehicles. The value is undefined if the filter criteria of the request is not the same as the filter criteria for the previous call to `vehicles.list`. |
| `minimumCapacity` | `integer` Specifies the required minimum capacity of the vehicle. All vehicles returned will have a `maximumCapacity` greater than or equal to this value. If set, must be greater or equal to 0. |
| `tripTypes[]` | ``enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripType`)`` Restricts the response to vehicles that support at least one of the specified trip types. |
| `maximumStaleness` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Restricts the response to vehicles that have sent location updates to Fleet Engine within the specified duration. Stationary vehicles still transmitting their locations are not considered stale. If present, must be a valid positive duration. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `vehicleTypeCategories[]` | ``enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#Category`)`` Required. Restricts the response to vehicles with one of the specified type categories. `UNKNOWN` is not allowed. |
| `requiredAttributes[]` | `string` Callers can form complex logical operations using any combination of the `requiredAttributes`, `requiredOneOfAttributes`, and `requiredOneOfAttributeSets` fields. `requiredAttributes` is a list; `requiredOneOfAttributes` uses a message which allows a list of lists. In combination, the two fields allow the composition of this expression: (requiredAttributes[0] AND requiredAttributes[1] AND ...) AND (requiredOneOfAttributes[0][0] OR requiredOneOfAttributes[0][1] OR ...) AND (requiredOneOfAttributes[1][0] OR requiredOneOfAttributes[1][1] OR ...) Restricts the response to vehicles with the specified attributes. This field is a conjunction/AND operation. A max of 50 requiredAttributes is allowed. This matches the maximum number of attributes allowed on a vehicle. Each repeated string should be of the format "key:value". |
| `requiredOneOfAttributes[]` | `string` Restricts the response to vehicles with at least one of the specified attributes in each `VehicleAttributeList`. Within each list, a vehicle must match at least one of the attributes. This field is an inclusive disjunction/OR operation in each `VehicleAttributeList` and a conjunction/AND operation across the collection of `VehicleAttributeList`. Each repeated string should be of the format "key1:value1\|key2:value2\|key3:value3". |
| `requiredOneOfAttributeSets[]` | `string` `requiredOneOfAttributeSets` provides additional functionality. Similar to `requiredOneOfAttributes`, `requiredOneOfAttributeSets` uses a message which allows a list of lists, allowing expressions such as this one: (requiredAttributes[0] AND requiredAttributes[1] AND ...) AND ( (requiredOneOfAttributeSets[0][0] AND requiredOneOfAttributeSets[0][1] AND ...) OR (requiredOneOfAttributeSets[1][0] AND requiredOneOfAttributeSets[1][1] AND ...) ) Restricts the response to vehicles that match all the attributes in a `VehicleAttributeList`. Within each list, a vehicle must match all of the attributes. This field is a conjunction/AND operation in each `VehicleAttributeList` and inclusive disjunction/OR operation across the collection of `VehicleAttributeList`. Each repeated string should be of the format "key1:value1\|key2:value2\|key3:value3". |
| `vehicleState` | ``enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#VehicleState`)`` Restricts the response to vehicles that have this vehicle state. |
| `onTripOnly` | `boolean` Only return the vehicles with current trip(s). |
| `filter` | `string` Optional. A filter query to apply when listing vehicles. See <http://aip.dev/160> for examples of the filter syntax. This field is designed to replace the `requiredAttributes`, `requiredOneOfAttributes`, and `required_one_of_attributes_sets` fields. If a non-empty value is specified here, the following fields must be empty: `requiredAttributes`, `requiredOneOfAttributes`, and `required_one_of_attributes_sets`. This filter functions as an AND clause with other constraints, such as `vehicleState` or `onTripOnly`. Note that the only queries supported are on vehicle attributes (for example, `attributes.<key> = <value>` or `attributes.<key1> = <value1> AND attributes.<key2> = <value2>`). The maximum number of restrictions allowed in a filter query is 50. Also, all attributes are stored as strings, so the only supported comparisons against attributes are string comparisons. In order to compare against number or boolean values, the values must be explicitly quoted to be treated as strings (for example, `attributes.<key> = "10"` or `attributes.<key> = "true"`). |
| `viewport` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/list#Viewport`)`` Optional. A filter that limits the vehicles returned to those whose last known location was in the rectangular area defined by the viewport. |

### Request body

The request body must be empty.

### Response body

`vehicles.list` response message.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "vehicles": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#Vehicle`) } ], "nextPageToken": string, "totalSize": string } ``` |

| Fields ||
|---|---|
| `vehicles[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#Vehicle`)`` Vehicles matching the criteria in the request. The maximum number of vehicles returned is determined by the `pageSize` field in the request. |
| `nextPageToken` | `string` Token to retrieve the next page of vehicles, or empty if there are no more vehicles that meet the request criteria. |
| `totalSize` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. Total number of vehicles matching the request criteria across all pages. |

## Viewport

A latitude-longitude viewport, represented as two diagonally opposite `low` and `high` points. A viewport is considered a closed region, i.e. it includes its boundary. The latitude bounds must range between -90 to 90 degrees inclusive, and the longitude bounds must range between -180 to 180 degrees inclusive. Various cases include:

- If `low` = `high`, the viewport consists of that single point.

- If `low.longitude` \> `high.longitude`, the longitude range is inverted (the viewport crosses the 180 degree longitude line).

- If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, the viewport includes all longitudes.

- If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, the longitude range is empty.

- If `low.latitude` \> `high.latitude`, the latitude range is empty.

Both `low` and `high` must be populated, and the represented box cannot be empty (as specified by the definitions above). An empty viewport will result in an error.

For example, this viewport fully encloses New York City:

{ "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }

| JSON representation |
|---|
| ``` { "low": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`) }, "high": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`) } } ``` |

| Fields ||
|---|---|
| `low` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`)`` Required. The low point of the viewport. |
| `high` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`)`` Required. The high point of the viewport. |