**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt).

A route matrix request takes as input an array of origin and destination
waypoints. The Routes API then calculates the route from each origin
waypoint to each destination waypoint. For example, if you specify two origin
waypoints and two destination waypoints, the API then calculates four separate
routes.

The API response contains an array, where each array element corresponds to the
route from one origin waypoint to one destination waypoint. Therefore, if you
specify two origin waypoints and two destination waypoints, the response array
contains four elements, one for each computed route.

Using the response, you can provide your customers with different route options
and then let the user select the appropriate route for their requirements.

> [!NOTE]
> **Note:** Route matrix does not return detailed route information, such as the legs, steps, and polylines of the route. To obtain detailed route information, pass a single origin and single destination to [Compute Routes](https://developers.google.com/maps/documentation/routes/compute_route_directions.md.txt).

## About field masks

When you call a method to compute a route, you must specify a field
mask that defines which fields you want returned in the response. There is no
default list of returned fields. If you omit this list, the methods return an
error.

The examples in this document show the entire response object without taking
field masks into consideration. In a production environment, your response would
only include the fields that you explicitly specify in the field mask.

For more information, see [Choose what information to return](https://developers.google.com/maps/documentation/routes/choose_fields.md.txt).

## About displaying copyrights

You must include the following copyright statement when displaying the results to your users:

`Powered by Google, ©YEAR Google`

For example:

`Powered by Google, ©2023 Google`

## Identify the route in the response

Use the `originIndex` and `destinationIndex` response properties to identify
each route in the response. These properties contain the **zero-based** index of
the input **origin** and input **destination** waypoints used to calculate the
route. That means the first origin waypoint and the first destination waypoint
in the request are at array index 0.

For example, a route in the response contains:

```json
"originIndex": 1,
"destinationIndex": 0
```

These properties indicate that the route was calculated from the origin
waypoint at index 1 in the input array, and from the destination waypoint at
index 0.

For the next route:

```json
"originIndex": 4,
"destinationIndex": 1
```

The route was calculated from the origin waypoint at index 4 in the input
array, and from the destination waypoint at index 1 in the input array.

## About the route information in the response

The API response contains an array, where each array element defines the route
from one origin waypoint to one destination waypoint. These elements are
[`RouteMatrixElements`](https://developers.google.com/maps/documentation/routes/reference/rpc/google.maps.routing.v2.md.txt#google.maps.routing.v2.RouteMatrixElement)
in the gRPC method or the
[response body](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#response-body) in
the HTTP response.

Along with the `originIndex` and `destinationIndex` properties, each element
contains only basic information specific to that route, such as
`distanceMeters`, `duration`, and `travelAdvisory`. To get more detailed
information about a route, such as a polyline, use `computeRoutes`.

The response has the form:

```json
[
  // One array element for each combination of origin and destination waypoints.
  {
    // The route for source waypoint 0 and destination waypoint 0.
    "originIndex": 0,
    "destinationIndex": 0,
    "status": {
      object (Status)
    },
    "condition": enum (RouteMatrixElementCondition),
    "distanceMeters": integer,
    "duration": string,
    "staticDuration": string,
    "travelAdvisory": {
      object (RouteTravelAdvisory)
    },
    "fallbackInfo": {
      object (FallbackInfo)
    }
  }
  {
    // The route for source waypoint 0 and destination waypoint 1.
    "originIndex": 0,
    "destinationIndex": 1,
    "status": {
      object (Status)
    },
    "condition": enum (RouteMatrixElementCondition),
    "distanceMeters": integer,
    "duration": string,
    "staticDuration": string,
    "travelAdvisory": {
      object (RouteTravelAdvisory)
    },
    "fallbackInfo": {
      object (FallbackInfo)
    }
  }
  ...
]
```