On-demand Rides and Deliveries Solution is currently available only to select partners. Contact sales to learn more.

Method: providers.vehicles.search

Returns a list of vehicles that match the request options.

HTTP request

POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/vehicles:search

The URL uses gRPC Transcoding 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.

Request body

The request body contains data with the following structure:

JSON representation
{
  "header": {
    object (RequestHeader)
  },
  "pickupPoint": {
    object (TerminalLocation)
  },
  "dropoffPoint": {
    object (TerminalLocation)
  },
  "pickupRadiusMeters": integer,
  "count": integer,
  "minimumCapacity": integer,
  "tripTypes": [
    enum (TripType)
  ],
  "maximumStaleness": string,
  "vehicleTypes": [
    {
      object (VehicleType)
    }
  ],
  "requiredAttributes": [
    {
      object (VehicleAttribute)
    }
  ],
  "requiredOneOfAttributes": [
    {
      object (VehicleAttributeList)
    }
  ],
  "requiredOneOfAttributeSets": [
    {
      object (VehicleAttributeList)
    }
  ],
  "orderBy": enum (VehicleMatchOrder),
  "includeBackToBack": boolean,
  "tripId": string,
  "currentTripsPresent": enum (CurrentTripsPresent)
}
Fields
header

object (RequestHeader)

The standard Fleet Engine request header.

pickupPoint

object (TerminalLocation)

Required. The pickup point to search near.

dropoffPoint

object (TerminalLocation)

The customer's intended dropoff location. The field is required if tripTypes contains TripType.SHARED.

pickupRadiusMeters

integer

Required. Defines the vehicle search radius around the pickup point. Only vehicles within the search radius will be returned. Value must be between 400 and 10000 meters (inclusive).

count

integer

Required. Specifies the maximum number of vehicles to return. The value must be between 1 and 50 (inclusive).

minimumCapacity

integer

Required. Specifies the number of passengers being considered for a trip. The value must be greater than or equal to one. The driver is not considered in the capacity value.

tripTypes[]

enum (TripType)

Required. Represents the type of proposed trip. Eligible vehicles are those that can support at least one of the specified trip type.

EXCLUSIVE and SHARED may not be included together. SHARED is not supported when currentTripsPresent is CURRENT_TRIPS_PRESENT_UNSPECIFIED.

maximumStaleness

string (Duration format)

Restricts the search to only those vehicles that have updated their locations within the specified duration. If this field is not set, the server uses five minutes as the default value.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

vehicleTypes[]

object (VehicleType)

Required. Restricts the search to vehicles with one of the specified types. At least one vehicle type must be specified.

requiredAttributes[]

object (VehicleAttribute)

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 search to only those 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.

requiredOneOfAttributes[]

object (VehicleAttributeList)

Restricts the search to only those 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.

requiredOneOfAttributeSets[]

object (VehicleAttributeList)

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 search to only those vehicles with 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.

orderBy

enum (VehicleMatchOrder)

Required. Specifies the desired ordering criterion for results.

includeBackToBack

boolean

Indicates if a vehicle with a single active trip is eligible for another match. If false, vehicles with assigned trips are excluded from the search results. If true, search results include vehicles with TripStatus of ENROUTE_TO_DROPOFF.

This field is only considered if a single tripType of EXCLUSIVE is specified.

The default value is false.

tripId

string

Indicates the trip associated with this SearchVehicleRequest.

currentTripsPresent

enum (CurrentTripsPresent)

Restricts vehicles from appearing in the search results based on their current trips.

When currentTripsPresent is NONE or ANY, tripTypes can be either EXCLUSIVE or SHARED, but not both.

Response body

If successful, the response body contains an instance of SearchVehiclesResponse.