Google Maps Route & Distance Matrix Scraper avatar

Google Maps Route & Distance Matrix Scraper

Pricing

from $0.49 / 1,000 results

Go to Apify Store
Google Maps Route & Distance Matrix Scraper

Google Maps Route & Distance Matrix Scraper

Get driving, walking, bicycling or transit routes between two locations - distance, duration, traffic and turn-by-turn steps - or build a travel-time matrix across many origins and destinations in one run.

Pricing

from $0.49 / 1,000 results

Rating

0.0

(0)

Developer

vexaloom-labs

vexaloom-labs

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 hours ago

Last modified

Share

Get Google Maps directions as structured data — route alternatives, multi-stop trips, turn-by-turn steps, live and typical traffic, transit lines and fares, Street View previews, and full origin × destination travel-time matrices. No Google API key, login or cookie is needed.

What this actor does

  • Route mode — one trip with 2–10 ordered stops. Middle stops become waypoints, just like Google Maps' "Add destination" feature.
  • Matrix mode — every origin × destination pair, one row per pair, with distance, duration and traffic estimates.
  • URLs mode — paste public Google Maps directions links, including canonical /maps/dir/... links and short share links.
  • Four travel modes — driving, walking, bicycling and public transit.
  • Route alternatives — Google's recommended route plus the alternatives it returns (usually up to 3); maxAlternatives caps the list at 1–8.
  • Turn-by-turn steps — instruction, distance, duration, maneuver, start/end coordinates, route geometry and optional Street View pano/thumbnail for every route, not just the first one.
  • Traffic detail — current duration, typical duration, no-traffic duration and the expected traffic range for driving routes.
  • Transit detail — line, vehicle, headsign, line colour, departure/arrival times, departure and arrival stops, intermediate stops, agency and fare when Google publishes it.
  • Departure planning — request driving or transit directions for a future departure time, expressed as local time at the origin.
  • Avoid flags — tolls, highways and ferries for driving routes.
  • Localized output — 11 instruction languages and metric or imperial distance formatting.

Fields are omitted when Google does not provide a value. The actor never fills a missing fare, ETA, instruction or coordinate with a guess.

Input

FieldTypeDefaultDescription
modeselectrouteroute, matrix or urls
stopsstring list–Ordered stops for route mode (2–10); the prefill is Times Square → Central Park
originsstring list–Matrix origins
destinationsstring list–Matrix destinations
directionsUrlsrequest list–Google Maps directions links for URLs mode
maxPairsinteger100Maximum matrix pairs (1–1000)
travelModeselectdrivingdriving, walking, bicycling or transit
avoidTollsbooleanfalseDriving only
avoidHighwaysbooleanfalseDriving only
avoidFerriesbooleanfalseDriving only
departureTimetext–ISO 8601 datetime in the origin's local time; driving and transit
maxAlternativesinteger5Route alternatives per trip (1–8)
maxItemsinteger50Global record cap (1–1000)
includeStepsbooleantrueTurn-by-turn steps and geometry
includeStreetViewbooleanfalseStreet View pano ID and thumbnail per step
languageselectenInstruction language
unitsselectmetricmetric or imperial formatting
requestDelayMsinteger250Pause between requests (0–5000 ms)
proxyConfigurationproxy–Optional fallback; direct requests are tried first

Existing saved tasks that still send origin and destination keep working: the actor maps them to the first and last stop automatically.

Output: route records

Each route alternative becomes one record:

  • origin, destination, stops[], waypoints[] — your inputs plus Google's resolved names, addresses, coordinates and place IDs
  • originResolved, destinationResolved, originCoords, destinationCoords
  • recordType, routeIndex, routeName, routeSummary, isRecommended
  • distance, distanceMeters, distanceText — formatted distance, exact meters, and Google's original text
  • duration, durationSeconds, durationText
  • durationInTraffic, durationInTrafficSeconds
  • typicalDuration, typicalDurationSeconds, noTrafficDuration, noTrafficDurationSeconds, trafficRange, trafficRangeMinSeconds, trafficRangeMaxSeconds, trafficLevel, trafficCondition
  • via — the main road or highway
  • departureTime, arrivalTime, transitWindow, plus ISO timestamps and timezone for transit
  • fare, fares[], transit and transitSegments[] — line, vehicle, headsign, colour, stops, times and fare
  • steps[] — instruction, instruction parts, maneuver, distance, duration, start/end coordinates, Street View fields and notes
  • geometry[] — route geometry built from step coordinates
  • legs[] — per-leg distance, duration and step range for multi-stop trips
  • availableModes[] — Google's duration comparison for driving, walking, bicycling and transit
  • avoidanceUnmet[] — set when an avoidance request could not be honoured
  • notes[], googleMapsUrl, sourceUrl, inputUrl, scrapedAt

Output: matrix records

Matrix mode adds originIndex, destinationIndex, pairIndex and routesAvailable to the best route for each pair. recordType is matrix. maxPairs caps requested pairs and maxItems caps pushed rows.

Examples

Driving route with a waypoint

{
"mode": "route",
"stops": [
"New York, NY",
"Hartford, CT",
"Boston, MA"
],
"travelMode": "driving",
"includeSteps": true
}

Transit trip with a future departure

{
"mode": "route",
"stops": ["Heathrow Airport, London", "British Museum, London"],
"travelMode": "transit",
"departureTime": "2026-11-06T13:00:00+00:00",
"maxAlternatives": 6
}

Distance matrix

{
"mode": "matrix",
"origins": [
"Warehouse A, Newark, NJ",
"Warehouse B, Elizabeth, NJ"
],
"destinations": [
"10 Wall St, New York, NY",
"20 Hudson Yards, New York, NY",
"JFK Airport, Queens, NY"
],
"travelMode": "driving",
"maxPairs": 20,
"maxItems": 20
}

Directions URLs

{
"mode": "urls",
"directionsUrls": [
{"url": "https://www.google.com/maps/dir/Times+Square,+New+York,+NY/Central+Park,+New+York,+NY/?travelmode=driving"},
{"url": "https://www.google.com/maps/dir/Heathrow+Airport,+London/British+Museum,+London/?travelmode=transit"}
],
"maxAlternatives": 3
}

Use cases

  • Fleet dispatch and delivery-route planning
  • Commute and relocation comparisons across driving, walking, cycling and transit
  • Travel-time matrices for store, warehouse or service-area analysis
  • Itinerary planning with multi-stop road trips
  • Transit schedule and fare research

FAQ

How many alternatives can I get? maxAlternatives accepts 1–8 as a cap. Google's directions data usually provides up to 3 alternatives; the actor returns exactly what Google provides and never invents a route.

Do steps appear on every alternative? Yes. Every returned route contains its own steps, coordinates and geometry when includeSteps is on. Earlier versions only returned steps for the first route.

How does departure time handle timezones? departureTime is interpreted as the local clock time at the origin, matching Google Maps' "Depart at" control. An ISO 8601 offset is accepted but ignored, so 2026-11-06T13:00:00-05:00 and 2026-11-06T13:00:00 both mean 1 PM at the origin. Transit output also includes departureTimezone and ISO timestamps with the local offset.

Why is a fare or transit line missing from one route? Google only publishes fares and detailed line information for some transit agencies and routes. Those fields are omitted when absent instead of being estimated.

What happens when Google cannot avoid a toll, highway or ferry? Google may still return the only available route. In that case the record is kept and avoidanceUnmet explains which preference could not be met.

How large can a matrix be? maxPairs limits requested pairs (up to 1000) and maxItems limits pushed rows. For a matrix, one row is produced per pair, using Google's recommended route.

Do short share links work in URLs mode? Yes. Both full /maps/dir/... links and short Google Maps share links are resolved before scraping. Travel mode, waypoints and avoid preferences are read from the link when present.

Is an API key, cookie or login required? No. The actor reads the same public directions data Google Maps serves to a browser, without an account, cookie or API key.

Why do distances sometimes differ from Google's displayed text? Google localizes displayed units by country. The actor keeps the original text in distanceText and also converts the exact meter value into your selected units.

Is this affiliated with Google? No. This is an independent, third-party actor and is not affiliated with or endorsed by Google.