Stay organized with collections
Save and categorize content based on your preferences.
When you are computing a route matrix, you might want to take into consideration
any toll fees on the routes in the matrix. For select cities, you can compute
the estimated toll fee for a route in the appropriate currency.
For the list of supported toll locations, see the reference for
TollPass.
Route matrix toll example
The following example uses the
computeRouteMatrix
method to return toll information on a route with an estimated
price when a toll pass is used:
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 origin waypoints 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 to configure the method to
return toll information in the response. Specify
routes.travelAdvisory.tollInfo to return information for the entire route.
[[["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-03-07 UTC."],[[["The Routes API's `computeRouteMatrix` method allows you to calculate estimated toll fees for routes in supported cities, providing cost insights for route planning."],["To enable toll calculations, specify `TOLLS` in the `extraComputations` field and provide vehicle and toll pass details in the `routeModifiers` field within the request."],["Toll prices are estimates and are influenced by factors like vehicle type and toll pass used, with the response including the estimated price in the specified currency."],["While the Route Matrix provides toll information, detailed route specifics are not included; for that, use the `Compute Routes` functionality with single origin and destination points."],["Be aware that requests including toll fee calculations are billed at a higher rate than standard route matrix requests."]]],["To calculate toll fees for a route matrix, set the `extraComputations` field to `TOLLS`. Specify the vehicle type and toll pass using the `routeModifiers` field within the origin waypoints; the lowest-cost toll pass pricing will be applied if multiple passes are set. Use the response field mask with `routes.travelAdvisory.tollInfo` to include toll information, and note that toll fee requests have a higher billing rate. The response then contains `estimatedPrice`.\n"]]