Stay organized with collections Save and categorize content based on your preferences.
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 APIWith the Directions API, you can get directions for several modes of transportation, such as transit, driving, walking, or bicycling.
What you can do with the Directions API?With the Directions API, you can calculate directions between locations, including the following details:
The Directions API returns the most efficient routes when calculating directions. The product factors in the following travel elements when determining the most efficient route:
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_KEYResources
The following table summarizes the resources available through the Directions API along with the data it returns.
Data resources Data returned Return format DirectionsSupply origins and destinations in the form of place IDs, addresses, or latitude/longitude coordinates. See required parameters for details.
Detailed directions, broken into routes, legs, and steps. See Directions responses for details.Call this API in the language of your choice through one of the following client libraries:
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. Download them from GitHub, where you can also find installation instructions and sample code.
What's nextExcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-14 UTC.
[[["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-08-14 UTC."],[[["The Directions API provides route information between locations using various transportation modes like driving, walking, transit, or bicycling."],["You can customize your requests by specifying origins, destinations, waypoints, and travel preferences."],["The API calculates the most efficient routes based on travel time, distance, and the number of turns."],["Results are available in JSON or XML format and include detailed directions, routes, legs, and steps."],["Client libraries are available in Java, Python, Go, and Node.js for easy integration into your applications."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4