- HTTP request
- Path parameters
- Request body
- Response body
- VehicleAttributeList
- VehicleMatchOrder
- CurrentTripsPresent
- VehicleMatch
- Waypoint
- VehicleMatchType
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 |
Required. Must be in the format |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "header": { object ( |
Fields | |
---|---|
header |
The standard Fleet Engine request header. |
pickup |
Required. The pickup point to search near. |
dropoff |
The customer's intended dropoff location. The field is required if |
pickup |
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 |
Required. Specifies the maximum number of vehicles to return. The value must be between 1 and 50 (inclusive). |
minimum |
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. |
trip |
Required. Represents the type of proposed trip. Must include exactly one type. |
maximum |
Restricts the search to only those vehicles that have sent location updates to Fleet Engine within the specified duration. Stationary vehicles still transmitting their locations are not considered stale. 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 ' |
vehicle |
Required. Restricts the search to vehicles with one of the specified types. At least one vehicle type must be specified. VehicleTypes with a category of |
required |
Callers can form complex logical operations using any combination of the
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. |
required |
Restricts the search to only those vehicles with at least one of the specified attributes in each |
required |
Similar to
Restricts the search to only those vehicles with all the attributes in a |
order |
Required. Specifies the desired ordering criterion for results. |
include |
This indicates if vehicles with a single active trip are eligible for this search. This field is only used when The default value is |
trip |
Indicates the trip associated with this |
current |
This indicates if vehicles with active trips are eligible for this search. This must be set to something other than |
filter |
Optional. A filter query to apply when searching vehicles. See http://aip.dev/160 for examples of the filter syntax. This field is designed to replace the This filter functions as an AND clause with other constraints, such as Note that the only queries supported are on vehicle attributes (for example, 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, |
Response body
vehicles.search
response message.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"matches": [
{
object ( |
Fields | |
---|---|
matches[] |
List of vehicles that match the |
VehicleAttributeList
A list-of-lists datatype for vehicle attributes.
JSON representation |
---|
{
"attributes": [
{
object ( |
Fields | |
---|---|
attributes[] |
A list of attributes in this collection. |
VehicleMatchOrder
Specifies the order of the vehicle matches in the response.
Enums | |
---|---|
UNKNOWN_VEHICLE_MATCH_ORDER |
Default, used for unspecified or unrecognized vehicle matches order. |
PICKUP_POINT_ETA |
Ascending order by vehicle driving time to the pickup point. |
PICKUP_POINT_DISTANCE |
Ascending order by vehicle driving distance to the pickup point. |
DROPOFF_POINT_ETA |
Ascending order by vehicle driving time to the dropoff point. This order can only be used if the dropoff point is specified in the request. |
PICKUP_POINT_STRAIGHT_DISTANCE |
Ascending order by straight-line distance from the vehicle's last reported location to the pickup point. |
COST |
Ascending order by the configured match cost. Match cost is defined as a weighted calculation between straight-line distance and ETA. Weights are set with default values and can be modified per customer. Please contact Google support if these weights need to be modified for your project. |
CurrentTripsPresent
Specifies the types of restrictions on a vehicle's current trips.
Enums | |
---|---|
CURRENT_TRIPS_PRESENT_UNSPECIFIED |
The availability of vehicles with trips present is governed by the includeBackToBack field. |
NONE |
Vehicles without trips can appear in search results. When this value is used, includeBackToBack cannot be true . |
ANY |
Vehicles with at most 5 current trips and 10 waypoints are included in the search results. When this value is used, includeBackToBack cannot be true . |
VehicleMatch
Contains the vehicle and related estimates for a vehicle that match the points of active trips for the vehicle SearchVehiclesRequest
.
JSON representation |
---|
{ "vehicle": { object ( |
Fields | |
---|---|
vehicle |
Required. A vehicle that matches the request. |
vehicle |
The vehicle's driving ETA to the pickup point specified in the request. An empty value indicates a failure in calculating ETA for the vehicle. If A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
vehicle |
The distance from the Vehicle's current location to the pickup point specified in the request, including any intermediate pickup or dropoff points for existing trips. This distance comprises the calculated driving (route) distance, plus the straight line distance between the navigation end point and the requested pickup point. (The distance between the navigation end point and the requested pickup point is typically small.) An empty value indicates an error in calculating the distance. |
vehicle |
Required. The straight-line distance between the vehicle and the pickup point specified in the request. |
vehicle |
The complete vehicle's driving ETA to the drop off point specified in the request. The ETA includes stopping at any waypoints before the A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
vehicle |
The vehicle's driving distance (in meters) from the pickup point to the drop off point specified in the request. The distance is only between the two points and does not include the vehicle location or any other points that must be visited before the vehicle visits either the pickup point or dropoff point. The value will only be populated when a |
trip |
Required. The trip type of the request that was used to calculate the ETA to the pickup point. |
vehicle |
The ordered list of waypoints used to calculate the ETA. The list includes vehicle location, the pickup points of active trips for the vehicle, and the pickup points provided in the request. An empty list indicates a failure in calculating ETA for the vehicle. |
vehicle |
Type of the vehicle match. |
requested |
The order requested for sorting vehicle matches. |
ordered |
The actual order that was used for this vehicle. Normally this will match the 'orderBy' field from the request; however, in certain circumstances such as an internal server error, a different method may be used (such as |
Waypoint
Describes intermediate points along a route for a VehicleMatch
in a SearchVehiclesResponse
. This concept is represented as a TripWaypoint
in all other endpoints.
JSON representation |
---|
{
"latLng": {
object ( |
Fields | |
---|---|
lat |
The location of this waypoint. |
eta |
The estimated time that the vehicle will arrive at this waypoint. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
VehicleMatchType
Type of vehicle match.
Enums | |
---|---|
UNKNOWN |
Unknown vehicle match type |
EXCLUSIVE |
The vehicle currently has no trip assigned to it and can proceed to the pickup point. |
BACK_TO_BACK |
The vehicle is currently assigned to a trip, but can proceed to the pickup point after completing the in-progress trip. ETA and distance calculations take the existing trip into account. |
CARPOOL |
The vehicle has sufficient capacity for a shared ride. |
CARPOOL_BACK_TO_BACK |
The vehicle will finish its current, active trip before proceeding to the pickup point. ETA and distance calculations take the existing trip into account. |