Google Maps Directions, Traffic & Distance Matrix avatar

Google Maps Directions, Traffic & Distance Matrix

Pricing

from $2.00 / 1,000 directions results

Go to Apify Store
Google Maps Directions, Traffic & Distance Matrix

Google Maps Directions, Traffic & Distance Matrix

Gets Google Maps routes, travel times, live and predicted traffic, distance matrices, traffic time series and transit itineraries with fares for driving, transit, walking and cycling. No API key.

Pricing

from $2.00 / 1,000 directions results

Rating

0.0

(0)

Developer

Actor stats

0

Bookmarked

3

Total users

2

Monthly active users

3 days ago

Last modified

Share

Get routes, travel times, live and predicted traffic, distance matrices, traffic time series, public-transit timetables, lines and fares from Google Maps — for driving, transit, walking and cycling. No API key, no browser, no Google Cloud billing.

What makes it different

  • 🧮 Distance matrix built in — paste N origins and M destinations, get every pair plus a ready-to-use matrix (seconds / meters) in the OUTPUT record.
  • 📈 Traffic profile (time series) — the same route measured every N minutes across one or more days: find rush hours, the best time to leave, delivery windows.
  • 🚦 Rich traffic data — duration in traffic, duration without traffic, Google's typical range ("35 min to 1 hr"), traffic level, delay in seconds, and a speed profile along the route.
  • 🚆 Full transit itineraries — departure/arrival times with time zones, lines with colours, headsigns, boarding/alighting stops with coordinates, number of stops, operators, fares, transfers, walking distance and service alerts.
  • 🔗 Many inputs in one run — route lists, origin × destination matrices and pasted Google Maps links, combined with several travel modes and time slots.
  • ⚡ Fast and cheap — pure HTTP; hundreds of routes per minute on 512 MB.

Use cases

  • Logistics & last mile: travel-time matrices between depots and customers, delivery-window planning by hour.
  • Real estate & retail location: commute times and catchment areas by car and public transport.
  • Mobility & urban research: congestion profiles of corridors, transit vs car comparisons, time series for dashboards.
  • Travel & HR tools: door-to-door itineraries with timetables and fares, employee commute studies.
  • AI agents: structured directions for any trip in one call.

Input

In Apify Console everything is point-and-click: route rows with an origin and destination field, dropdowns for travel mode and time, a calendar for dates, and multi-select chips for weekdays and transit vehicles.

Routes — one row per trip (origin, destination, optional mode, stops in between and a label). Places can be addresses, place names or lat,lng.

📋 Bulk routes — paste hundreds of routes at once, one per line: Origin -> Destination, Origin | Destination, or two columns copied straight from Excel / Google Sheets.

🕒 When — Leave now, Depart at or Arrive by, with a calendar Date and a Time dropdown (local time at the origin). Dates can also be relative — 1 day means tomorrow — so scheduled runs always look ahead.

Via API:

{
"routes": [
{ "origin": "Madrid, Spain", "destination": "Barcelona, Spain", "label": "Road trip" },
{ "origin": "Berlin Hauptbahnhof", "destination": "München Hbf", "travelMode": "transit" },
{ "origin": "Madrid, Spain", "destination": "Barcelona, Spain", "waypoints": ["Zaragoza, Spain"] }
],
"routesBulk": ["40.4168,-3.7038 -> 41.3874,2.1686"],
"timeMode": "depart_at",
"travelDate": "1 day",
"travelTime": "08:30"
}

API users can also set departureTime / arrivalTime (YYYY-MM-DDTHH:MM) and avoidTolls / avoidHighways / avoidFerries on individual routes.

Distance matrix

{
"origins": ["Getafe, Spain", "Alcobendas, Spain"],
"destinations": ["Plaza de Castilla, Madrid", "Atocha, Madrid", "Madrid-Barajas Airport T4"],
"travelModes": ["driving", "transit"]
}

2 × 3 pairs × 2 modes = 12 results.

Traffic profile (time series)

Pick a date range in the calendar, optionally keep only some weekdays, and choose the hours and the interval:

{
"routes": [{ "origin": "Getafe, Spain", "destination": "Plaza de Castilla, Madrid" }],
"trafficProfileStartDate": "2026-11-02",
"trafficProfileEndDate": "2026-11-29",
"trafficProfileWeekdays": ["mon", "fri"],
"trafficProfileStartTime": "06:00",
"trafficProfileEndTime": "22:00",
"trafficProfileInterval": "30"
}

8 days (4 Mondays + 4 Fridays) × 33 departures = 264 results. Use future dates for Google's predicted traffic; relative dates (1 day … 7 days) work for scheduled weekly runs.

Other options

FieldDescription
travelModesModes for routes set to Default (select several to compare modes).
directionsUrlsGoogle Maps directions links — stops and mode are read from the link.
avoidTolls, avoidHighways, avoidFerriesDriving avoidances.
transitTypesPrefer bus, subway, train, tram.
transitRoutePreferencebest, fewer_transfers, less_walking, wheelchair (beta).
maxRoutesAlternatives kept per request (default 3).
outputFormatrequest (one row per request) or route (one row per alternative).
includeSteps, stepsForAllRoutes, includePolyline, includeDetailedPolyline, includeSpeedProfile, includeStreetViewControl output detail. includeDetailedPolyline adds the full-resolution geometry (every curve).
fixAmbiguousPlacesOn by default: if a bare city name resolves to a business with the same name, retry once with the country added (recorded in geocodeCorrections).
language, countryCodeOutput language (40+) and region bias for ambiguous place names.

Output

One item per request. The best route is flattened into columns (easy CSV/Excel export) and every alternative is kept in routes.

{
"origin": "Getafe, Spain",
"destination": "Plaza de Castilla, Madrid",
"travelMode": "driving",
"timeMode": "depart_at",
"requestedTime": "2026-10-14T08:30",
"status": "OK",
"via": "A-42 and M-30",
"distanceMeters": 25770,
"distanceText": "25.8 km",
"durationSeconds": 1882,
"durationInTrafficSeconds": 2700,
"durationInTrafficText": "45 min",
"typicalMinSeconds": 2100,
"typicalMaxSeconds": 3600,
"typicalRangeText": "35 min to 1 hr",
"trafficLevel": "heavy",
"trafficDelaySeconds": 1001,
"arrivalTime": "2026-10-14T09:30:00+02:00",
"hasTolls": false,
"resolvedOrigin": { "name": "Getafe, Madrid, Spain", "placeId": "ChIJAYK7HpogQg0R_ELkt5D6wyA", "location": { "lat": 40.3082504, "lng": -3.7323934 } },
"routeCount": 3,
"routes": [
{
"rank": 1,
"summary": "A-42 and M-30",
"distance": { "meters": 25770, "km": 25.77, "miles": 16.013, "text": "25.8 km" },
"duration": { "seconds": 1882, "minutes": 31.4, "text": "31 min" },
"description": "Fastest route now due to traffic conditions",
"traffic": {
"durationInTraffic": { "seconds": 2700, "text": "45 min" },
"durationWithoutTraffic": { "seconds": 1699, "text": "28 min" },
"typicalDurationRange": { "minSeconds": 2100, "maxSeconds": 3600, "text": "35 min to 1 hr" },
"trafficLevel": "heavy",
"arriveAround": { "localIso": "2026-10-14T09:30:00+02:00", "timezone": "Europe/Madrid" },
"speedSummary": { "averageSpeedKmh": 37.5, "distanceMetersBySpeed": { "under20kmh": 2898, "20to50kmh": 12021, "50to80kmh": 7485, "over80kmh": 3358 } }
},
"steps": [
{ "instruction": "Turn right onto C. Leganés", "maneuver": "turn-right", "distance": { "meters": 73, "text": "73 m" }, "duration": { "seconds": 20, "text": "20 sec" }, "startLocation": { "lat": 40.3072, "lng": -3.7338 } }
],
"overviewPolyline": "mm~uFdsoU_c@~u@|c@p}B..."
}
],
"googleMapsUrl": "https://www.google.com/maps/dir/Getafe,%20Spain/Plaza%20de%20Castilla,%20Madrid/data=!4m2!4m1!3e0"
}

Transit routes add departureTime, arrivalTime, fare (amount, currency), transitLines (vehicle, line, agency, from/to stop, number of stops), numTransfers, walkingDistanceMeters, agencies and, in steps, line colours, headsigns, stop coordinates, timetable times and service alerts.

status is OK, NO_ROUTE (Google has no route for that mode/time — e.g. no ferry at that hour) or ERROR. You are charged only for OK results.

Place names: get the right place every time

Google resolves free text, so bare names can be ambiguous ("Springfield", "Palma", "Barcelona"). Every result includes resolvedOrigin / resolvedDestination (name, Google placeId, coordinates) so you can verify what was used, and geocodeWarnings flags doubtful matches. For best results use city + country, full addresses, or lat,lng coordinates.

Field notes

  • duration is Google's base route duration; durationInTraffic is the traffic-aware estimate for the requested time; typicalDurationRange is the range Google shows as "typically …"; arriveAround is Google's conservative ETA (it uses the upper part of the range).
  • Times you send are local wall-clock times at the origin; returned times include the time zone and UTC offset.
  • The polyline is Google's overview for driving and a maneuver-level path for the other modes.

Pricing

Pay per event — you only pay for successful results:

EventPrice
Directions result (status OK)$2.00 per 1,000 ($0.002 each)
Actor start$0.003 per run (one event per GB of memory; default 512 MB = one event)
  • One directions request = one result, whatever the number of alternatives, steps or transit details returned.
  • Matrix pairs, extra travel modes and traffic-profile time slots each count as one result.
  • NO_ROUTE and ERROR results are free; the automatic retry for ambiguous place names is not charged twice.
  • Set Max cost per run in the run options to cap spending — the actor stops cleanly when it is reached.

Examples: one route = $0.005 · 10 × 10 driving matrix = $0.203 · 20 routes every 30 min from 06:00 to 22:00 on 5 days (3,300 results) = $6.60.

FAQ

Do I need a Google API key? No.

How fresh is traffic? "Leave now" uses Google's live traffic; future departures use Google's traffic prediction for that day and time.

Why does a route return NO_ROUTE? Google has no itinerary for that mode or time (e.g. transit at night, a ferry crossing outside its timetable, intercontinental driving).

Is this legal? The actor reads publicly available route information. You are responsible for using the data in line with applicable laws and the terms of the sources.