Method: searchAlongRoute

Search for places along a travel route.

HTTP request

POST https://mapstools.googleapis.com/v1:searchAlongRoute

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "textQuery": string,
  "languageCode": string,
  "regionCode": string,
  "routingPreference": enum (RoutingPreference),
  "includeExtendedDetails": boolean,
  "travelMode": enum (RouteTravelMode),

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "encodedPolyline": string,
  "retrievalToken": string,
  "routeEndpoints": {
    object (RouteEndpoints)
  }
  // End of mutually exclusive fields.
}
Fields
textQuery

string

Required. Natural language search query (e.g., "ev chargers", "coffee").

languageCode

string

Optional. The language for summary and place details. Defaults to "en-US".

regionCode

string

Optional. Country/region code (CLDR) of location (e.g., "US").

routingPreference

enum (RoutingPreference)

Optional. Optional routing preference specifying how traffic data is used. Defaults to TRAFFIC_UNAWARE.

includeExtendedDetails

boolean

Optional. Includes extended place details in the response.

Set this field to true when the user request requires rich qualitative insights, real-time dynamics, or specialized entity attributes: - Qualitative reviews, customer sentiment, and feedback. - Specific offerings like menu items, dishes, food specialties, beverages, or business highlights. - Qualitative atmosphere, interior decor, aesthetic, ambience, or mood. - Real-time data and specialized facility specs, visitor policies/tips, wait times.

Leave false (default) for standard discovery searches (e.g., cuisines, store types), location/address lookups, contact info, operating hours, and standard metadata/amenities.

Enabling this field may incur higher latency.

travelMode

enum (RouteTravelMode)

Optional. Specifies the travel mode used to compute the route and the detours. Defaults to DRIVE. WALK and BICYCLE are only supported with routeEndpoints. TRANSIT is not supported.

Route specification: either an existing route, route token, or origin/destination endpoints. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
encodedPolyline

string

An encoded polyline string representing the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm

retrievalToken

string

A retrieval token returned from a prior v1.computeRoutes call representing the route.

routeEndpoints

object (RouteEndpoints)

Explicit route endpoints (origin and destination).

End of mutually exclusive fields.

Response body

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

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/maps-platform.mapstools