routes_compute
Calculate optimal routes between locations using real-time traffic, toll data, and alternative options for driving, walking, cycling, or transit.
Instructions
Calculate optimal routes between locations with real-time traffic data, toll information, and alternative route options. Supports multiple travel modes including driving, walking, cycling, and transit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | Unit system for distances | |
| origin | Yes | Starting location for the route. Provide either coordinates like {"lat": 37.7749, "lng": -122.4194} or an address like {"address": "123 Main St, San Francisco, CA"} | |
| region | No | Region code for biasing results (ISO 3166-1 alpha-2, e.g., "US", "GB", "DE") | |
| language | No | Language code for results (ISO 639-1, e.g., "en", "es", "fr") | |
| waypoints | No | Optional intermediate stops along the route. Each waypoint should have a "location" (coordinates or address) and optionally "via": true for pass-through points. Example: [{"location": {"lat": 38.0, "lng": -122.0}, "via": false}] | |
| avoid_tolls | No | Avoid toll roads | |
| destination | Yes | Ending location for the route. Provide either coordinates like {"lat": 40.7128, "lng": -74.0060} or an address like {"address": "456 Broadway, New York, NY"} | |
| travel_mode | No | Transportation mode for the route | |
| avoid_ferries | No | Avoid ferries | |
| avoid_highways | No | Avoid highways | |
| routing_preference | No | Routing algorithm preference | |
| compute_alternative_routes | No | Whether to compute alternative routes |