Sign in

Compute routes

documented

Compute primary (and optional alternate) routes given waypoints using the Routes API.

POST https://routes.googleapis.com/directions/v2:computeRoutesRoutes APIno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://routes.googleapis.com/directions/v2:computeRoutes" \
  -X POST \
  -d '{ 
    "origin": { 
      "location": { 
        "latLng": { 
          "latitude": {{$origin_latitude}}, 
          "longitude": {{$origin_longitude}} 
        } 
      } 
    },
    "destination": { 
      "location": {
        "latLng": {
          "latitude": {{$destination_latitude}},
          "longitude": {{$destination_longitude}}
        }
      }
    },
    "travelMode": "DRIVE",
    "routingPreference": "TRAFFIC_AWARE",
    "computeAlternativeRoutes": {{$compute_alternative_routes}},
    "routeModifiers": {
      "avoidTolls": {{$avoid_tolls}},
      "avoidHighways": {{$avoid_highways}},
      "avoidFerries": {{$avoid_ferries}}
    },
    "languageCode": "{{$language_code}}",
    "units": "{{$units}}"
  }' \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
  -H "X-Goog-Api-Key: {{MAPS_API_KEY}}" \
  -H "X-Goog-FieldMask: {{$field_mask}}" \
  'https://routes.googleapis.com/directions/v2:computeRoutes'
Compute routes · Google Maps · OpenIntegrations