A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/routes/compute-route-over below:

Compute Routes Overview | Routes API

Skip to main content Compute Routes Overview

Stay organized with collections Save and categorize content based on your preferences.

Introduction

Compute Routes is a method in the Routes API service that accepts an HTTPS request and returns the ideal route between two locations. Provide directions with real-time traffic for transit, biking, driving, 2-wheel motorized vehicles, or walking between multiple locations.

Need Route Matrixes? If you are interested in a route matrix, see Compute Route Matrix Overview.

Migrating? If you are migrating from the Distance Matrix API (Legacy), see migration instructions starting with Why migrate to the Routes API.

Why use Compute Routes

With Compute Routes, with a wide range of route details you can route your vehicles or packages according to your preferences while optimizing for cost and quality.

What you can do with Compute Routes?

With the Routes API Compute Routes method, you can do the following things:

How Compute Routes works

The Routes API ComputeRoutes method accepts an HTTP POST request with a JSON request body that contains the request details. Required are an origin, destination, travelMode, and a field mask to specify which fields to return.

Example
curl -X POST -d '{
    "origin": {
      "address": "1800 Amphitheatre Parkway, Mountain View, CA 94043"
    },
    "destination": {
      "address": "Sloat Blvd &, Upper Great Hwy, San Francisco, CA 94132"
    },
  "travelMode": "DRIVE"
  }' \
  -H 'Content-Type: application/json' -H 'X-Goog-Api-Key: YOUR_API_KEY' \
  -H 'X-Goog-FieldMask: routes.duration,routes.distanceMeters' \
  'https://routes.googleapis.com/directions/v2:computeRoutes'

The service then calculates the requested route, and returns the fields you've requested.

Resources

The following table summarizes the resources available through the Routes API Compute Routes method, along with the data it returns.

Data resources Data returned Return format ComputeRoutes Returns routes, legs, and steps for a route, with alternate routes, if requested. JSON How to use Compute Routes Available client libraries

For a list of the available client libraries for Compute Routes, see Client libraries.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-18 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4