Get Started

The Directions API is a service that calculates directions between locations. You can search for directions for several modes of transportation, including transit, driving, walking, or cycling.

Sample request and response

You access the Directions API through an HTTP interface, with requests constructed as a URL string, using text strings or latitude/longitude coordinates to identify the locations, along with your API key.

The following example requests the driving directions from Disneyland to Universal Studios Hollywood, in JSON format:

Try it! You can test this request by entering the URL into your web browser (be sure to replace YOUR_API_KEY with your actual API key). The response returns the driving directions.

View the developer's guide for more information about building request URLs and available parameters and understanding the response.

Below is a sample response, in JSON:

   "geocoded_waypoints" : [
         "geocoder_status" : "OK",
         "place_id" : "ChIJRVY_etDX3IARGYLVpoq7f68",
         "types" : [
         "geocoder_status" : "OK",
         "partial_match" : true,
         "place_id" : "ChIJp2Mn4E2-woARQS2FILlxUzk",
         "types" : [ "route" ]
   "routes" : [
         "bounds" : {
            "northeast" : {
               "lat" : 34.1330949,
               "lng" : -117.9143879
            "southwest" : {
               "lat" : 33.8068768,
               "lng" : -118.3527671
         "copyrights" : "Map data ©2016 Google",
         "legs" : [
               "distance" : {
                  "text" : "35.9 mi",
                  "value" : 57824
               "duration" : {
                  "text" : "51 mins",
                  "value" : 3062
               "end_address" : "Universal Studios Blvd, Los Angeles, CA 90068, USA",
               "end_location" : {
                  "lat" : 34.1330949,
                  "lng" : -118.3524442
               "start_address" : "Disneyland (Harbor Blvd.), S Harbor Blvd, Anaheim, CA 92802, USA",
               "start_location" : {
                  "lat" : 33.8098177,
                  "lng" : -117.9154353

  ... Additional results truncated in this example[] ...

         "overview_polyline" : {
            "points" : "knjmEnjunUbKCfEA?_@]@kMBeE@qIIoF@wH@eFFk@WOUI_@?u@j@k@`@EXLTZHh@Y`AgApAaCrCUd@cDpDuAtAoApA{YlZiBdBaIhGkFrDeCtBuFxFmIdJmOjPaChDeBlDiAdD}ApGcDxU}@hEmAxD}[tt@yNb\\yBdEqFnJqB~DeFxMgK~VsMr[uKzVoCxEsEtG}BzCkHhKWh@]t@{AxEcClLkCjLi@`CwBfHaEzJuBdEyEhIaBnCiF|K_Oz\\
         "summary" : "I-5 N and US-101 N",
         "warnings" : [],
         "waypoint_order" : []
   "status" : "OK"

Start coding with our client libraries

Client libraries make developing with the Google Maps web service APIs easier by providing simple, native implementations of common tasks such as authentication, request throttling and automatic retry. The Directions API is available in the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.

Authentication, quotas, pricing, and policies


To use the Directions API, you must first enable the API and obtain the proper authentication credentials. For more information, see Get Started with Google Maps Platform.

Quotas and pricing

Review the usage and billing page for details on the quotas and pricing set for the Directions API.


Use of the Directions API must be in accordance with the API policies.

From our Terms of Service

Innovate, but don't

Don't make a substitute for Google Maps. If your app's primary purpose is navigation, a business directory, or a general purpose "maps app", it's a substitute for Google Maps.

Learn more

Learn more

There’s more you can do with the Directions API, like requesting directions via different travel modes, using waypoints to calculate routes through additional locations, and estimating travel time. See the Directions API developer guide for more examples and other details.

The Directions API developer guide is intended for website and mobile developers who want to compute direction data within maps provided by one of the Google Maps APIs. It provides an introduction to using the API and reference material on the available parameters.