# Google Maps Directions — Driving Routes & Steps (`sian.agency/google-maps-directions-scraper`) Actor

Get Google Maps driving directions between two places. Export every returned route alternative with distance, duration, resolved endpoints and turn-by-turn steps in one lookup record. Includes a Google Maps directions link and an HTML processing report. Driving only; one origin-destination pair per

- **URL**: https://apify.com/sian.agency/google-maps-directions-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** Travel, Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $125.72 / 1,000 completed driving lookup records

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Maps Directions — Driving Routes 🧭

[![SIÁN Agency Store](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Google Maps Traffic](https://img.shields.io/badge/Store-Google%20Maps%20Traffic-4285F4)](https://apify.com/sian.agency/google-maps-traffic-alerts?fpr=sian) [![Google Maps Photos](https://img.shields.io/badge/Store-Google%20Maps%20Photos-4285F4)](https://apify.com/sian.agency/google-maps-photos-scraper?fpr=sian) [![Waze Traffic](https://img.shields.io/badge/Store-Waze%20Traffic-1AE392)](https://apify.com/sian.agency/waze-traffic-scraper?fpr=sian)

#### 🧭 One driving lookup with every returned route alternative

##### For travel research, distance exports and operations analysis

### 🔎 What is the Google Maps Directions — and when should you use it?

The **Google Maps Directions** turns starting and destination place names into clean, structured rows you can filter, export and feed straight into a spreadsheet, database or AI agent. No account, no portal API key, no browser automation to maintain.

**Use it when you need:** driving route alternatives, distances, durations, resolved endpoints and available turn-by-turn instructions.

**Use something else when:** you need walking, cycling, transit, route matrices or scheduled-departure planning. This actor retrieves driving directions for one origin-destination pair. It does not provide live navigation or guaranteed travel times.

### 🤖 Use with AI agents

Already connected to the [Apify MCP server](https://mcp.apify.com)? Just ask for this Actor by name: sian.agency/google-maps-directions-scraper

**Agentic payments:** Availability of [x402](https://www.x402.org/) and [Skyfire](https://www.skyfire.xyz/) depends on this Actor's current Store eligibility. Check the published listing for supported payment methods. One completed lookup is one event and includes every returned driving alternative. Absent or unusable routes and failed retrievals have no lookup charge. A separate run-start fee applies.

Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```text
I want driving route research and distance exports between known places using the Apify Actor `sian.agency/google-maps-directions-scraper`.

Use it when I need: driving route alternatives, distances, durations, resolved endpoints and available turn-by-turn instructions.

Don't use it when: This actor retrieves driving directions for one origin-destination pair. It does not provide live navigation or guaranteed travel times.

How to call it: set operation to directions and supply origin and destination. Read each output record’s routes array and verify the resolved endpoint names.

Start with this input:
{
  "operation": "directions",
  "origin": "San Francisco, CA",
  "destination": "Sunnyvale, CA"
}

Ask me which starting place and destination they want, including state or country, then run the Actor and summarise the results as a table.
```

**Things you can ask your agent for:**

- *Get driving alternatives from San Francisco to Sunnyvale and compare distance and duration.*
- *Export the available turn-by-turn instructions between these two places to JSON.*
- *Check the resolved endpoints for this pair and show the returned Google Maps directions link.*

Machine-readable API, MCP config and OpenAPI definition for this Actor are published at [apify.com/sian.agency/google-maps-directions-scraper.md](https://apify.com/sian.agency/google-maps-directions-scraper.md).

### 📋 Overview

Get Google Maps driving directions between two places. Each lookup produces one record containing every returned route alternative, distance, duration and available turn-by-turn instructions. Requested and resolved endpoints stay visible together so you can check the interpretation.

- 🧭 **Complete lookup:** all returned alternatives stay together.
- 📏 **Distance and duration:** inspect estimates for each route.
- 📍 **Resolved endpoints:** compare them with the requested places.
- 🛣️ **Route steps:** preserve available instructions in JSON.
- 💰 **One lookup event:** alternatives have no extra route charge.
- 📄 **Processing report:** review counts and accepted charges.

### ✨ Features

- 📍 **Place inputs:** supply an origin and destination.
- 🧭 **Driving routes:** retrieve a focused road-route lookup.
- 🛣️ **Alternatives:** preserve every option returned in that lookup.
- 📏 **Meters and seconds:** compare numeric distances and durations.
- 🔗 **Google Maps link:** open the returned directions for review.
- 📄 **Nested steps:** JSON keeps the route-part and instruction structure.
- 🕒 **Dated snapshot:** distinguish the lookup time from future travel conditions.

This version handles driving only. It does not expose transit, walking, cycling, scheduled departures or avoidance controls. Distances and travel times are estimates for research; confirm current conditions before travel.

### 🎬 Quick Start

Open the actor in Apify Console and use the prefilled San Francisco to Sunnyvale pair. Press Start and check the resolved endpoint names. Open the dataset to inspect route alternatives, or download JSON for all instructions.

```json
{
  "operation": "directions",
  "origin": "San Francisco, CA",
  "destination": "Sunnyvale, CA"
}
```

### 🚀 Getting Started

#### Step 1: Choose the start

Enter the starting city or place name. Include state or country to reduce ambiguity.

#### Step 2: Choose the destination

Enter the destination with the same level of detail. One pair is processed per run.

#### Step 3: Check and export

Compare the requested and resolved places before using the route. Open the directions link or download the complete lookup as JSON.

### 📥 Input Configuration

| Field | Type | Meaning |
|---|---|---|
| operation | string | directions |
| origin | string | Starting city or place name |
| destination | string | Destination city or place name |

Both endpoint fields have Console prefills. API calls must supply their own origin and destination. There is no route matrix or automatic multi-pair mode.

### 📤 Output

| Field | Type | Meaning |
|---|---|---|
| originQuery | string | Requested start |
| destinationQuery | string | Requested destination |
| originName | string | Resolved starting place |
| destinationName | string | Resolved destination |
| routeCount | integer | Number of alternatives |
| routes | array | Complete route alternatives and steps |
| firstRouteName | string | First alternative’s route label |
| distanceMeters | number | First alternative’s distance |
| durationSeconds | number | First alternative’s estimated duration |
| directionsUrl | string | Google Maps directions link |
| resolvedOrigin | object | Returned origin details and coordinates |
| resolvedDestination | object | Returned destination details and coordinates |
| processedAt | string | ISO 8601 processing timestamp |
| scrapingDate | string | UTC processing date (YYYY-MM-DD) |
| status | string | Record status |

```json
{"originQuery":"San Francisco, CA","destinationQuery":"Sunnyvale, CA","originName":"San Francisco","destinationName":"Sunnyvale","routeCount":3,"firstRouteName":"US-101 S","distanceMeters":64513,"durationSeconds":2853,"status":"success"}
```

The example abbreviates the record. Actual output preserves all route alternatives and their available route parts, instructions, notes and timing information.

### 💼 Use Cases & Examples

#### 1. Route research

Travel researchers can compare the driving alternatives returned between two known places. Check the resolved cities before comparing the routes.

#### 2. Distance exports

Operations analysts can send numeric distance and duration estimates into a spreadsheet. Preview fields show the first alternative; the routes array contains every alternative.

#### 3. Trip planning notes

Travel writers can save the available route instructions as a dated snapshot. Confirm current conditions before relying on them for a journey.

#### 4. Location comparisons

Property researchers can compare driving routes between locations they already know. Include state or country in both place names to reduce ambiguity.

#### 5. Route data workflows

Developers can store complete lookup records in their own tools. JSON preserves route parts, instructions and available notes.

#### 6. Directions review

Assistants can show the resolved start and destination before sharing the Google Maps link. One lookup includes every returned driving alternative.

### 🔗 Integration Examples

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('sian.agency/google-maps-directions-scraper').call({"operation": "directions", "origin": "San Francisco, CA", "destination": "Sunnyvale, CA"});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].routes);
```

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')
run = client.actor('sian.agency/google-maps-directions-scraper').call(run_input={"operation": "directions", "origin": "San Francisco, CA", "destination": "Sunnyvale, CA"})
for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item['routes'])
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~google-maps-directions-scraper/runs?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' -d '{"operation": "directions", "origin": "San Francisco, CA", "destination": "Sunnyvale, CA"}'
```

#### Automation Workflows (N8N / Zapier / Make)

1. Trigger a workflow with a starting place and destination.
2. Start the actor using an HTTP request.
3. Wait for the run and read its dataset.
4. Save distances, durations and the route link to your spreadsheet or database.

### 📊 Performance & Pricing

A completed lookup produces one record and one driving-lookup event. Every returned driving alternative is included. An absent or unusable route and failed retrievals have no lookup charge. The separate run-start fee applies, including invalid input and early stops.

| Apify plan | Per completed lookup | Run start |
|---|---:|---:|
| Free | $0.57144 | $0.020 |
| Bronze | $0.14286 | $0.005 |
| Silver | $0.13429 | $0.005 |
| Gold | $0.12572 | $0.005 |

Enterprise customers should check their live quote. One origin-destination pair is processed per run on every plan. Processing time, route availability and estimated travel time can vary.

[Check current pricing](https://apify.com/sian.agency/google-maps-directions-scraper?fpr=sian).

### ❓ Frequently Asked Questions

**Are alternative routes billed separately?**

No. One completed lookup is one event and includes every returned driving alternative.

**Does it support walking or transit?**

No. This version retrieves driving routes only.

**Can I schedule a departure or avoid tolls?**

No. This focused version does not expose planned departures or avoidance controls.

**Are travel times guaranteed?**

No. They are estimates from the lookup and can change. This actor is for research, not live navigation or safety decisions.

**How do I check the endpoints?**

Compare the requested place names with originName, destinationName and the resolved endpoint objects. Open the Google Maps directions link if the interpretation looks wrong.

**What if there is no route?**

No driving-lookup charge applies to an unusable or absent route. A separate platform run-start fee still applies.

### 🐛 Troubleshooting

**The resolved city is wrong**

Include state or country in both place names. Check the returned coordinates and directions link before using the route.

**No usable driving route was returned**

Check that both places are reachable by road. Retry the pair on its own later. No lookup event is charged when a usable route is absent.

**The run stopped before the lookup**

Check your budget and account credits. Free API-origin runs are restricted; use Console or MCP for evaluation.

**Nested steps are difficult to read in CSV**

Download JSON to preserve each alternative’s route parts and instructions.

### ⚖️ Legal Disclaimer

Google and Google Maps are trademarks of Google LLC. SIÁN Agency is independent and is not endorsed by Google. Route and travel-time estimates can change. Confirm resolved endpoints and current road conditions before travel; this export does not provide live navigation.

Location queries can contain personal data. Check your purpose and applicable rules, including GDPR, before sharing them. Read Apify’s [web scraping legal guide](https://blog.apify.com/is-web-scraping-legal/) for background.

### 🤝 Support

Open an [issue](https://apify.com/sian.agency/google-maps-directions-scraper/issues) with the place names and run link. Avoid posting private addresses or account tokens.

Email <apify@sian-agency.online>. See more tools in the [SIÁN Agency Store](https://apify.com/sian.agency?fpr=sian).

**Built by [SIÁN Agency](https://www.sian-agency.online)**

# Changelog

This Actor's version history is a separate document: https://apify.com/sian.agency/google-maps-directions-scraper/changelog.md

# Actor input Schema

## `operation` (type: `string`):

Retrieve one Google Maps driving-route lookup between two places, preserving every returned alternative and its steps.

## `origin` (type: `string`):

📍 Enter the starting city or place name, including state or country to reduce ambiguity. The example starts in San Francisco. Check the resolved origin in the output before relying on the route.

## `destination` (type: `string`):

🏁 Enter the destination city or place name, including state or country. The example goes to Sunnyvale. This version retrieves driving routes only and returns resolved endpoints so you can check the interpretation.

## Actor input object example

```json
{
  "operation": "directions",
  "origin": "San Francisco, CA",
  "destination": "Sunnyvale, CA"
}
```

# Actor output Schema

## `googleMapsDrivingLookups` (type: `string`):

Google Maps driving lookup records containing complete route alternatives and their available turn-by-turn instructions.

## `scrapingSummary` (type: `string`):

HTML summary showing successful and failed results with key metrics

# 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 = {
    "operation": "directions",
    "origin": "San Francisco, CA",
    "destination": "Sunnyvale, CA"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/google-maps-directions-scraper").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 = {
    "operation": "directions",
    "origin": "San Francisco, CA",
    "destination": "Sunnyvale, CA",
}

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

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

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

```

## CLI example

```bash
echo '{
  "operation": "directions",
  "origin": "San Francisco, CA",
  "destination": "Sunnyvale, CA"
}' |
apify call sian.agency/google-maps-directions-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sian.agency/google-maps-directions-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/vvu3uoQn8gLmfiJWn/builds/OyQUoCQFerOgmBi5d/openapi.json
