Google Maps Directions Search Along Route API
The Google Maps Directions Search Along Route API returns places like gas stations, restaurants, coffee shops, and hotels along a driving route between an origin and a destination. Results cover the whole route corridor instead of clustering near the origin. Each place includes its title, place ID, data ID, rating, reviews, address, phone, opening hours, and GPS coordinates.
The route comes from the Google Maps Directions API: call it with your origin and destination, then pass the search_along_route_token from its response here, along with the place category in q. Use page to step through more places along the corridor.
API Parameters
Search Query
-
- Name
-
q - Required
- Required
- Description
-
Parameter defines the query to search for along the route (e.g.
Gas,Restaurants,Coffee,Hotels).
-
- Name
-
search_along_route_token - Required
- Required
- Description
-
An opaque route token from a
google_maps_directionsresponse.
Call thegoogle_maps_directionsAPI with your origin and destination first, then pass thesearch_along_route_tokenit returns here.
Localization
-
- Name
-
hl - Required
- Optional
- Description
-
Parameter defines the language to use for the search. It is a two-letter language code (e.g.
en,es,de).
The country/region is derived automatically from the route's destination.
Pagination
-
- Name
-
page - Required
- Optional
- Description
-
Parameter defines which page of results to return. Each page holds up to 20 places along the route.
Keep incrementing it to fetch more places until the response stops returning results.
API Examples
Full Response
https://www.searchapi.io/api/v1/search?engine=google_maps_directions_search_along_route&q=Gas&search_along_route_token=W3sibiI6IkxvcyBBbmdlbGVzLCBDYWxpZm9ybmlhIiwidCI6IjFGMU1GTUthaGJuMENFWWxiOTh2NGhQYUo5eGR4OEtBIiwieSI6MzQuMDU0OTA3NiwieCI6LTExOC4yNDI2NDMsImMiOiJ1cyJ9LHsibiI6IkxhcyBWZWdhcywgTmV2YWRhIiwidCI6InJsZVBGZDhxWDd1amViUFY1dFhNT3RGOTlhU0N0NzZBIiwieSI6MzYuMTcxNTYzLCJ4IjotMTE1LjEzOTEwMDksImMiOiJ1cyJ9XQ
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_maps_directions_search_along_route",
"q": "Gas",
"search_along_route_token": "W3sibiI6IkxvcyBBbmdlbGVzLCBDYWxpZm9ybmlhIiwidCI6IjFGMU1GTUthaGJuMENFWWxiOTh2NGhQYUo5eGR4OEtBIiwieSI6MzQuMDU0OTA3NiwieCI6LTExOC4yNDI2NDMsImMiOiJ1cyJ9LHsibiI6IkxhcyBWZWdhcywgTmV2YWRhIiwidCI6InJsZVBGZDhxWDd1amViUFY1dFhNT3RGOTlhU0N0NzZBIiwieSI6MzYuMTcxNTYzLCJ4IjotMTE1LjEzOTEwMDksImMiOiJ1cyJ9XQ"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_6QNVPZBKo24jc9vOp8y471M9",
"status": "Success",
"created_at": "2026-06-08T17:04:31Z",
"request_time_taken": 3.54,
"parsing_time_taken": 0.0,
"total_time_taken": 3.54,
"request_url": "https://www.google.com/maps/dir/Los+Angeles%2C+California/Las+Vegas%2C+Nevada",
"html_url": "https://www.searchapi.io/api/v1/searches/search_6QNVPZBKo24jc9vOp8y471M9.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_6QNVPZBKo24jc9vOp8y471M9"
},
"search_parameters": {
"engine": "google_maps_directions_search_along_route",
"q": "Gas",
"search_along_route_token": "W3sibiI6IkxvcyBBbmdlbGVzLCBDYWxpZm9ybmlhIiwidCI6IjFGMU1GTUthaGJuMENFWWxiOTh2NGhQYUo5eGR4OEtBIiwieSI6MzQuMDU0OTA3NiwieCI6LTExOC4yNDI2NDMsImMiOiJ1cyJ9LHsibiI6IkxhcyBWZWdhcywgTmV2YWRhIiwidCI6InJsZVBGZDhxWDd1amViUFY1dFhNT3RGOTlhU0N0NzZBIiwieSI6MzYuMTcxNTYzLCJ4IjotMTE1LjEzOTEwMDksImMiOiJ1cyJ9XQ",
"hl": "en"
},
"search_information": {
"query_displayed": "Gas",
"state": "Showing results for original spelling."
},
"local_results": [
{
"position": 1,
"ludocid": "18397237333291194343",
"place_id": "ChIJg3xXj-HFwoAR51dgw-EdUP8",
"kgmid": "/g/11c328rv8g",
"data_id": "0x80c2c5e18f577c83:0xff501de1c36057e7",
"title": "Sinclair Gas Station",
"address": "918 N Soto St, Los Angeles, CA 90033",
"city": "Los Angeles, CA",
"country_code": "US",
"timezone": "America/Los_Angeles",
"fuel_price": "$5.80/Regular",
"detour": {
"duration": 205,
"formatted_duration": "3 min",
"distance": 334,
"formatted_distance": "0.2 mi"
},
"phone": "(323) 268-2497",
"rating": 3.5,
"website": "https://stations.sinclairoil.com/ca/los-angeles/918-n-soto-st?utm_source=google&utm_medium=yext",
"domain": "stations.sinclairoil.com",
"gps_coordinates": {
"latitude": 34.0526507,
"longitude": -118.2038177
},
"type": "Gas station",
"types": [
"Gas station",
...
],
"open_state": "Open",
"hours": "Open · Closes 11 PM",
"open_hours": {
"monday": "5 AM–11 PM"
},
"extensions": [
{
"title": "Accessibility",
"items": [
{
"title": "Wheelchair accessible restroom",
"value": "Has wheelchair accessible restroom"
},
...
]
},
...
]
},
...
]
}