# Google Maps Directions & Routes API | Multi-Stop Navigation (`zen-studio/google-maps-directions-api`) Actor

Extract driving, walking, cycling, and transit directions from Google Maps as structured data. Get multi-stop routes (2-10 stops), turn-by-turn instructions, distance, duration, traffic estimates, and Street View thumbnails. No API key needed. Supports departure/arrival times and route preferences.

- **URL**: https://apify.com/zen-studio/google-maps-directions-api.md
- **Developed by:** [Zen Studio](https://apify.com/zen-studio) (community)
- **Categories:** Developer tools, Travel, Integrations
- **Stats:** 70 total users, 9 monthly users, 76.1% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.49 / 1,000 directions

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Maps Directions Scraper | Multi-Stop Routes as Structured Data (2026)

Extract driving, walking, cycling, and transit directions from Google Maps. Supports 2-10 stops per route, returns multiple alternative routes with turn-by-turn instructions, distance, duration, traffic conditions, and Street View thumbnails.

No Google account. No API key. No browser.

<table><tr>
<td style="border-left:4px solid rgb(76,148,94);padding:12px 16px;font-weight:600">Routes in seconds — with the most detailed route data on Apify.</td>
</tr></table>

<br>

<table><tr>
<th style="border-bottom:2px solid #333;padding:12px 16px;text-align:left;font-weight:600">Related Scrapers ➤</th>
<td style="border-bottom:1px solid #ddd;padding:12px 16px"><a href="https://apify.com/zen-studio/apple-maps-directions-api" style="color:rgb(76,148,94);text-decoration:none;font-weight:600">Apple Directions</a></td>
<td style="border-bottom:1px solid #ddd;padding:12px 16px"><a href="https://apify.com/zen-studio/apple-maps-scraper-pro" style="color:rgb(76,148,94);text-decoration:none;font-weight:600">Apple Maps</a></td>
<td style="border-bottom:1px solid #ddd;padding:12px 16px"><a href="https://apify.com/zen-studio/yandex-places-scraper" style="color:rgb(76,148,94);text-decoration:none;font-weight:600">Yandex Places</a></td>
<td style="border-bottom:1px solid #ddd;padding:12px 16px"><a href="https://apify.com/zen-studio/2gis-places-scraper-api" style="color:rgb(76,148,94);text-decoration:none;font-weight:600">2GIS Places</a></td>
</tr></table>

#### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
zen-studio/google-maps-directions-api on Apify. Call: ApifyClient("TOKEN").actor("zen-studio/google-maps-directions-api").call(run_input={...}), then client.dataset(run["defaultDatasetId"]).list_items().items for results. Key inputs: stops: string[] (required, 2-10 locations), travelMode: string (driving|transit|walking|cycling), language: string. Full actor spec (input schema with all params/enums/defaults, output dataset fields, README): GET https://api.apify.com/v2/acts/zen-studio~google-maps-directions-api/builds/default (Bearer TOKEN) → inputSchema, actorDefinition.storages.dataset, readme. Pricing: $0.00299/direction, $0.00699/actor start, $0.00001/dataset item. Get token: https://console.apify.com/account/integrations
```

### How to Scrape Google Maps Directions

Enter your stops (2-10 locations), pick a travel mode, and run. The Actor geocodes place names via Google Maps autocomplete, fetches directions, and returns structured route data.

#### Two-Stop Route (Simple)

```json
{
  "stops": ["Berlin, Germany", "Munich, Germany"],
  "travelMode": "driving"
}
```

#### Multi-Stop Route

```json
{
  "stops": [
    "Berlin, Germany",
    "Prague, Czech Republic",
    "Vienna, Austria",
    "Budapest, Hungary"
  ],
  "travelMode": "driving"
}
```

Each pair of consecutive stops becomes a leg. A 4-stop route returns 3 legs per route alternative.

#### Walking with Wheelchair Access

```json
{
  "stops": ["Central Park, New York", "Times Square, New York"],
  "travelMode": "walking",
  "wheelchairAccessible": true
}
```

#### Public Transit with Filters

```json
{
  "stops": ["Alexanderplatz, Berlin", "Brandenburg Gate, Berlin"],
  "travelMode": "transit",
  "transitTypes": ["subway", "tram"],
  "transitRoutePreference": "fewer_transfers"
}
```

#### Depart at a Specific Time

```json
{
  "stops": ["Vienna Opera", "Schoenbrunn Palace"],
  "travelMode": "driving",
  "timeOption": "depart_at",
  "date": "2026-03-15",
  "time": "09:00"
}
```

Date and time are interpreted in the timezone of the first stop. Use `arrive_by` to plan backwards from an arrival time (driving and transit only).

#### Overview Mode (Smaller Output)

```json
{
  "stops": ["Berlin, Germany", "Munich, Germany"],
  "travelMode": "driving",
  "detailLevel": "overview"
}
```

Returns all stops, legs, and segment instructions without turn-by-turn substeps, Street View, or polyline tokens. Same routes, much smaller response.

### What Data You Get from Google Maps Directions

Each run returns one dataset item containing:

- **Multiple route alternatives** -- Google typically returns 2-3 different routes per query
- **Turn-by-turn instructions** -- every maneuver with human-readable text and emphasis markers
- **Distance and duration** -- at route, leg, segment, and substep level (meters + formatted text)
- **Traffic estimates** -- current, typical, and no-traffic durations with congestion level
- **Street View thumbnails** -- per navigation step with panorama IDs
- **Waypoint data** -- geocoded place names, coordinates, and place IDs for each stop
- **30+ languages** -- localized street names and instructions (en, de, fr, es, ja, zh, ar, and more)

### Pricing

Pay-per-event pricing. You only pay for directions successfully fetched.

| Event | Price |
|-------|-------|
| Actor start | $0.00699 |
| Direction result | $0.00299 |

#### Cost Examples

| Runs | Cost |
|------|------|
| 10 | $0.10 |
| 100 | $1.00 |
| 1,000 | $9.99 |

**Try it free** -- new Apify users get $5 in platform credits. That's ~**1,600 routes** at no cost.

Budget controls are built in. The Actor stops automatically when your spending limit is reached.

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `stops` | string\[] | *required* | 2-10 locations in order. First is origin, last is destination, rest are intermediate stops. |
| `travelMode` | string | `driving` | `driving`, `transit`, `walking`, or `cycling`. |
| `timeOption` | string | `now` | `now`, `depart_at`, or `arrive_by`. Arrive by supports driving and transit only. |
| `date` | string | — | Travel date in `YYYY-MM-DD` format. Required when `timeOption` is not `now`. |
| `time` | string | — | Travel time in 24h `HH:MM` format. Required when `timeOption` is not `now`. |
| `avoidHighways` | boolean | `false` | Avoid highways. Driving mode. |
| `avoidTolls` | boolean | `false` | Avoid toll roads. Driving mode. |
| `avoidFerries` | boolean | `false` | Avoid ferries. Driving mode. |
| `wheelchairAccessible` | boolean | `false` | Prefer accessible routes. Walking mode. |
| `transitTypes` | string\[] | all | Filter to `bus`, `subway`, `train`, `tram`. Transit mode. |
| `transitRoutePreference` | string | `best_route` | `best_route`, `fewer_transfers`, or `less_walking`. Transit mode. |
| `detailLevel` | string | `full` | `full` (turn-by-turn substeps, Street View, polyline) or `overview` (all stops and segments, without substeps or Street View). |
| `distanceUnit` | string | `auto` | `auto` (regional default), `km`, or `miles`. |
| `language` | string | `en` | Language code for instructions. `en`, `de`, `fr`, `es`, `ja`, etc. |

### Output Example (Full)

Default `detailLevel: "full"` — includes turn-by-turn substeps, Street View thumbnails, emphasis markers, and polyline tokens.

```json
{
  "query": {
    "stops": [
      "Berlin, Germany",
      "Munich, Germany"
    ],
    "travel_mode": "driving",
    "language": "en",
    "avoid_highways": false,
    "avoid_tolls": false,
    "avoid_ferries": false,
    "distance_unit": "auto"
  },
  "waypoints": [
    {
      "name": "Berlin, Germany",
      "coords": {
        "lat": 52.520006599999995,
        "lng": 13.404954
      },
      "encoded_id": "ChIJAVkDPzdOqEcRcDteW0YgIQQ",
      "display_name": "Berlin",
      "display_names": [
        "Berlin",
        "Germany"
      ]
    },
    {
      "name": "Munich, Germany",
      "coords": {
        "lat": 48.1351253,
        "lng": 11.5819805
      },
      "encoded_id": "ChIJ2V-Mo_l1nkcRfZixfUq4DAE",
      "display_name": "Munich",
      "display_names": [
        "Munich",
        "Germany"
      ]
    }
  ],
  "routes": [
    {
      "index": 0,
      "travel_mode": "driving",
      "via": "A9",
      "distance": {
        "meters": 584762,
        "text": "585 km"
      },
      "duration": {
        "seconds": 22494,
        "text": "6 hr 15 min"
      },
      "country": [
        "DE"
      ],
      "polyline_token": "CAEi0QEKUBXWsBwVF9Yc/6T7HFYpJh...",
      "eta_messages": [
        [
          "You're on the fastest route."
        ],
        [
          "You should arrive around 11:34 AM.",
          1
        ]
      ],
      "traffic": {
        "traffic_level": 3,
        "congestion_zones": [
          [
            [
              1,
              974,
              226
            ]
          ]
        ]
      },
      "legs": [
        {
          "distance": {
            "meters": 584762,
            "text": "585 km"
          },
          "duration": {
            "seconds": 22496,
            "text": "6 hr 15 min"
          },
          "traffic": {
            "no_traffic": {
              "seconds": 21285,
              "text": "5 hr 55 min"
            },
            "traffic_level": 3,
            "typical": {
              "seconds": 19713,
              "text": "5 hr 29 min"
            },
            "range": {
              "min_seconds": 18781,
              "max_seconds": 28035,
              "text": "5 hr 13 min to 7 hr 47 min"
            }
          },
          "destination": {
            "name": "Munich",
            "names": [
              "Munich",
              "Germany"
            ],
            "end_point": {
              "lat": 48.1351253,
              "lng": 11.5819805
            },
            "timezone": "Europe/Berlin",
            "timezone_abbr": "GMT+1"
          },
          "segments": [
            {
              "distance": {
                "meters": 9292,
                "text": "9.3 km"
              },
              "duration": {
                "seconds": 1355,
                "text": "23 min"
              },
              "instruction": "Get on A100 in Bezirk Charlottenburg-Wilmersdorf from B2",
              "instruction_parts": [
                {
                  "text": "Get on ",
                  "emphasized": false
                },
                {
                  "text": "A100",
                  "emphasized": true
                },
                {
                  "text": " in ",
                  "emphasized": false
                },
                {
                  "text": "Bezirk Charlottenburg-Wilmersdorf",
                  "emphasized": false
                },
                {
                  "text": " from ",
                  "emphasized": false
                },
                {
                  "text": "B2",
                  "emphasized": true
                }
              ],
              "substeps": [
                {
                  "maneuver_type": 0,
                  "distance": {
                    "meters": 1749,
                    "text": "1.7 km"
                  },
                  "duration": {
                    "seconds": 314,
                    "text": "5 min"
                  },
                  "instruction": "Head toward Spandauer Str.",
                  "instruction_parts": [
                    {
                      "text": "Head toward ",
                      "emphasized": false
                    },
                    {
                      "text": "Spandauer Str.",
                      "emphasized": true
                    }
                  ],
                  "start_point": {
                    "lat": 52.519947955056686,
                    "lng": 13.404969798377866
                  },
                  "end_point": {
                    "lat": 52.5200143,
                    "lng": 13.4049447
                  }
                },
                {
                  "maneuver_type": 0,
                  "distance": {
                    "meters": 166,
                    "text": "170 m"
                  },
                  "duration": {
                    "seconds": 39,
                    "text": "39 sec"
                  },
                  "instruction": "Turn right onto Wilhelmstraße/B2/B5",
                  "instruction_parts": [
                    {
                      "text": "Turn ",
                      "emphasized": false
                    },
                    {
                      "text": "right",
                      "emphasized": true
                    },
                    {
                      "text": " onto ",
                      "emphasized": false
                    },
                    {
                      "text": "Wilhelmstraße",
                      "emphasized": true
                    },
                    {
                      "text": "/",
                      "emphasized": false
                    },
                    {
                      "text": "B2",
                      "emphasized": true
                    },
                    {
                      "text": "/",
                      "emphasized": false
                    },
                    {
                      "text": "B5",
                      "emphasized": true
                    }
                  ],
                  "start_point": {
                    "lat": 52.5166258988976,
                    "lng": 13.38102620691614
                  },
                  "end_point": {
                    "lat": 52.5166058,
                    "lng": 13.380732300000002
                  },
                  "streetview": {
                    "pano_id": "TP4jMtqDWaafVBfo0YwWrQ",
                    "thumbnail_url": "https://streetviewpixels-pa.googleapis.com/v1/thumbnail?panoid=TP4jMtqDWaafVBfo0YwWrQ&cb_client=maps_sv.tactile.gps&w=203&h=100&yaw=83.50145&pitch=0&thumbfov=100",
                    "thumbnail_size": [
                      203,
                      100
                    ]
                  }
                }
              ]
            },
            {
              "distance": {
                "meters": 569245,
                "text": "569 km"
              },
              "duration": {
                "seconds": 20474,
                "text": "5 hr 41 min"
              },
              "instruction": "Get on Schenkendorfstraße/B2R in Schwabing-Freimann, München from A9",
              "instruction_parts": [
                {
                  "text": "Get on ",
                  "emphasized": false
                },
                {
                  "text": "Schenkendorfstraße",
                  "emphasized": true
                },
                {
                  "text": "/",
                  "emphasized": false
                },
                {
                  "text": "B2R",
                  "emphasized": true
                },
                {
                  "text": " in ",
                  "emphasized": false
                },
                {
                  "text": "Schwabing-Freimann, München",
                  "emphasized": false
                },
                {
                  "text": " from ",
                  "emphasized": false
                },
                {
                  "text": "A9",
                  "emphasized": true
                }
              ],
              "substeps": [
                {
                  "maneuver_type": 0,
                  "distance": {
                    "meters": 438,
                    "text": "450 m"
                  },
                  "duration": {
                    "seconds": 29,
                    "text": "29 sec"
                  },
                  "instruction": "Merge onto A100",
                  "instruction_parts": [
                    {
                      "text": "Merge onto ",
                      "emphasized": false
                    },
                    {
                      "text": "A100",
                      "emphasized": true
                    }
                  ],
                  "start_point": {
                    "lat": 52.50693146195627,
                    "lng": 13.282207707594479
                  },
                  "end_point": {
                    "lat": 52.5067585,
                    "lng": 13.282255399999999
                  },
                  "streetview": {
                    "pano_id": "mlwx1qTPlfcP8mPatY_yTg",
                    "thumbnail_url": "https://streetviewpixels-pa.googleapis.com/v1/thumbnail?panoid=mlwx1qTPlfcP8mPatY_yTg&cb_client=maps_sv.tactile.gps&w=203&h=100&yaw=10.174609&pitch=0&thumbfov=100",
                    "thumbnail_size": [
                      203,
                      100
                    ]
                  }
                },
                {
                  "maneuver_type": 0,
                  "distance": {
                    "meters": 640,
                    "text": "650 m"
                  },
                  "duration": {
                    "seconds": 47,
                    "text": "47 sec"
                  },
                  "instruction": "At the interchange 10-Dreieck Funkturm, Use the right lane to follow signs for A115/E51 toward Magdeburg/Leipzig/Potsdam",
                  "instruction_parts": [
                    {
                      "text": "At the interchange ",
                      "emphasized": false
                    },
                    {
                      "text": "10-Dreieck Funkturm",
                      "emphasized": true
                    },
                    {
                      "text": ", Use the right lane to follow signs for ",
                      "emphasized": false
                    },
                    {
                      "text": "A115",
                      "emphasized": true
                    },
                    {
                      "text": "/",
                      "emphasized": false
                    },
                    {
                      "text": "E51",
                      "emphasized": true
                    },
                    {
                      "text": " toward ",
                      "emphasized": false
                    },
                    {
                      "text": "Magdeburg",
                      "emphasized": true
                    },
                    {
                      "text": "/",
                      "emphasized": false
                    },
                    {
                      "text": "Leipzig",
                      "emphasized": true
                    },
                    {
                      "text": "/",
                      "emphasized": false
                    },
                    {
                      "text": "Potsdam",
                      "emphasized": true
                    }
                  ],
                  "start_point": {
                    "lat": 52.5030939232209,
                    "lng": 13.280960733910394
                  },
                  "end_point": {
                    "lat": 52.502926900000006,
                    "lng": 13.280850599999999
                  },
                  "streetview": {
                    "pano_id": "AKxz0C8zQWeULgyiZL9wRw",
                    "thumbnail_url": "https://streetviewpixels-pa.googleapis.com/v1/thumbnail?panoid=AKxz0C8zQWeULgyiZL9wRw&cb_client=maps_sv.tactile.gps&w=203&h=100&yaw=201.45728&pitch=0&thumbfov=100",
                    "thumbnail_size": [
                      203,
                      100
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
```

### Output Example (Overview)

`detailLevel: "overview"` — all stops, legs, and segment instructions, but without turn-by-turn substeps, Street View, or polyline tokens. Same routes at a fraction of the size.

```json
{
  "query": {
    "stops": [
      "Berlin, Germany",
      "Munich, Germany"
    ],
    "travel_mode": "driving",
    "language": "en",
    "avoid_highways": false,
    "avoid_tolls": false,
    "avoid_ferries": false,
    "distance_unit": "auto"
  },
  "waypoints": [
    {
      "name": "Berlin, Germany",
      "coords": {
        "lat": 52.520006599999995,
        "lng": 13.404954
      },
      "encoded_id": "ChIJAVkDPzdOqEcRcDteW0YgIQQ",
      "display_name": "Berlin",
      "display_names": [
        "Berlin",
        "Germany"
      ]
    },
    {
      "name": "Munich, Germany",
      "coords": {
        "lat": 48.1351253,
        "lng": 11.5819805
      },
      "encoded_id": "ChIJ2V-Mo_l1nkcRfZixfUq4DAE",
      "display_name": "Munich",
      "display_names": [
        "Munich",
        "Germany"
      ]
    }
  ],
  "routes": [
    {
      "index": 0,
      "travel_mode": "driving",
      "via": "A9",
      "distance": {
        "meters": 584762,
        "text": "585 km"
      },
      "duration": {
        "seconds": 22494,
        "text": "6 hr 15 min"
      },
      "country": [
        "DE"
      ],
      "legs": [
        {
          "distance": {
            "meters": 584762,
            "text": "585 km"
          },
          "duration": {
            "seconds": 22496,
            "text": "6 hr 15 min"
          },
          "traffic": {
            "no_traffic": {
              "seconds": 21287,
              "text": "5 hr 55 min"
            },
            "traffic_level": 3,
            "typical": {
              "seconds": 19713,
              "text": "5 hr 29 min"
            },
            "range": {
              "min_seconds": 18715,
              "max_seconds": 28232,
              "text": "5 hr 12 min to 7 hr 51 min"
            }
          },
          "destination": {
            "name": "Munich",
            "names": [
              "Munich",
              "Germany"
            ],
            "end_point": {
              "lat": 48.1351253,
              "lng": 11.5819805
            },
            "timezone": "Europe/Berlin",
            "timezone_abbr": "GMT+1"
          },
          "segments": [
            {
              "distance": {
                "meters": 9292,
                "text": "9.3 km"
              },
              "duration": {
                "seconds": 1355,
                "text": "23 min"
              },
              "instruction": "Get on A100 in Bezirk Charlottenburg-Wilmersdorf from B2"
            },
            {
              "distance": {
                "meters": 569245,
                "text": "569 km"
              },
              "duration": {
                "seconds": 20474,
                "text": "5 hr 41 min"
              },
              "instruction": "Get on Schenkendorfstraße/B2R in Schwabing-Freimann, München from A9"
            },
            {
              "distance": {
                "meters": 6225,
                "text": "6.2 km"
              },
              "duration": {
                "seconds": 667,
                "text": "11 min"
              },
              "instruction": "Continue on B2R. Take Ifflandstraße and Prinzregentenstraße to Tal in Altstadt-Lehel"
            }
          ]
        }
      ]
    },
    {
      "index": 1,
      "travel_mode": "driving",
      "via": "A93 and A9",
      "distance": {
        "meters": 616271,
        "text": "616 km"
      },
      "duration": {
        "seconds": 23539,
        "text": "6 hr 32 min"
      },
      "country": [
        "DE"
      ],
      "legs": [
        {
          "distance": {
            "meters": 616271,
            "text": "616 km"
          },
          "duration": {
            "seconds": 23541,
            "text": "6 hr 32 min"
          },
          "traffic": {
            "no_traffic": {
              "seconds": 22370,
              "text": "6 hr 13 min"
            },
            "traffic_level": 3,
            "typical": {
              "seconds": 20527,
              "text": "5 hr 42 min"
            },
            "range": {
              "min_seconds": 19769,
              "max_seconds": 29580,
              "text": "5 hr 29 min to 8 hr 13 min"
            }
          },
          "destination": {
            "name": "Munich",
            "names": [
              "Munich",
              "Germany"
            ],
            "end_point": {
              "lat": 48.1351253,
              "lng": 11.5819805
            },
            "timezone": "Europe/Berlin",
            "timezone_abbr": "GMT+1"
          },
          "segments": [
            {
              "distance": {
                "meters": 9292,
                "text": "9.3 km"
              },
              "duration": {
                "seconds": 1355,
                "text": "23 min"
              },
              "instruction": "Get on A100 in Bezirk Charlottenburg-Wilmersdorf from B2"
            },
            {
              "distance": {
                "meters": 600754,
                "text": "601 km"
              },
              "duration": {
                "seconds": 21519,
                "text": "5 hr 59 min"
              },
              "instruction": "Get on Schenkendorfstraße/B2R in Schwabing-Freimann, München from A9 and A93"
            },
            {
              "distance": {
                "meters": 6225,
                "text": "6.2 km"
              },
              "duration": {
                "seconds": 667,
                "text": "11 min"
              },
              "instruction": "Continue on B2R. Take Ifflandstraße and Prinzregentenstraße to Tal in Altstadt-Lehel"
            }
          ]
        }
      ]
    },
    {
      "index": 2,
      "travel_mode": "driving",
      "via": "A13 and A9",
      "distance": {
        "meters": 642658,
        "text": "643 km"
      },
      "duration": {
        "seconds": 24544,
        "text": "6 hr 49 min"
      },
      "country": [
        "DE"
      ],
      "legs": [
        {
          "distance": {
            "meters": 642658,
            "text": "643 km"
          },
          "duration": {
            "seconds": 24547,
            "text": "6 hr 49 min"
          },
          "traffic": {
            "no_traffic": {
              "seconds": 23811,
              "text": "6 hr 37 min"
            },
            "traffic_level": 3,
            "typical": {
              "seconds": 21747,
              "text": "6 hr 2 min"
            },
            "range": {
              "min_seconds": 20883,
              "max_seconds": 30841,
              "text": "5 hr 48 min to 8 hr 34 min"
            }
          },
          "destination": {
            "name": "Munich",
            "names": [
              "Munich",
              "Germany"
            ],
            "end_point": {
              "lat": 48.1351253,
              "lng": 11.5819805
            },
            "timezone": "Europe/Berlin",
            "timezone_abbr": "GMT+1"
          },
          "segments": [
            {
              "distance": {
                "meters": 5962,
                "text": "6.0 km"
              },
              "duration": {
                "seconds": 1085,
                "text": "18 min"
              },
              "instruction": "Take Karl-Liebknecht-Str./B2/B5, Alexanderstraße, Holzmarktstraße, Köpenicker Str. and Schlesische Str. to A100 in Bezirk Treptow-Köpenick"
            },
            {
              "distance": {
                "meters": 630471,
                "text": "630 km"
              },
              "duration": {
                "seconds": 22795,
                "text": "6 hr 20 min"
              },
              "instruction": "Get on Schenkendorfstraße/B2R in Schwabing-Freimann, München from A13, A4, A72 and A9"
            },
            {
              "distance": {
                "meters": 6225,
                "text": "6.2 km"
              },
              "duration": {
                "seconds": 667,
                "text": "11 min"
              },
              "instruction": "Continue on B2R. Take Ifflandstraße and Prinzregentenstraße to Tal in Altstadt-Lehel"
            }
          ]
        }
      ]
    }
  ]
}
```

### Use Cases

#### Logistics and Fleet Management

- **Route planning** -- calculate distances and durations between warehouses, stops, and customers
- **Multi-stop optimization** -- compare route alternatives for delivery sequences
- **Toll and highway avoidance** -- estimate costs for routes that skip toll roads

#### Travel and Tourism

- **Itinerary building** -- get walking times between attractions in a city
- **Transit planning** -- find public transport connections with transfer counts
- **Accessibility** -- plan wheelchair-accessible walking routes

#### Real Estate and Location Intelligence

- **Commute analysis** -- measure driving/transit times from properties to offices
- **Location scoring** -- compare accessibility across neighborhoods
- **Distance matrix** -- build origin-destination tables for site selection

#### Research and Data Science

- **Transportation studies** -- collect route data across cities and travel modes
- **Traffic analysis** -- extract congestion levels and typical vs current travel times
- **Urban planning** -- analyze pedestrian and cycling route availability

### API Integration

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("your_token")

run = client.actor("zen-studio~google-maps-directions").call(run_input={
    "stops": ["Berlin, Germany", "Prague, Czech Republic", "Vienna, Austria"],
    "travelMode": "driving",
    "language": "en",
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    for route in item["routes"]:
        print(f"Route {route['index']}: {route['via']} — {route['distance']['text']}, {route['duration']['text']}")
```

#### JavaScript / Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'your_token' });

const run = await client.actor('zen-studio~google-maps-directions').call({
    stops: ['Berlin, Germany', 'Prague, Czech Republic', 'Vienna, Austria'],
    travelMode: 'driving',
    language: 'en',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) {
    item.routes.forEach(r => console.log(`${r.via} — ${r.distance.text}, ${r.duration.text}`));
}
```

### Advanced Usage

#### Avoid Tolls and Highways

```json
{
  "stops": ["Zurich, Switzerland", "Milan, Italy"],
  "travelMode": "driving",
  "avoidHighways": true,
  "avoidTolls": true,
  "distanceUnit": "km"
}
```

#### Transit with Specific Types

Filter to trains and subways only, prefer fewer transfers:

```json
{
  "stops": ["Heathrow Airport, London", "Kings Cross, London"],
  "travelMode": "transit",
  "transitTypes": ["train", "subway"],
  "transitRoutePreference": "fewer_transfers"
}
```

#### Distance in Miles

```json
{
  "stops": ["New York, NY", "Boston, MA"],
  "travelMode": "driving",
  "distanceUnit": "miles",
  "language": "en"
}
```

#### Multi-Stop Road Trip

```json
{
  "stops": [
    "Amsterdam, Netherlands",
    "Brussels, Belgium",
    "Luxembourg City, Luxembourg",
    "Strasbourg, France",
    "Zurich, Switzerland"
  ],
  "travelMode": "driving",
  "avoidTolls": true,
  "distanceUnit": "km",
  "language": "en"
}
```

Returns 4 legs (Amsterdam-Brussels, Brussels-Luxembourg, Luxembourg-Strasbourg, Strasbourg-Zurich) with 2-3 route alternatives.

#### Arrive by a Specific Time (Transit)

```json
{
  "stops": ["Basel, Switzerland", "Barcelona, Spain"],
  "travelMode": "transit",
  "timeOption": "arrive_by",
  "date": "2026-03-15",
  "time": "18:00"
}
```

#### Depart at a Specific Time (Driving)

```json
{
  "stops": ["Vienna Opera", "Schoenbrunn Palace"],
  "travelMode": "driving",
  "timeOption": "depart_at",
  "date": "2026-03-15",
  "time": "09:00"
}
```

The timezone is automatically determined from the first stop's location. `arrive_by` is available for driving and transit modes only.

### Data Export

Export results from the Apify Console in:

- **JSON** -- full nested structure with all route detail
- **CSV** -- flattened for spreadsheet analysis
- **Excel** -- reporting and pivot tables

### FAQ

**How many route alternatives does it return?**
Google Maps typically returns 2-3 alternative routes per query. Each has its own distance, duration, and turn-by-turn instructions.

**What's the maximum number of stops?**
10 stops per run. The first stop is the origin, the last is the destination, everything in between are intermediate waypoints.

**Do I need a Google account or API key?**
No. No login, no API key, no cookies.

**How accurate are the travel times?**
Same data as Google Maps. Driving routes include real-time traffic estimates with typical and no-traffic durations.

**Does it support all countries and languages?**
Yes. Any location that Google Maps can resolve, in 30+ languages. Set `language` to get localized street names and instructions — English, German, French, Spanish, Japanese, Chinese, Arabic, Korean, and many more.

**Can I schedule a departure or arrival time?**
Yes. Set `timeOption` to `depart_at` or `arrive_by`, then provide `date` (YYYY-MM-DD) and `time` (HH:MM, 24-hour). The timezone is auto-detected from the first stop's location. `arrive_by` works with driving and transit only.

**What travel modes are available?**
Driving, public transit, walking, and cycling. Each mode has its own route options (e.g., avoid highways for driving, wheelchair access for walking, transit type filters for public transit).

**Is there traffic data?**
Yes, for driving routes. Includes current duration, typical duration, no-traffic duration, congestion level, and a min/max time range.

**What's in the Street View data?**
Each navigation substep includes a Street View panorama ID, thumbnail URL, and camera angle. Useful for visual route previews.

**Is there a free trial?**
New Apify users get $5 in platform credits, enough for ~1,600 routes at no cost.

### More Zen Studio scrapers for maps & local data

- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-y6Jak0F6vxdZew3b2-HljeTJZkhm-google-maps-directions-api-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **Google Maps**
  - [Google Maps Scraper](https://apify.com/zen-studio/google-maps-scraper)
- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-5bSvAQKSK3LPq9OXb-AgVhcT1mQC-apple-maps-scraper-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **Apple Maps**
  - [Apple Maps Scraper](https://apify.com/zen-studio/apple-maps-scraper-pro)
  - [Apple Maps Directions & Route API](https://apify.com/zen-studio/apple-maps-directions-route-api)
- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-fRSgBvgbsRB4o7t30-UkaIbH1Yhq-yandex-maps-scraper-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **Yandex Maps Яндекс Карты**
  - [Yandex Maps Scraper](https://apify.com/zen-studio/yandex-maps-scraper)
  - [Yandex Maps Reviews Scraper](https://apify.com/zen-studio/yandex-maps-reviews-scraper)
- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-NBmcHCtkUEhA0DNP3-SrXbUedsVm-2gis-scraper-api-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **2GIS 2ГИС**
  - [2GIS Places Scraper](https://apify.com/zen-studio/2gis-places-scraper-api)
  - [2GIS Reviews Scraper](https://apify.com/zen-studio/2gis-reviews-scraper)

### Disclaimer

Data is collected from publicly available sources and provided "as is" for informational purposes. Users are responsible for compliance with Google's terms of service and applicable regulations in their jurisdiction.

***

[**Start Scraping Google Maps Directions Now**](https://console.apify.com/actors/zen-studio~google-maps-directions)

# Actor input Schema

## `stops` (type: `array`):

Enter 2–10 locations in order. The first stop is the origin, the last is the destination, and any in between are intermediate stops.<br><br>Examples:<br>• <code>Berlin, Germany</code><br>• <code>Eiffel Tower, Paris</code><br>• <code>350 5th Ave, New York, NY</code>

## `travelMode` (type: `string`):

Determines the type of route returned.<br><br>• <b>Driving</b> — car routes with traffic estimates<br>• <b>Transit</b> — public transport with line names and transfers<br>• <b>Walking</b> — pedestrian routes with street-level steps<br>• <b>Cycling</b> — bike-friendly routes

## `timeOption` (type: `string`):

When to travel.<br><br>• <b>Leave now</b> — current traffic conditions (default)<br>• <b>Depart at</b> — get directions for a specific departure time<br>• <b>Arrive by</b> — plan to arrive at a specific time (driving and transit only)

## `date` (type: `string`):

Travel date in <code>YYYY-MM-DD</code> format. Required when using Depart at or Arrive by.

## `time` (type: `string`):

Travel time in 24-hour <code>HH:MM</code> format (e.g. <code>14:30</code>). Required when using Depart at or Arrive by.

## `avoidHighways` (type: `boolean`):

Avoid highways and motorways where possible. Applies to driving mode.

## `avoidTolls` (type: `boolean`):

Avoid toll roads where possible. Applies to driving mode.

## `avoidFerries` (type: `boolean`):

Avoid ferries where possible. Applies to driving mode.

## `wheelchairAccessible` (type: `boolean`):

Prefer wheelchair-accessible routes. Applies to walking mode.

## `transitTypes` (type: `array`):

Filter to specific transit types. Leave empty to include all. Applies to transit mode.<br><br>• <b>Bus</b><br>• <b>Subway</b><br>• <b>Train</b><br>• <b>Tram</b> (tram and light rail)

## `transitRoutePreference` (type: `string`):

How to optimize transit routes. Applies to transit mode.<br><br>• <b>Best route</b> — balanced optimization (default)<br>• <b>Fewer transfers</b> — minimize connections<br>• <b>Less walking</b> — minimize walking distance

## `detailLevel` (type: `string`):

How much detail to include in the output.<br><br>• <b>Full</b> — turn-by-turn substeps, Street View thumbnails, emphasis markers, polyline tokens<br>• <b>Overview</b> — all stops and segment instructions, without turn-by-turn substeps or Street View. Much smaller output

## `distanceUnit` (type: `string`):

Unit for distance values in the response.<br><br>• <b>Auto</b> — uses the default for the region<br>• <b>Kilometers</b><br>• <b>Miles</b>

## `language` (type: `string`):

Language for street names and turn-by-turn instructions in the output.

## Actor input object example

```json
{
  "stops": [
    "Berlin, Germany",
    "Prague, Czech Republic",
    "Vienna, Austria"
  ],
  "travelMode": "driving",
  "timeOption": "now",
  "time": "14:30",
  "avoidHighways": false,
  "avoidTolls": false,
  "avoidFerries": false,
  "wheelchairAccessible": false,
  "transitTypes": [],
  "transitRoutePreference": "best_route",
  "detailLevel": "full",
  "distanceUnit": "auto",
  "language": "en"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "stops": [
        "Berlin, Germany",
        "Prague, Czech Republic",
        "Vienna, Austria"
    ],
    "time": "14:30"
};

// Run the Actor and wait for it to finish
const run = await client.actor("zen-studio/google-maps-directions-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "stops": [
        "Berlin, Germany",
        "Prague, Czech Republic",
        "Vienna, Austria",
    ],
    "time": "14:30",
}

# Run the Actor and wait for it to finish
run = client.actor("zen-studio/google-maps-directions-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "stops": [
    "Berlin, Germany",
    "Prague, Czech Republic",
    "Vienna, Austria"
  ],
  "time": "14:30"
}' |
apify call zen-studio/google-maps-directions-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=zen-studio/google-maps-directions-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/y6Jak0F6vxdZew3b2/builds/sUyf3YEvrk7KpY58O/openapi.json
