To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.
Discovery document
A Discovery Document is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:
A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:
POST /distanceMatrix/v2:computeRouteMatrix Takes in a list of origins and destinations and returns a stream containing route information for each combination of origin and destination.
[[["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-04-29 UTC."],[[["\u003cp\u003eThe Routes API provides access to functionalities for calculating distances and routes using the Google Maps platform.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can interact with the API using Google-provided client libraries or by directly making RESTful API requests.\u003c/p\u003e\n"],["\u003cp\u003eTwo core methods offered are \u003ccode\u003ecomputeRouteMatrix\u003c/code\u003e for calculating distances between multiple origins and destinations, and \u003ccode\u003ecomputeRoutes\u003c/code\u003e for generating detailed route information.\u003c/p\u003e\n"],["\u003cp\u003eThe API utilizes a RESTful architecture and documentation is available through a discovery document.\u003c/p\u003e\n"],["\u003cp\u003eThe service endpoint for the Routes API is \u003ccode\u003ehttps://routes.googleapis.com\u003c/code\u003e.\u003c/p\u003e\n"]]],["The routes.googleapis.com API offers two primary methods: `computeRouteMatrix` and `computeRoutes`. `computeRouteMatrix` takes a list of origins and destinations, outputting route data for each combination. `computeRoutes` calculates the primary route and optional alternatives between specified waypoints. The service endpoint is `https://routes.googleapis.com`, and a discovery document is available at `https://routes.googleapis.com/$discovery/rest?version=v2` to facilitate building client tools. Google-provided client libraries are recommended.\n"],null,["routes.googleapis.com API.\n\n- [REST Resource: v2](#v2)\n\nService: routes.googleapis.com\n\nTo call this service, we recommend that you use the Google-provided [client libraries](https://cloud.google.com/apis/docs/client-libraries-explained). If your application needs to use your own libraries to call this service, use the following information when you make the API requests.\n\nDiscovery document\n\nA [Discovery Document](https://developers.google.com/discovery/v1/reference/apis) is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:\n\n- \u003chttps://routes.googleapis.com/$discovery/rest?version=v2\u003e\n\nService endpoint \n\nA [service endpoint](https://cloud.google.com/apis/design/glossary#api_service_endpoint) is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:\n\n- `https://routes.googleapis.com`\n\nREST Resource: [v2](/maps/documentation/routes/reference/rest/v2/TopLevel)\n\n| Methods ||\n|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [computeRouteMatrix](/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix) | `POST /distanceMatrix/v2:computeRouteMatrix` Takes in a list of origins and destinations and returns a stream containing route information for each combination of origin and destination. |\n| [computeRoutes](/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes) | `POST /directions/v2:computeRoutes` Returns the primary route along with optional alternate routes, given a set of terminal and intermediate waypoints. |"]]