Google API: Get directions
Gets up to three Google Maps routes between two places, with distances, travel times and step-by-step directions.
Unofficial. Not affiliated with or endorsed by Google.
Inputs
Values from the run on Nov 2, 2026, shown under Output.
- Avoid optional
avoid A road feature to avoid, such as tolls; defaults to none.
none
One of
none,tolls,highways,ferries. Defaultnone.- Origin, required
origin Starting address, place name or city, such as Golden Gate Bridge.
Golden Gate Bridge
- Destination, required
destination Destination address, place name or city, such as Stanford University.
Stanford University
- Travel Mode optional
travel_mode How to travel, such as walking; defaults to driving.
driving
One of
driving,walking,cycling,public_transit. Defaultdriving.- Departure Time optional
departure_time Departure date and time with time zone offset, such as 2026-10-01T09:00:00-07:00; defaults to now.
Not set
Input as JSON
{ "avoid": "none", "origin": "Golden Gate Bridge", "destination": "Stanford University", "travel_mode": "driving"}Output
{ "routes": [ { "steps": [ { "time": "3 min", "to_stop": null, "distance": "2.1 mi", "from_stop": null, "line_name": null, "instruction": "Head southeast on US-101 S", "time_seconds": 167, "departure_time": null, "distance_metres": 3428 }, { "time": "14 sec", "to_stop": null, "distance": "0.2 mi", "from_stop": null, "line_name": null, "instruction": "Use the right 2 lanes to take exit 438", "time_seconds": 14, "departure_time": null, "distance_metres": 288 }, { "time": "6 min", "to_stop": null, "distance": "2.5 mi", "from_stop": null, "line_name": null, "instruction": "Continue onto CA-1", "time_seconds": 359, "departure_time": null, "distance_metres": 4062 } ], "summary": "I-280 S", "page_link": "https://www.google.com/maps/dir/Golden+Gate+Bridge,+Golden+Gate+Brg,+San+Francisco,+CA/Stanford+University,+450+Jane+Stanford+Way,+Stanford,+CA+94305/data=!4m14!4m13!1m5!1m1!1s0x808586deffffffc3:0xcded139783705509!2m2!1d-122.4785598!2d37.819910899999996!1m5!1m1!1s0x808fbb2a678bea9d:0x29cdf01a44fc687…" , "distance_km": 61.9, "travel_time": "43 min", "distance_miles": 38.5, "distance_metres": 61933, "travel_time_seconds": 2606 }, { "steps": [ { "time": "3 min", "to_stop": null, "distance": "2.1 mi", "from_stop": null, "line_name": null, "instruction": "Head southeast on US-101 S", "time_seconds": 167, "departure_time": null, "distance_metres": 3428 }, { "time": "14 sec", "to_stop": null, "distance": "0.2 mi", "from_stop": null, "line_name": null, "instruction": "Use the right 2 lanes to take exit 438", "time_seconds": 14, "departure_time": null, "distance_metres": 288 }, { "time": "6 min", "to_stop": null, "distance": "2.5 mi", "from_stop": null, "line_name": null, "instruction": "Continue onto CA-1", "time_seconds": 359, "departure_time": null, "distance_metres": 4062 } ], "summary": "CA-1 and I-280 S", "page_link": "https://www.google.com/maps/dir/Golden+Gate+Bridge,+Golden+Gate+Brg,+San+Francisco,+CA/Stanford+University,+450+Jane+Stanford+Way,+Stanford,+CA+94305/data=!4m14!4m13!1m5!1m1!1s0x808586deffffffc3:0xcded139783705509!2m2!1d-122.4785598!2d37.819910899999996!1m5!1m1!1s0x808fbb2a678bea9d:0x29cdf01a44fc687…" , "distance_km": 60.9, "travel_time": "47 min", "distance_miles": 37.8, "distance_metres": 60870, "travel_time_seconds": 2828 }, { "steps": [ { "time": "6 min", "to_stop": null, "distance": "3.7 mi", "from_stop": null, "line_name": null, "instruction": "Head southeast on US-101 S", "time_seconds": 353, "departure_time": null, "distance_metres": 6019 }, { "time": "4 min", "to_stop": null, "distance": "0.9 mi", "from_stop": null, "line_name": null, "instruction": "Use any lane to turn slightly left onto Lombard St", "time_seconds": 246, "departure_time": null, "distance_metres": 1524 }, { "time": "11 min", "to_stop": null, "distance": "1.9 mi", "from_stop": null, "line_name": null, "instruction": "Turn right onto Gough St", "time_seconds": 665, "departure_time": null, "distance_metres": 3117 } ], "summary": "US-101 S", "page_link": "https://www.google.com/maps/dir/Golden+Gate+Bridge,+Golden+Gate+Brg,+San+Francisco,+CA/Stanford+University,+450+Jane+Stanford+Way,+Stanford,+CA+94305/data=!4m14!4m13!1m5!1m1!1s0x808586deffffffc3:0xcded139783705509!2m2!1d-122.4785598!2d37.819910899999996!1m5!1m1!1s0x808fbb2a678bea9d:0x29cdf01a44fc687…" , "distance_km": 63.3, "travel_time": "49 min", "distance_miles": 39.3, "distance_metres": 63284, "travel_time_seconds": 2962 } ], "end_address": "Stanford University, 450 Jane Stanford Way, Stanford, CA 94305", "start_address": "Golden Gate Bridge, Golden Gate Brg, San Francisco, CA"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"google.com/get_directions","input":{"avoid":"none","origin":"Golden Gate Bridge","destination":"Stanford University","travel_mode":"driving"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "google.com/get_directions" , "input": { "avoid": "none", "origin": "Golden Gate Bridge", "destination": "Stanford University", "travel_mode": "driving" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "google.com/get_directions" , "input": { "avoid": "none", "origin": "Golden Gate Bridge", "destination": "Stanford University", "travel_mode": "driving" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run google.com/get_directions# with {"avoid":"none","origin":"Golden Gate Bridge","destination":"Stanford University","travel_mode":"driving"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "origin", "destination" ], "properties": { "avoid": { "enum": [ "none", "tolls", "highways", "ferries" ], "type": "string", "default": "none", "description": "A road feature to avoid, such as tolls; defaults to none." }, "origin": { "type": "string", "minLength": 1, "description": "Starting address, place name or city, such as Golden Gate Bridge." }, "destination": { "type": "string", "minLength": 1, "description": "Destination address, place name or city, such as Stanford University." }, "travel_mode": { "enum": [ "driving", "walking", "cycling", "public_transit" ], "type": "string", "default": "driving", "description": "How to travel, such as walking; defaults to driving." }, "departure_time": { "type": "string", "description": "Departure date and time with time zone offset, such as 2026-10-01T09:00:00-07:00; defaults to now." } }}Output schema
{ "type": "object", "required": [ "start_address", "end_address", "routes" ], "properties": { "routes": { "type": "array", "items": { "type": "object", "properties": { "steps": { "type": "array", "items": { "type": "object", "properties": { "time": { "type": [ "string", "null" ] }, "to_stop": { "type": [ "string", "null" ] }, "distance": { "type": [ "string", "null" ] }, "from_stop": { "type": [ "string", "null" ] }, "line_name": { "type": [ "string", "null" ] }, "instruction": { "type": "string" }, "time_seconds": { "type": [ "integer", "null" ] }, "departure_time": { "type": [ "string", "null" ] }, "distance_metres": { "type": [ "integer", "null" ] } } } }, "summary": { "type": "string" }, "page_link": { "type": "string" }, "distance_km": { "type": "number" }, "travel_time": { "type": "string" }, "distance_miles": { "type": "number" }, "distance_metres": { "type": "integer" }, "travel_time_seconds": { "type": "integer" } } } }, "end_address": { "type": "string" }, "start_address": { "type": "string" } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
google.com/get_directions- Returns
- start and end address, routes with summary, distance, travel time, steps, page link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method google.com/get_directions with the inputs above.
Ask your agent
- How long does it take to drive from Lisbon airport to the old town center, and what are the turn-by-turn steps?
- Walking route from Central Park South to the Brooklyn Bridge, with distance and estimated time please.
- Find me a driving route from Seattle to Portland that avoids tolls, leaving at 7:30 AM Pacific on October 3, 2026.
- What are the cycling options from Amsterdam Centraal to Vondelpark, and which one is shortest?
- Get public transit directions from 221B Baker Street, London to King's Cross Station for a departure at 8:15 AM on 2026-10-05 in GMT+1, showing all the steps.
See more
All Google methodsFinds Google Flights options for a route and date with prices, local times, stops and emissions. Round-trip searches list outbound choices with their displayed round-trip fares.
google.com/search_flightsLooks up a public Google Maps place by name and location and returns its profile: address, rating, hours, phone, website and photos.
google.com/get_placeFinds businesses and places near a location on Google Maps, in Google Maps order, with rating, hours, contact details and links when shown.
google.com/search_placesLists cheap round-trip destinations from a city on Google Travel Explore, sorted by fare, optionally within a region, travel month, trip length and nonstop only. Links search Google Flights for the shown dates.
google.com/list_cheap_destinationsFinds places to stay in a city or area for given dates on Google Hotels, with nightly and total prices, hotel class, guest ratings, amenities, address and cheapest booking site. Optional filters for price, stars and rating; vacation rentals are left out. Prices and availability can change.
google.com/search_hotelsFinds a place on Google Maps by name and location and returns its public reviews in the chosen order.
google.com/get_place_reviewsFinds the lowest Google Flights fare for each departure date in a month between two places, for one-way trips or a fixed trip length, with the cheapest option and any price insight shown.
google.com/get_cheapest_datesFinds a hotel on Google Hotels by name and city and returns its guest reviews in the chosen order, its Google rating and review count, and topic ratings averaged from the returned reviews that rate each topic.
google.com/get_hotel_reviews