**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).

> [!NOTE]
> **Note:** Avoiding route features is not supported by the Compute Route Matrix feature of the Routes API.

You specify which route features you prefer to avoid, such as avoiding tolls or
highways, by adding *route modifiers* to a request. The API then attempts to
provide a route that does not require those features.

Use the `routeModifiers` property in a request, of type
[RouteModifiers](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.md.txt). You can specify `avoidTolls`,
`avoidHighways`, `avoidFerries`, and `avoidIndoor`.

> [!NOTE]
> **Note:** The `routeModifiers` property supports additional options, including `vehicleInfo` and `tollPasses`. For more on `vehicleInfo`, see [Get an eco-friendly route](https://developers.google.com/maps/documentation/routes/eco-routes.md.txt). For more on `tollPasses`, see [Calculate toll fees for a route](https://developers.google.com/maps/documentation/routes/calculate_toll_fees.md.txt).

Specifying a route modifier does not necessarily eliminate routes that include
the restricted feature. The API uses the modifier to bias the result to more
favorable routes. There can be a few reasons why requesting an avoidance option
doesn't change your route. For example, the only route from the origin to the
destination makes it impossible to avoid a highway or ferry. Or, the alternate
route actually lengthens travel time significantly.

The following example demonstrates how to set route modifiers in a
[computeRoutes](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt)
method (REST) request body. You can also specify this option to the
[ComputeRoutes](https://developers.google.com/maps/documentation/routes/reference/rpc/google.maps.routing.v2.md.txt#google.maps.routing.v2.Routes.ComputeRoutes)
method (gRPC). In this example, you specify to avoid tolls and highways:

```json
{
  "origin":{
    "location":{
      "latLng":{
        "latitude":37.419734,
        "longitude":-122.0827784
      }
    }
  },
  "destination":{
    "location":{
      "latLng":{
        "latitude":37.417670,
        "longitude":-122.079595
      }
    }
  },
  "routeModifiers": {
    "avoidTolls": true,
    "avoidHighways": true,
  }
}
```