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

You can get a route suited to different types of vehicles. If you don't specify
a vehicle type, the Routes API uses the default of a gasoline-powered
car
([`DRIVE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.DRIVE)).

To set the mode of transportation in a
[`computeRoutes`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt)
HTTP `POST` request, pass the
[`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt#body.request_body.FIELDS.travel_mode)
field in the JSON request body using a
[`RouteTravelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt)
enum value, with choices of transit, driving, two-wheeled vehicles, trucks,
walking, or bicycling.

> [!NOTE]
> **Note:** Walking, bicycling, and two-wheel routes are in beta and might sometimes be missing clear sidewalks, pedestrian paths, or bicycling paths. You must display this warning to the user for all walking, bicycling, and two-wheel routes that you display in your app.

| Vehicle type | [`RouteTravelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt) value | Description |
|---|---|---|
| Bicycle | [`BICYCLE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.BICYCLE) | Compute a route for bicycles and other human-powered travel. For motorized two-wheeled vehicles, see **Two-wheeled vehicle**. |
| [Drive](https://developers.google.com/maps/documentation/routes/compute_route_directions.md.txt) | [`DRIVE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.DRIVE) | Compute a driving route. [`DRIVE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.DRIVE) is the default if you don't specify a vehicle type. |
| [Transit](https://developers.google.com/maps/documentation/routes/transit-route.md.txt) | [`TRANSIT`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRANSIT) | Get a transit route for navigation instructions using the public transportation options available in the region. Transit options can include buses, subways, and trains, among others. A transit route also usually includes instructions on walking to, from, and between transit stations. |
| [Two-wheeled vehicle](https://developers.google.com/maps/documentation/routes/route_two_wheel.md.txt) | [`TWO_WHEELER`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TWO_WHEELER) | Two-wheeler refers to two-wheeled motorized vehicles (for example, motorcycles). The two-wheeler travel mode differs from the bicycle travel mode, which is a human-powered travel mode. |
| [Truck](https://developers.google.com/maps/documentation/routes/lvr.md.txt) | [`TRUCK`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRUCK) | Compute a route customized for a large vehicle by specifying its physical attributes and constraints in [`routeModifiers.vehicleInfo`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.md.txt#FIELDS.vehicle_info). Use this vehicle type to avoid low bridges, weight restrictions, and hazards. |
| Walk | [`WALK`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.WALK) | Compute a walking route. |

## Specify the travel mode in a request

To specify a travel mode in a
[`computeRoutes`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt)
request, set the
[`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt#body.request_body.FIELDS.travel_mode)
field in the HTTP `POST` JSON request body and include the required
`X-Goog-FieldMask` header to select the
[`Route`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt#Route)
response fields you need. If you're migrating from the legacy Directions API,
the
[`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt#body.request_body.FIELDS.travel_mode)
field in the `POST` JSON request body replaces the legacy `mode` URL query
parameter. For more information, see
[Migrate to the Routes API](https://developers.google.com/maps/documentation/routes/migrate-routes.md.txt).

```console
curl -X POST -d '{
  "origin": {
    "location": {
      "latLng": {
        "latitude": 37.419734,
        "longitude": -122.0827784
      }
    }
  },
  "destination": {
    "location": {
      "latLng": {
        "latitude": 37.417670,
        "longitude": -122.079595
      }
    }
  },
  "travelMode": "BICYCLE"
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: YOUR_API_KEY' \
-H 'X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline' \
'https://routes.googleapis.com/directions/v2:computeRoutes'
```