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

> [!NOTE]
> This product is in [Legacy status](https://developers.google.com/maps/legacy.md.txt). As of October 2026, Directions API (Legacy) can no longer be enabled for new Google Cloud projects. Existing projects remain fully supported. For new features and improved performance, [migrate to the Routes
> API](https://developers.google.com/maps/documentation/routes/migrate-routes).

![](https://developers.google.com/static/maps/images/landing/routes-api_960.png "Directions API Overview")
The Directions API (Legacy) is a service that accepts an HTTP request and returns JSON or XML-formatted directions between locations.

## Why use the Directions API (Legacy)

With the Directions API (Legacy), you can get directions for several modes of
transportation, such as transit, driving, walking, or bicycling.

## What you can do with the Directions API (Legacy)?

With the Directions API (Legacy), you can calculate directions between locations,
including the following details:

- Directions for several modes of transportation, including transit, driving, walking or bicycling.
- Multipart directions using a series of waypoints.
- Specify origins, destinations, and waypoints in multiple ways, including as text strings (for example, "Chicago, IL" or "Darwin, NT, Australia"), place IDs, or latitude/longitude coordinates.

## How the Directions API (Legacy) works

The Directions API (Legacy) returns the most efficient routes when
calculating directions. The product factors in the following travel elements
when determining the most efficient route:

- Travel time (primary)
- Distance
- Number of turns

The following example request returns driving directions from Toronto, Ontario to Montreal, Quebec in JSON format:

```
https://maps.googleapis.com/maps/api/directions/json
  ?destination=Montreal
  &origin=Toronto
  &key=YOUR_API_KEY
```

### Resources

The following table summarizes the resources available through the
Directions API (Legacy) along with the data it returns.

<br />

| Data resources | Data returned | Return format |
|---|---|---|
| [Directions](https://developers.google.com/maps/documentation/directions/get-directions.md.txt#DirectionsRequests) Supply origins and destinations in the form of place IDs, addresses, or latitude/longitude coordinates. See [required parameters](https://developers.google.com/maps/documentation/directions/get-directions.md.txt#required-parameters) for details. | Detailed directions, broken into routes, legs, and steps. See [Directions responses](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsResponses) for details. | - JSON - XML |

<br />

## How to use the Directions API (Legacy)

|---|---|---|
| 1 | **Get set up.** | Start with [Set up your Google Cloud project](https://developers.google.com/maps/documentation/directions/cloud-setup.md.txt) and complete the setup instructions that follow. |
| 2 | **Try the demo** | Once you have an API key and a cloud project you try out the directions demo at no charge. See [The Directions API (Legacy) demo](https://developers.google.com/maps/documentation/directions/start.md.txt). |
| 3 | **Build a request** | See the example requests and learn about the available options you can supply, such as travel modes, waypoints, and route restrictions. See [Directions examples](https://developers.google.com/maps/documentation/directions/examples.md.txt#ExampleRequests). |
| 4 | **Understand response basics** | Explore the data responses to prepare to use directions data for your app. See [Directions responses](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsResponses) for details. |
| 5 | **Incorporate direction data into your own app!** | You can use this data to calculate travel distance and time. |

### Available client libraries

Call this API in the language of
your choice through one of the following client libraries:

- [Java
  Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-java)
- [Python
  Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-python)
- [Go Client
  for Google Maps Services](https://github.com/googlemaps/google-maps-services-go)
- [Node.js
  Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-js)

The Java Client, Python Client, Go Client and Node.js Client for Google Maps
Services are community-supported client libraries, open sourced under the
[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
Download them from GitHub, where you can also find installation instructions and sample code.

## What's next

- **Start using the Directions API (Legacy)** : Go to [Get started](https://developers.google.com/maps/documentation/directions/start.md.txt).
- **Start making Directions requests** : Go to [Get
  directions](https://developers.google.com/maps/documentation/directions/get-directions).
- **Follow best practices** : Go to [Web service best
  practices](https://developers.google.com/maps/documentation/directions/web-service-best-practices).