Directions / routes
directionsCompute a route from origin to destination by DRIVE, WALK, BICYCLE, TRANSIT, or TWO_WHEELER. Use when the user asks how to get somewhere, how far it is, or how long it takes. Origin and destination may be an address string, "lat,lng", or an object with place_id. Returns total duration and distance, an encoded polyline, and per-leg turn-by-turn steps (maneuver, instruction text, distance, duration, start/end lat/lng).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin | Yes | Address string, 'lat,lng', or {address|place_id|latitude,longitude} | |
| field_mask | No | Optional Routes X-Goog-FieldMask override. Default includes turn-by-turn navigationInstruction without Pro fields (localizedValues, travelAdvisory). | |
| destination | Yes | Address string, 'lat,lng', or {address|place_id|latitude,longitude} | |
| travel_mode | No | DRIVE, WALK, BICYCLE, TRANSIT, TWO_WHEELER | |
| alternatives | No | ||
| intermediates | No | ||
| language_code | No |