Google Maps Directions Scraper avatar

Google Maps Directions Scraper

Pricing

from $1.40 / 1,000 route-computeds

Go to Apify Store
Google Maps Directions Scraper

Google Maps Directions Scraper

Get Google Maps directions as JSON for driving, transit, walking and cycling. Add origins and destinations and get every alternative route with duration, distance, fares, transit lines, platforms, stops and per-leg times. Set a leave-at or arrive-by time and add waypoints. $2.50 per 1,000 routes.

Pricing

from $1.40 / 1,000 route-computeds

Rating

0.0

(0)

Developer

BonCross API

BonCross API

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

14 days ago

Last modified

Share

What is Google Maps Directions Scraper?

Type "King's Cross Station, London -> Heathrow Terminal 5" and Google Maps Directions Scraper gives you the routes Google Maps would show, as JSON: driving, transit, walking and cycling, with the alternatives and not just the first suggestion. You don't need a Google API key or a Google Cloud project. Place names, addresses or coordinates go in, and durations, distances, fares and transit legs come out.

What you get that a plain distance lookup doesn't:

  • The alternatives. You typically get 3 for a road route and up to 6 for transit, ranked as Google ranks them.
  • Transit you can follow. Each leg has its line and colour, headsign, service pattern, operator, platform and stop codes. A Tokyo subway run returned platform numbers and stop codes such as A18.
  • Time-aware routing. Set a leave-at or arrive-by time in the route's own local time, per route or for the whole run.
  • The route options from the Maps panel. Avoiding ferries took Seattle to Bainbridge Island from the 10.7-mile ferry route to a 92.5-mile drive round.
  • Bulk speed. 120 routes in three modes (360 rows) took 16 seconds.
  • $2.50 per 1,000 routes on the Free plan and $1.40 on Business, alternatives and legs included.

BonCross Verified means we tested this actor against the live site before release and kept the record:

  • 27 of 27 live checks on its inputs and filters passed on 7 October 2026
  • 13 routes run the same day on five continents, in 2 travel modes: 18 routes, 8 error rows
  • Charges matched the rows: 18 computed, 8 checked
  • A route that cannot be computed gets a row saying why

What you can do with it:

  • Route between place names, addresses or coordinates, with waypoints on road routes
  • Compare modes for the same pair of places in a single run
  • Read transit lines, headsigns, service patterns, operators, platforms and stop codes
  • Avoid tolls, highways or ferries when driving
  • Prefer fewer transfers, less walking or a vehicle type on transit
  • Read fares where Google shows them
  • Fall back to a comparable weekday when a date is past the published timetable
  • Read durations and distances as numbers, with Google's own wording kept beside them

It doesn't return turn-by-turn steps or live traffic. If you need either, read the Limitations section below before you run it.

What route data do you get?

Route alternatives, ranked⏱ Duration in seconds and text
📏 Distance in metres and textDeparture and arrival times
💴 Fare where Google shows oneNumber of transfers
🚇 Transit line names and colours🚌 Vehicle type and operator
Headsign and service patternFrom and to stop names
Stop codesPlatform
🚶 Per-leg mode and timingsVia roads for driving routes
📍 Resolved origin, destination and stopsTime zone of the route
🗺 Matching Google Maps link📅 Substituted date when the fallback is used

How to get Google Maps directions

A route can be as short as one line of text, and there's no code to write.

  1. Create a free Apify account and open Google Maps Directions Scraper.
  2. Add your routes. Origin -> Destination is enough for a simple one.
  3. Tick the travel modes you want. Transit is selected to begin with.
  4. Add a departure or arrival time if the trip isn't for right now.
  5. Click Start, then download the routes as JSON, CSV, Excel, XML or HTML.

⬇️ Input

Each entry in "Routes" is one trip. Write it as a string, "King's Cross Station, London -> Heathrow Terminal 5", or as an object when you want a time or stops along the way. Origins, destinations and waypoints can be place names, addresses or lat,lng coordinates. Times are written YYYY-MM-DDTHH:MM in the route's own local time, and a route with no time means leave now.

"Travel modes" decides how many rows you get: each route is requested once per mode, and a run returns one row per route and mode. Six routes in transit and driving is twelve rows.

"Region" is the country Google assumes when a place name is ambiguous. "Springfield" to "Boston" finds a drive with us and no route with gb. It doesn't change the units: distances come in the units of the country the route is in. "Language" (default en) sets the language of names, road labels and line labels.

Waypoints work on driving, walking and cycling routes. Google Maps doesn't plan public transport through stops, so leave them off transit routes.

Transit between two places at a given time

{
"routes": [
{ "origin": "King's Cross Station, London", "destination": "Heathrow Terminal 5", "departAt": "2026-10-27T09:00" }
],
"modes": ["transit"],
"language": "en",
"region": "gb"
}

Arrive-by, several routes, driving and transit compared

{
"routes": [
"Times Square, New York -> JFK Airport",
"Times Square, New York -> Brooklyn Bridge",
{ "origin": "Times Square, New York", "destination": "LaGuardia Airport", "arriveBy": "2026-11-03T10:00" }
],
"modes": ["transit", "driving"],
"region": "us"
}

Route options: fewer transfers, no tolls

The route preferences are the choices in the Google Maps route options panel. "Avoid tolls", "Avoid highways" and "Avoid ferries" apply to driving routes. With tolls avoided, Tokyo Station to Yokohama was 30.1 km on national roads where the default was 36.0 km on the expressway. With ferries avoided, Seattle to Bainbridge Island drives 92.5 miles round where the default takes the 10.7-mile ferry route.

"Transit route preference" (best, fewer transfers or less walking) and "Preferred transit modes" (bus, subway, train, tram) apply to public transport. A preferred mode is a preference, as it is in Google Maps, and a route that mixes in other vehicles can still be returned.

{
"routes": ["Gare du Nord, Paris -> Château de Versailles"],
"modes": ["transit", "driving"],
"transitRoutePreference": "fewerTransfers",
"avoidTolls": true,
"region": "fr"
}

A road trip with waypoints

{
"routes": [
{ "origin": "Paddington Station, London", "destination": "Heathrow Airport", "waypoints": ["Windsor Castle"] }
],
"modes": ["driving"],
"region": "gb",
"maxAlternatives": 1
}

Coordinates in, walking and cycling out

{
"routes": [
{ "origin": "40.7577,-73.9853", "destination": "40.7484,-73.9857" }
],
"modes": ["walking", "cycling"],
"includeLegs": false
}

For developers

  • A route object takes origin, destination, and optionally departAt or arriveBy and waypoints. The run-wide departAt and arriveBy are defaults that a route's own values override, and arriveBy is ignored when departAt is set.
  • maxAlternatives caps the alternatives kept inside each row (default 0, meaning all that Google returns, and at most 10). maxItems caps the routes returned across the whole run (default 0, no limit).
  • includeLegs (default true) keeps the per-leg breakdown on transit: walk and ride legs with line, platform, boarding and alighting stops and times.
  • fallbackToComparableDate (Fall back to a comparable date, default true): transit timetables are only published a few weeks ahead. When a dated transit query returns nothing, the actor retries the latest same weekday that has a timetable and marks the record with substitutedDate. Turn it off to get no route.
  • avoidTolls, avoidHighways, avoidFerries, transitRoutePreference (best, fewerTransfers, lessWalking) and transitModes (bus, subway, train, tram) apply run-wide, to all routes of the matching mode. region defaults to us.
  • maxConcurrency (Parallel requests, default 32, 1 to 32) sets how many requests run at once across the whole run. Lower it only if a run reports errors. delayMs (Delay between requests, default 0) adds an optional pause before each request, in milliseconds.
  • id is stable for the same origin, stops, destination, mode and requested time, which lets you join rows from two runs.
  • Rows are written in the order the routes and modes were given. A run that's moved to another server or restarted carries on where it stopped, without writing or charging any route twice.

⬆️ Output

You get one record per route and mode, viewable as a table or as JSON in the Output tab. best is a summary of the first alternative, and alternatives holds them all.

{
"id": "transit-13e0sct",
"url": "https://www.google.com/maps/dir/King's%20Cross%20Station%2C%20London/Heathrow%20Terminal%205/data=!4m2!4m1!3e3",
"origin": "King's Cross Station, London",
"destination": "Heathrow Terminal 5",
"waypoints": [],
"mode": "transit",
"requestedTime": "2026-10-27T09:00",
"timeKind": "depart",
"substitutedDate": null,
"resolvedOrigin": "King’s Cross, Euston Rd., London N1C 4AP",
"resolvedDestination": "Terminal 5, Wallis Rd, Longford, Hounslow TW6 2GA",
"resolvedStops": [
"King’s Cross, Euston Rd., London N1C 4AP",
"Terminal 5, Wallis Rd, Longford, Hounslow TW6 2GA"
],
"alternativeCount": 6,
"best": { "durationSeconds": 3983, "durationText": "1 hr 7 min", "distanceText": "19.4 miles", "departure": "2026-10-27T09:03:37+00:00", "arrival": "2026-10-27T10:10:00+00:00", "fare": "£5.90", "lines": ["Piccadilly"] },
"alternatives": [
{
"index": 0, "durationSeconds": 3983, "durationText": "1 hr 7 min", "distanceMeters": 31248, "distanceText": "19.4 miles", "via": null, "timezone": "Europe/London",
"departure": "2026-10-27T09:03:37+00:00", "arrival": "2026-10-27T10:10:00+00:00", "fare": "£5.90", "lines": ["Piccadilly"], "transfers": 0,
"legs": [
{ "mode": "walk", "durationText": "4 min", "distanceText": "472 ft", "line": null, "lineColour": null, "vehicle": null, "headsign": null, "servicePattern": null, "operator": null, "from": null, "to": null, "fromStopCode": null, "toStopCode": null, "platform": null, "depart": null, "arrive": null },
{ "mode": "transit", "durationText": "1 hr 3 min", "distanceText": null, "line": "Piccadilly", "lineColour": "#10069f", "vehicle": "Underground", "headsign": "Heathrow Terminal 5", "servicePattern": null, "operator": "Transport for London", "from": "King's Cross St. Pancras", "to": "Heathrow Airport Terminal 5", "fromStopCode": null, "toStopCode": null, "platform": null, "depart": "2026-10-27T09:07:00+00:00", "arrive": "2026-10-27T10:10:00+00:00" }
]
},
"…"
],
"mapsUrl": "https://www.google.com/maps/dir/King's%20Cross%20Station%2C%20London/Heathrow%20Terminal%205/data=!4m2!4m1!3e3",
"scrapedAt": "2026-10-07T19:29:45.469Z"
}

When there's no route, you still get the row. It has alternativeCount: 0, an empty alternatives list and an error field saying why: no routes returned, a date beyond the published timetable, or a stop Google couldn't place, named in the message. That row costs $0.0005 (route-checked) when Google Maps answered with no route, and nothing when the request couldn't be completed.

resolvedOrigin and resolvedDestination show what Google matched your text to. They're worth a glance on any route where the place name could exist in two cities.

In a CSV or Excel export the nested legs are flattened into columns. JSON keeps them nested.

Limitations: no turn-by-turn steps, no live traffic

  • No turn-by-turn steps. Driving, walking and cycling rows give you the alternatives with their via roads and totals. They have no step list and no per-leg detail.
  • No live traffic. A driving duration is Google's typical-traffic estimate for the requested time. There's no duration-in-traffic figure and no traffic condition, and an estimate for a date months ahead is not a promise.
  • Transit fares are Google's and are often missing or approximate. Take the time from here and the fare from the operator when it matters.
  • Beyond the published timetable horizon there are no transit routes. The comparable-date fallback returns typical service for that weekday, clearly marked. It isn't the timetable for your date.
  • The fallback only fires when Google refuses a date. A departure about two years ahead was still accepted and routed normally, so you may rarely see it.
  • The via field is filled for road routes only.
  • A driving row with no requested time can have departure and arrival empty.
  • Waypoints work for driving, walking and cycling. A transit route with waypoints gives you a row explaining that Google Maps doesn't plan public transport through stops, and it isn't charged. Split it into separate routes.
  • Cycling directions exist only where Google Maps offers them. A cycling request in Kyoto returned no route. A row like that has an error and costs the $0.0005 route-checked fee.
  • Google Maps answers no driving or walking routes in South Korea. That's Google's restriction there.
  • A bare place name can match more than one place, and not always the same one. "Statue of Liberty Ferry" resolved to Liberty Island on one run and to the replica in Tokyo on another. Add the city, or use coordinates.
  • Route preferences apply run-wide, and the avoid options to driving only. Wheelchair-accessible transit isn't offered, because it couldn't be shown to change any route.

How many routes can you get, and how fast?

RunRowsRun time
1 route, transit and walking22 to 3 s
6 routes, transit and driving126 to 7 s
32 routes, driving326 s
120 routes × transit, driving and walking36016 s

Whole runs on Apify at the default settings, measured on 1 and 2 October 2026. That's over a thousand routes a minute.

For a sense of the detail: five routes run in transit and driving were all answered, and between them covered the Tokyo subway with platform and stop codes, Tokyo JR with service pattern, a Kyoto city bus with stop letter, the London Underground to Heathrow with fare, and the New York subway with fare.

Transit routing is limited by the published timetable horizon, which is usually a few weeks to a few months depending on the operator.

How much does it cost?

EventFree planStarterScaleBusiness
actor-start, per run$0.002$0.002$0.002$0.002
route-checked, per route and mode Google Maps answered with no route$0.0005$0.0005$0.0005$0.0005
route-computed, per route and mode with at least one alternative$0.0025$0.00225$0.00195$0.0014

Enterprise plans pay the Business price.

$2.50 per 1,000 routes on the Free plan, $1.40 on Business, alternatives and legs included. That's the full price, with proxy usage and platform usage included. A route Google Maps answers with no route at all costs $0.0005 (route-checked). A route that couldn't be reached, or public transport through stops, is free.

  • An itinerary planner, 25 legs of a trip in transit and driving: $0.002 + 50 × $0.0025 = $0.127 ($0.072 on Business).
  • A daily commute-time monitor, 200 origin and destination pairs by car each weekday morning: $0.002 + 200 × $0.0025 = $0.502 per day ($0.282 on Business).

Apify's Free plan includes $5 of credits a month, enough for about 39 runs the size of that itinerary, or about 1,950 routes.

FAQ

Do I need proxies, a Google API key or a Google account?

None of them. There's no Google Cloud project to create and no key to manage. Proxy usage is included in the event prices, with nothing to set up.

Web scraping is legal when the data is publicly available, which map directions are. This actor reads what Google Maps serves to any visitor, and complying with Google's terms and your local law in how you use the data is your responsibility.

Do I get turn-by-turn steps or live traffic?

Neither, at the moment. Road routes give you alternatives with via roads, distance and a typical-traffic duration. Transit routes are the detailed ones, leg by leg.

How do I set a departure or arrival time?

Per route, add departAt or arriveBy to the route object. For the whole run, fill in "Depart at" or "Arrive by". Both are in the route's local time, and leaving them empty routes for now.

What happens with a date beyond the transit timetable?

With "Fall back to a comparable date" on, the actor retries the latest matching weekday that has a timetable and marks the record with substitutedDate. Turn it off and you get an empty result, billed the $0.0005 route-checked fee.

Why did a route return nothing, and what did it cost?

Usually Google has no route for that mode there (cycling in Kyoto, for one), the date is past the timetable, or a place name couldn't be matched. The row's error says which. It costs $0.0005 where Google answered with no route, against $0.0025 for a route.

How do I compare driving with public transport for the same trip?

Tick both modes. You get one row per route and mode, and the id and the origin and destination columns line them up.

Can I route through several stops?

On driving, walking and cycling routes, add waypoints to the route. For public transport, split the trip into separate routes, one per hop.

Do I get platforms and stop codes?

Where Google shows them. The Tokyo subway run returned platform numbers and stop codes such as A18, and a New York subway run has the line as the vehicle label.

Use the routes in a planner, a sheet or an agent

Itinerary builders and travel products are the usual home for this data: real transit times, platforms and fares for each hop of a trip, without a mapping contract. It also suits commute analysis from a set of addresses to an office, site selection by car and transit reachability, driving-time estimates with waypoints for logistics, and collecting transit data (lines, headsigns, operators, platforms and stop codes).

An Apify Schedule can recompute a set of routes each morning, and a webhook or the Google Sheets integration can file the durations when the run ends.

From code, a POST to https://api.apify.com/v2/acts/boncross~google-maps-directions/run-sync-get-dataset-items with the input JSON in the body returns the routes when the run finishes. apify-client is on NPM for Node.js and PyPI for Python.

A travel-planning agent can call it through the Apify MCP server at mcp.apify.com, where it appears under the name google-maps-directions. The agent asks for a route between two places at a given time and gets durations, fares and transit legs as JSON.

More from BonCross

Your feedback

Got a route that looks wrong, or a city where the transit detail is thin? Raise it on the Issues tab in Apify Console and include the route. We read each one, and it's also the place to tell us how much you need steps or traffic.