> [!CAUTION]
> **Legacy product:** Directions API is Legacy as of 2025-03-01. Use [Routes API](https://developers.google.com/maps/documentation/routes/quick-reference.md.txt) instead. See the [migration guide](https://developers.google.com/maps/documentation/routes/migrate-routes.md.txt).

Directions API (Legacy) is a web service that calculates directions between locations for driving, walking, bicycling, and transit, including multipart routes with waypoints, and returns routes, legs, and steps in JSON or XML. It's in Legacy status: as of October 2026 it can't be enabled for new Google Cloud projects; migrate to the Routes API.

## Directions API: key facts

- **Product:** Directions API
- **Also known as:** Directions API (Legacy)
- **Category:** Routes
- **Platform:** Web service (REST)
- **Runs on:** Server (backend code)
- **Launch stage:** GA
- **Lifecycle:** Legacy
- **Replaced by:** [Routes API](https://developers.google.com/maps/documentation/routes/quick-reference.md.txt)
- **Overview:** [Directions API overview](https://developers.google.com/maps/documentation/directions/overview.md.txt)
- **Regional availability:** Global. Coverage varies by region and travel mode (transit depends on data from transit providers). ([coverage details](https://developers.google.com/maps/coverage.md.txt))

## Directions API: when to use it

**Use Directions API when:**

- You maintain an existing Google Cloud project that already has Directions API (Legacy) enabled and calls `maps/api/directions`.
- You need server-side directions for driving, walking, bicycling, or transit (waypoints for non-transit modes only), in JSON or XML, in an existing project.
**Don't use Directions API when:**

- You're starting a new Google Cloud project; as of October 2026 Directions API (Legacy) can't be enabled for new projects. Use [Routes API](https://developers.google.com/maps/documentation/routes/quick-reference.md.txt) instead.
- You need new routing features and improved performance. Use [Routes API](https://developers.google.com/maps/documentation/routes/quick-reference.md.txt) instead.
- You need travel times and distances for many origins and destinations in one request. Use [Routes API](https://developers.google.com/maps/documentation/routes/quick-reference.md.txt) instead.

## Directions API: setup

- **Service to enable:** `directions-backend.googleapis.com`
- **Authentication:** API key
- **Get started:** [Set up Directions API](https://developers.google.com/maps/documentation/directions/start.md.txt)
- **Reference:** [Directions API reference](https://developers.google.com/maps/documentation/directions/get-directions.md.txt)
- **Pricing:** [Directions API usage and billing](https://developers.google.com/maps/documentation/directions/usage-and-billing.md.txt)
- **Policies:** [Directions API policies](https://developers.google.com/maps/documentation/directions/policies.md.txt)
- **Release notes:** [Directions API release notes](https://developers.google.com/maps/documentation/directions/releases.md.txt)

## Directions API: common mistakes

- **Problem:** Requests to Directions API (Legacy) from a project where the legacy API isn't enabled fail with `LegacyApiNotActivatedMapError`. **Fix:** If you own the app, migrate to the Routes API. As a short-term solution while you migrate or wait for an app update, you can activate the legacy API by completing the legacy API activation form. See [/maps/legacy](https://developers.google.com/maps/legacy.md.txt).
- **Problem:** Using the `via:` prefix on waypoints makes them strict pass-throughs, which can cause severe detours or a `ZERO_RESULTS` status. **Fix:** Use stopover waypoints (no `via:` prefix) unless a strict pass-through point is required. See [/maps/documentation/directions/get-directions](https://developers.google.com/maps/documentation/directions/get-directions.md.txt).
- **Problem:** Requests with 11 to 25 waypoints, `optimize:true`, traffic-aware durations (`duration_in_traffic`), or the `side_of_road` or `heading` location modifiers are billed at the higher Directions Advanced (Pro) SKU. **Fix:** Use these features only when you need them; keep waypoints at 10 or fewer and omit `optimize:true`, `departure_time` (for driving), `side_of_road`, and `heading` to stay on the Essentials SKU. See [/maps/billing-and-pricing/sku-details/legacy#directions-advanced-pro-sku](https://developers.google.com/maps/billing-and-pricing/sku-details/legacy.md.txt#directions-advanced-pro-sku).
- **Problem:** For driving, `departure_time` can't be in the past (the request fails with `INVALID_REQUEST`). Without `departure_time`, route and duration use average time-independent traffic, and no `duration_in_traffic` is returned. **Fix:** Set `departure_time` to `now` or a future time with `mode=driving` to get `duration_in_traffic`. Requests that return `duration_in_traffic` are billed at the Directions Advanced (Pro) SKU. See [/maps/documentation/directions/get-directions](https://developers.google.com/maps/documentation/directions/get-directions.md.txt).