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 ( |
| Fields | |
|---|---|
textQuery |
Required. Natural language search query (e.g., "ev chargers", "coffee"). |
languageCode |
Optional. The language for summary and place details. Defaults to "en-US". |
regionCode |
Optional. Country/region code (CLDR) of location (e.g., "US"). |
routingPreference |
Optional. Optional routing preference specifying how traffic data is used. Defaults to TRAFFIC_UNAWARE. |
includeExtendedDetails |
Optional. Includes extended place details in the response. Set this field to Leave Enabling this field may incur higher latency. |
travelMode |
Optional. Specifies the travel mode used to compute the route and the detours. Defaults to |
| 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 |
An encoded polyline string representing the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm |
retrievalToken |
A retrieval token returned from a prior v1.computeRoutes call representing the route. |
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