PeumeAPI

Places & travel · Google Maps

Get Route Directions

Get Google Maps directions, distances, and durations between places.

$0.023 per call

Call it

curl https://api.peume.com/v1/call/google-maps-get-route-directions \
  -H "Authorization: Bearer $PEUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "end_addr": "your end addr",
    "hl": "your hl"
  }
}'

Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: google-maps-get-route-directions.

Parameters

end_addrstring

The address of the ending point for the direction you want to search. You can use anything that you would use in a regular Google Maps Directions search. Alternatively, you can use `end_data_id` or `end_coords`.

hlstring

The language to use for the Google Maps Directions search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e.g., `en-gb` for British English, or `es-419` for Latin American Spanish).

end_coordsstring

The GPS coordinates of the ending point for the direction you want to search. The format is `latitude,longitude`. E.g. `30.197471099,-97.66635289`. Alternatively, you can use `end_addr` or `end_data_id`.

preferstring

Preferred transit options. Available options: `bus` - Bus `subway` - Subway `train` - Train `tram_light_rail` - Tram and light rail You can also combine multiple options by joining them with a comma (e.g.: `subway,train`). Parameter works only if `travel_mode` parameter is set to: `3` (Transit)

glstring

The country to use for the Google search. It's a two-letter country code. (e.g., `us` for the United States, `uk` for United Kingdom, or `fr` for France)

start_coordsstring

The GPS coordinates of the starting point for the direction you want to search. The format is `latitude,longitude`. E.g. `30.197471099,-97.66635289`. Alternatively, you can use `start_addr` or `start_data_id`.

routestring

Route options. Available options: `2` - Fewer transfers `3` - Less walking `4` - Wheelchair accessible Parameter works only if `travel_mode` parameter is set to: `3` (Transit)

travel_modestring

The travel mode. Available options: `6` - Best (Default) `0` - Driving `9` - Two-wheeler `3` - Transit `2` - Walking `1` - Cycling `4` - Flight

end_data_idstring

The data ID of the ending point for the direction you want to search. Find the data ID of a place using our Google Maps API. Alternatively, you can use `end_addr` or `end_coords`.

avoidstring

Avoid options. Available options: `highways` - Highways `tolls` - Tolls `ferries` - Ferries You can also combine multiple options by joining them with a comma (e.g.: `highways,tolls`).

timestring

The time to travel. Available options: `depart_at:xxxxxx` - Specifies the departure time, where `xxxxxx` is the timestamp. E.g. `depart_at:1698229538` specifies the departure time to 2023-10-25 10:25:38 GMT+0000 `arrive_by:xxxxxx` - Specifies the arrival time, where `xxxxxx` is the timestamp. E.g. `arrive_by:1698229538` specifies the arrival time to 2023-10-25 10:25:38 GMT+0000 `last_available` - Takes the last available transit. This option works only if `travel_mode` parameter is set to: `3` (Transit)

start_addrstring

The address of the starting point for the direction you want to search. You can use anything that you would use in a regular Google Maps Directions search. Alternatively, you can use `start_data_id` or `start_coords`.

distance_unitstring

The displayed distance unit. Available options: `1` - miles `0` - km

start_data_idstring

The data ID of the starting point for the direction you want to search. Find the data ID of a place using our Google Maps API. Alternatively, you can use `start_addr` or `start_coords`.

json_restrictorstring

The fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.

Start free · $1 of calls included

Every API your product needs. One key.

7,267 endpoints, one bill, and you only pay for calls that work.