Go to example tasks

Get Travel Time Between Two Addresses by API

Get travel time between two addresses by driving, transit, walking, or cycling. Returns best_duration, best_distance, and per-mode durations.

Try for free
Google Maps Directions API
Google Maps Directions APIjohnvc/google-maps-directions-api
Result Type
Start
End
Travel Mode
+5 fields
Text
Number
Boolean
List
Object

Input

Start Address:San Francisco, CA
End Address:Palo Alto, CA
Travel Mode:best

Output fields

Result Type
Start
End
Travel Mode
Route Options
Best Duration
Best Distance
Google Maps URL
Fetched At

How it works

Sign up on Apify or log in

The Google Maps Directions API Actor is ready to run with the inputs already set for "Get Travel Time Between Two Addresses by API". Sign up or log in and you'll land in Apify Console with a copy of this exact task.

Start the "Get Travel Time Between Two Addresses by API" task

The Google Maps Directions API Actor will start running based on the input automatically. You can also change all the input fields, like start address, end address, and more, to match your specific use case.

Receive the "Get Travel Time Between Two Addresses by API" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as result type, start, end, and more.

Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also run the "Get Travel Time Between Two Addresses by API" task via API.

Image

Integrate "Get Travel Time Between Two Addresses by API" into your workflow

Connect "Get Travel Time Between Two Addresses by API" with 100+ integrations, or run it via API or MCP.

Webhook

Webhook

n8n

n8n

Make

Make

Zapier

Zapier

Airbyte

Airbyte

Keboola

Keboola

IFTTT

IFTTT

Hubspot

Hubspot

GDrive

GDrive

Gmail

Gmail

Apify MCP

Apify MCP

GitHub

GitHub

Slack

Slack

LangChain

LangChain

LlamaIndex

LlamaIndex

Flowise

Flowise

Pinecone

Pinecone

OpenAI

OpenAI

Mastra

Mastra

Clay

Clay

Frequently asked questions

Get Travel Time Between Two Addresses by API returns best_duration and best_distance across modes, a durations list with the time for each mode such as driving and transit, plus start, end and google_maps_directions_url.

Replace start_addr San Francisco, CA and end_addr Palo Alto, CA with your own addresses and keep travel_mode best for every mode at once. Set time_type to depart_at with a time_value to get a future departure's ETA.

Run the task from its endpoint on the Apify API or with apify-client in Python or Node, one origin and destination pair at a time. Read best_duration from the JSON row, or the durations list when you need each mode.

In the Apify Console choose Actions, then Schedule, and set 30 17 * * 1-5 for weekdays at 5:30 PM. With travel_mode best, each run records the evening trip time by mode; export the dataset to chart it.

Add https://mcp.apify.com/?tools=actors,docs,johnvc/google-maps-directions-api to Claude or any MCP client and ask how long San Francisco to Palo Alto takes by train versus car. The agent reads the durations list.

Each travel time lookup is one directions_processed event plus the run's setup event, even when travel_mode best returns several modes in that one charge. See the Actor page for current prices.

Get Travel Time Between Two Addresses by API focuses on best_duration and the per-mode durations list. Get Google Maps directions by API as JSON keeps the full driving route, with each turn-by-turn step and its distance.