get a route matrix

POST https://routes.googleapis.com/distanceMatrix/v2:computeRouteMatrix

A route matrix contains a matrix of information for recommended routes between multiple start and end points, including distance and estimated arrival times.

You can use a route matrix to help you choose the best combinations of origins and destinations based on your business needs, such as the following use cases:

  • Find the best warehouses from which to send out deliveries.

  • Match the closest suitable vehicle to make a pick-up or drop-off request.

The Routes API provides several options to customize the types of routes and information provided in a route matrix. These guide topics can help you get started:

TopicDescription
Get a route matrixLearn how to create a route matrix and what information to include.
Available route matrix vehicle typesSelect what type of vehicle that you want the routes for.
Available route matrix optionsSelect the type of information to include in your route matrix.
Review the route matrix responseReview how a route matrix is returned from the Routes API, so you know how to handle the response in your application.

HEADERS

KeyDatatypeRequiredDescription
X-Goog-FieldMaskstring
Content-Typestring
X-Goog-Api-Keystring