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

When you are computing a route or a route matrix,
you might want to take into consideration any toll fees on the route.
For select cities, you can compute the estimated
toll fee for a route in the appropriate currency.

To get tolls for a route matrix, see
[Calculate tolls fees for a route matrix](https://developers.google.com/maps/documentation/routes/calculate_toll-rm.md.txt).

For the list of supported toll locations, see the reference for
[TollPass](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.md.txt#tollpass).

> [!CAUTION]
> **Caution:** Requests that calculate toll fees are billed at a higher rate. [Learn more about billing](https://developers.google.com/maps/documentation/routes/usage-and-billing.md.txt) for the Routes API.

## How tolls are calculated

The Routes API calculates the estimated toll fee,
taking into consideration any toll price discounts or passes available
to the driver or vehicle, and the most convenient payment methods.
If there is no available toll price for a given route,
the Routes API indicates the existence of a toll
with an unknown fee.

> [!NOTE]
> **Note** : The Routes API calculates tolls on a route differently than Google Maps:
>
> - The Routes API returns only the toll prices (pass or cash) that would actually be charged for the trip, assuming your request accurately represents what types of passes each driver and/or vehicle has. If you don't specify any toll passes, the API returns the cash prices, which is usually the highest toll.
> - Google Maps typically returns the cheapest possible price for a vehicle. Users cannot specify which toll passes they have; instead, to see cash tolls, users can disable the **See toll pass prices** option, which is enabled by default.

To get accurate toll estimates, make sure you include the following information
in your request:

- **The emission type** of the vehicle used for the route ([`VehicleEmissionType`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.md.txt#vehicleemissiontype)). If no emission type is provided, the toll for a gasoline-fueled vehicle is returned.
- **All toll passes the vehicle and driver have** using ([`TollPass`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.md.txt#tollpass)). The API uses the toll passes to determine accurate toll fees, and returns cash prices when toll passes in the request are not local to the route.
- **Specify avoid tolls, if needed** . If you want to avoid toll roads where possible, add `avoidTolls` as a `RouteModifier`.

### Calculate tolls using a toll pass

To calculate tolls using a toll pass, you specify any toll passes as part of
the request. The API then returns pass prices.

- If you specify an invalid toll pass, the pass is ignored.

- If specify multiple toll passes as an array, the API attempts to
  calculate the price for the route for each pass.

> [!NOTE]
> **Note:** You can only specify a toll pass for the `DRIVE` and `TWO_WHEELER` travel modes.

The way toll passes behave can vary by region.

- **Rates may be lower with a toll pass** : In some regions, a driver or vehicle
  with a toll pass pays a different toll than those who don't have a pass.
  For example, if you have a
  [Good To Go!](https://en.wikipedia.org/wiki/Good_to_Go_(toll_collection_system))
  toll pass in Seattle, WA, US, you pay a lower toll than if you don't have a
  pass.

- **Some roads may require a toll pass**: Some regions, such as Indonesia, have
  roads that require a toll pass. If you don't specify a toll pass for a
  route where a toll pass is required, the API does not return a toll price.

## Calculate toll fees for a route

The following example uses the
[`computeRoutes`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt)
method to return toll information with an estimated
price when a toll pass is used. In this example, you:

- Set the `extraComputations` array field to `TOLLS` to enable the calculation
  of toll information.

- Specify the vehicle type and the toll pass type by using the
  `routeModifiers` field of the request. The toll price returned is based on
  the pricing used by the specified vehicle type and pass. If more than one
  pass is specified, the least expensive pricing is returned.

- Use the [response field mask](https://developers.google.com/maps/documentation/routes/choose_fields.md.txt) to configure the method to
  return toll information in the response. In this example, the request
  included the following properties in the response field mask:

  - `routes.travelAdvisory.tollInfo` field to return information for the
    entire route.

  - `routes.legs.travelAdvisory.tollInfo` to return information
    for each leg.

  > [!NOTE]
  > **Note:** This route contains only one leg.

### Request for toll information

```console
curl -X POST -d '{
  "origin":{
    "location":{
      "latLng":{
        "latitude":42.340173523716736,
        "longitude":-71.05997968330408
      }
    }
  },
  "destination":{
    "location":{
      "latLng":{
        "latitude":42.075698891472804,
        "longitude": -72.59806562080408
      }
    }
  },
  "travelMode": "DRIVE",
  "extraComputations": \["TOLLS"\],
  "routeModifiers":{
    "vehicleInfo":{
      "emissionType": "GASOLINE"
    },
    "tollPasses": [
      "US_MA_EZPASSMA",
      "US_WA_GOOD_TO_GO"
    ]
  }
}' \
-H 'Content-Type: application/json' \
-H 'X-Goog-Api-Key: YOUR_API_KEY' \
-H 'X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.travelAdvisory.tollInfo,routes.legs.travelAdvisory.tollInfo' \
'https://routes.googleapis.com/directions/v2:computeRoutes'
```

### Response containing toll information

The response contains information on tolls in a
[TollInfo](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TollInfo.md.txt) (REST) or
[TollInfo](https://developers.google.com/maps/documentation/routes/reference/rpc/google.maps.routing.v2.md.txt#tollinfo) (gRPC) object. In this
example, you return toll information for the entire route and for each leg of
the route.

> [!NOTE]
> **Note** : The Routes API provides an `estimatedPrice` that applies to non-commercial vehicles.
>
> - Toll prices may be different for commercial vehicles.
> - The `units` and `nanos` are omitted when their value is zero.

```json
{
  "routes": [
    {
      "legs": [
        {
          "travelAdvisory": {
            "tollInfo": {
              "estimatedPrice": [
                {
                  "currencyCode": "USD",
                  "units": "4",
                  "nanos": 400000000
                }
              ]
            }
          }
        }
      ],
      "distanceMeters": 150338,
      "duration": "6650s",
      "travelAdvisory": {
        "tollInfo": {
          "estimatedPrice": [
            {
              "currencyCode": "USD",
              "units": "4",
              "nanos": 400000000
            }
          ]
        }
      }
    }
  ]
}
```