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

This guide describes how to migrate apps that use either
Directions API or Distance Matrix API to using
the Routes API. For details on the Routes API, see
[product overview](https://developers.google.com/maps/documentation/routes/overview).

> [!NOTE]
> **Note:** If you were using the Preview release of Routes API, see [Migrate from Preview to GA](https://developers.google.com/maps/documentation/routes/migrate-routes-preview.md.txt) for information on migrating to the GA release.


## Billing best practices for migration

This guidance applies if your API usage is high enough to
move into second-tier pricing. When migrating to a newer version of an API,
you're also being billed for a different SKU. To avoid increased costs during the month of
your transition, we recommend switching to the new APIs in production as close to the
beginning of the month as possible. This will ensure that you reach the most cost-effective
monthly pricing tiers during the migration month. For information about pricing tiers,
see the [pricing page](https://developers.google.com/maps/billing-and-pricing/pricing.md.txt)
and the [pricing FAQ](https://developers.google.com/maps/billing-and-pricing/faq.md.txt).

<br />

## Update the REST API endpoints

Update your code to use the new **Routes API** endpoints

### From Directions API

|---|---|
| **Directions API** | `https://maps.googleapis.com/maps/api/directions/outputFormat?parameters` |
| **Routes API** | `https://routes.googleapis.com/directions/v2:computeRoutes` |

### From Distance Matrix API

|---|---|
| **Distance Matrix API** | `https://maps.googleapis.com/maps/api/distancematrix/outputFormat?parameters` |
| **Routes API** | `https://routes.googleapis.com/distanceMatrix/v2:computeRouteMatrix` |

## Convert URL parameters to use an HTTPS request body

With Directions API and Distance Matrix API, you
pass configuration properties as URL parameters to an `HTTP GET` request. For
example, for the Directions API:

```html
https://maps.googleapis.com/maps/api/directions/outputFormat?parameters
```

With the Routes API, you pass parameters in a request body or in headers
as part of an `HTTP POST` request. For examples, see:

- [Compute a route](https://developers.google.com/maps/documentation/routes/compute_route_directions.md.txt)
- [Compute a route matrix](https://developers.google.com/maps/documentation/routes/compute_route_matrix.md.txt)

## Convert polyline-encoded waypoints to location waypoints

Specifying waypoints as encoded polylines is available in the
[Directions API (Legacy)](https://developers.google.com/maps/documentation/directions) to fit a large
number of waypoints in the URL limit of 16384 characters. This feature is not
necessary in the Routes API because waypoints can be transmitted in the
REST or gRPC request body as latitude/longitude coordinates. For examples,
see the
[HTTP Example](https://developers.google.com/maps/documentation/routes/compute_route_matrix.md.txt#http_example)
in the **Compute a route matrix** document, or
[Define an intermediate waypoint](https://developers.google.com/maps/documentation/routes/intermed_waypoints.md.txt#define_an_intermediate_waypoint)
in the **Specify intermediate waypoints** document.

## Convert parameters

The following tables lists parameters in the
Directions API and Distance Matrix API that have
been renamed or modified, or parameters that are not supported in the GA
release. Update your code if you are using any of these parameters.

### Request parameter conversions

| Directions or Distance matrix parameter | Routes API parameter | Notes |
|---|---|---|
| `alternatives` | `computeAlternativeRoutes` |   |
| `arrival_time` | `arrivalTime` | Available in `TRANSIT` mode only, and not at the same time as `departureTime`. |
| `avoid` | `routeModifiers` |   |
| `departure_time` | `departureTime` | Cannot be used at the same time as `arrivalTime`. |
| `language` | `languageCode` | Supported for Compute Routes only. |
| `mode` | [`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt) | Passed in the [`computeRoutes`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt#body.request_body.FIELDS.travel_mode) or [`computeRouteMatrix`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#body.request_body.FIELDS.travel_mode) HTTP `POST` JSON request body using [`RouteTravelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt) values ([`DRIVE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.DRIVE), [`TWO_WHEELER`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TWO_WHEELER), [`WALK`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.WALK), [`TRANSIT`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRANSIT), [`TRUCK`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRUCK), or [`BICYCLE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.BICYCLE) for [`computeRoutes`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt)) instead of a `GET` URL query parameter. Added support for [`TWO_WHEELER`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TWO_WHEELER), [`TRANSIT`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRANSIT), and [`TRUCK`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRUCK). |
| `region` | `regionCode` |   |
| `traffic_model` | `trafficModel` | [Learn more](https://developers.google.com/maps/documentation/routes/traffic-model.md.txt) |
| `transit_mode` | `"travelMode": "TRANSIT"` | In the Directions API (Legacy), in a transit route, each segment of a trip with the same travel mode (for example, Walk or Transit) is considered to be one step, and individual directions for that travel mode are in substeps. In contrast, In the Routes API, steps are consistently one navigation instruction across all types of travel. So each navigation instruction is a step. For multiple steps in one travel mode, the Routes API provides metadata that contains a summary of the steps for that travel mode, in \`stepsOverview\`. To request this metadata, use the \`routes.legs.stepsOverview\` field mask. [Learn more](https://developers.google.com/maps/documentation/routes/transit-route.md.txt). |
| `transit_routing_preference` | `transitRoutingPreference` | [Learn more](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences.md.txt) |
| `units` | `units` | [Learn more](https://developers.google.com/maps/documentation/routes/localized-values.md.txt) |
| `waypoints` | `intermediates` | Removed support for [encoded polylines](https://developers.google.com/maps/documentation/routes/migrate-routes.md.txt#convert_encoded_polylines). |
| `optimize=true` for waypoints | `"optimizeWaypointOrder": "true"` | [Learn more](https://developers.google.com/maps/documentation/routes/opt-way.md.txt) |

### Response parameter conversions

| Directions or Distance matrix parameter | Routes API parameter | Notes |
|---|---|---|
| `copyrights` |   | Not included in the response. You must include the following statement when displaying the results to your users: `Powered by Google, ©YEAR Google` For example: `Powered by Google, ©2022 Google` |
| `distance` | `distanceMeters` | Distance is only available in meters. |
| `duration_in_traffic` | `duration` | Removed in the Routes API, use `duration`. |
| `status` |   | Not available. Use the HTTP response codes for errors reported by the API. See [Handle request errors](https://developers.google.com/maps/documentation/routes/handle-errors.md.txt) for more information. |
| `geocoded_waypoints` | `geocoding_results` | Supported for Compute Routes only. Contains geocoding response info only for waypoints specified as addresses. |
| `bounds` | `viewport` |   |
| `legs.end_address` | Not available. | Use [place IDs](https://developers.google.com/maps/documentation/places/web-service/place-id.md.txt) instead of coordinates for high-accuracy routing. Place IDs contain data that snaps the route to correct access points. - **If you start with an address** : Use [Place Autocomplete](https://developers.google.com/maps/documentation/places/web-service/place-autocomplete.md.txt) or the [Geocoding API](https://developers.google.com/maps/documentation/geocoding) to resolve it to a place ID. - **If you start with coordinates** : Consider using [Search for destinations](https://developers.google.com/maps/documentation/geocoding/search-for-destinations.md.txt) to provide a more meaningful location. Simply obtaining an address from coordinates can be complex and lead to incorrect snapping. Routes API does not reverse-geocode coordinates into addresses. |
| `legs.start_address` | Not available. | Use [place IDs](https://developers.google.com/maps/documentation/places/web-service/place-id.md.txt) instead of coordinates for high-accuracy routing. Place IDs contain data that snaps the route to correct access points. - **If you start with an address** : Use [Place Autocomplete](https://developers.google.com/maps/documentation/places/web-service/place-autocomplete.md.txt) or the [Geocoding API](https://developers.google.com/maps/documentation/geocoding) to resolve it to a place ID. - **If you start with coordinates** : Consider using [Search for destinations](https://developers.google.com/maps/documentation/geocoding/search-for-destinations.md.txt) to provide a more meaningful location. Simply obtaining an address from coordinates can be complex and lead to incorrect snapping. Routes API does not reverse-geocode coordinates into addresses. |
| `overview_polyline` | polyline |   |
| `summary` | `description` |   |
| `waypoint_order` | `optimizedIntermediateWaypointIndex` |   |