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

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.md.txt).

## Sample responses

Directions responses are returned in the format indicated by the
`output` flag within the URL request path.

A sample HTTP request is shown below, calculating the route
from Chicago, IL to Los Angeles, CA via two waypoints in Joplin, MO
and Oklahoma City, OK.

### URL

```html
https://maps.googleapis.com/maps/api/directions/json
  ?destination=Los%20Angeles%2C%20CA
  &origin=Chicago%2C%20IL
  &waypoints=Joplin%2C%20MO%7COklahoma%20City%2C%20OK
  &key=YOUR_API_KEY
```

### curl

```bash
curl -L -X GET 'https://maps.googleapis.com/maps/api/directions/json?origin=Chicago%2C%20IL&destination=Los%20Angeles%2C%20CA&waypoints=Joplin%2C%20MO%7COklahoma%20City%2C%20OK&key=YOUR_API_KEY'
```

The above example requests JSON output. It's also possible to request XML
output. Select the tabs below to see the sample JSON and XML responses.

### JSON

```json
      
{
  "geocoded_waypoints":
    [
      {
        "geocoder_status": "OK",
        "place_id": "ChIJ7cv00DwsDogRAMDACa2m4K8",
        "types": ["locality", "political"],
      },
      {
        "geocoder_status": "OK",
        "place_id": "ChIJ69Pk6jdlyIcRDqM1KDY3Fpg",
        "types": ["locality", "political"],
      },
      {
        "geocoder_status": "OK",
        "place_id": "ChIJgdL4flSKrYcRnTpP0XQSojM",
        "types": ["locality", "political"],
      },
      {
        "geocoder_status": "OK",
        "place_id": "ChIJE9on3F3HwoAR9AhGJW_fL-I",
        "types": ["locality", "political"],
      },
    ],
  "routes":
    [
      {
        "bounds":
          {
            "northeast": { "lat": 41.8781139, "lng": -87.6297872 },
            "southwest": { "lat": 34.0523525, "lng": -118.2435717 },
          },
        "copyrights": "Map data ©2022 Google, INEGI",
        "legs":
          [
            {
              "distance": { "text": "579 mi", "value": 932311 },
              "duration": { "text": "8 hours 48 mins", "value": 31653 },
              "end_address": "Joplin, MO, USA",
              "end_location": { "lat": 37.0842449, "lng": -94.513284 },
              "start_address": "Chicago, IL, USA",
              "start_location": { "lat": 41.8781139, "lng": -87.6297872 },
              "steps":
                [
                  {
                    "distance": { "text": "443 ft", "value": 135 },
                    "duration": { "text": "1 min", "value": 24 },
                    "end_location": { "lat": 41.8769003, "lng": -87.6297353 },
                    "html_instructions": "Head <b>south</b> on <b>S Federal St</b> toward <b>W Van Buren St</b>",
                    "polyline": { "points": "eir~FdezuOdCEjBC" },
                    "start_location": { "lat": 41.8781139, "lng": -87.6297872 },
                    "travel_mode": "DRIVING",
                  },
                  {
                    "distance": { "text": "269 ft", "value": 82 },
                    "duration": { "text": "1 min", "value": 20 },
                    "end_location": { "lat": 41.8768866, "lng": -87.63073 },
                    "html_instructions": "Turn <b>right</b> at the 1st cross street onto <b>W Van Buren St</b>",
                    "maneuver": "turn-right",
                    "polyline": { "points": "sar~FzdzuO@fC?|@" },
                    "start_location": { "lat": 41.8769003, "lng": -87.6297353 },
                    "travel_mode": "DRIVING",
                  },
                  // Additional steps omitted for brevity
                ],
              "traffic_speed_entry": [],
              "via_waypoint": [],
            },
            // Additional legs (Joplin to Oklahoma City, Oklahoma City to Los Angeles) omitted for brevity
          ],
        "overview_polyline":
          {
            "points": "eir~FdezuOxyFzfFl`G|qZvtSzqo@d}EhlLtqIdjFhrTfvEdca@... (truncated for brevity)",
          },
        "summary": "I-55 S and I-44",
        "warnings": [],
        "waypoint_order": [0, 1],
      },
    ],
  "status": "OK",
}
      
      
```

### XML

```xml
      
<DirectionsResponse>
 <status>OK</status>
 <route>
  <summary>I-55 S and I-44</summary>
  <leg>
   <step>
    <travel_mode>DRIVING</travel_mode>
    <start_location>
     <lat>41.8781139</lat>
     <lng>-87.6297872</lng>
    </start_location>
    <end_location>
     <lat>41.8769003</lat>
     <lng>-87.6297353</lng>
    </end_location>
    <polyline>
     <points>eir~FdezuOdCEjBC</points>
    </polyline>
    <duration>
     <value>24</value>
     <text>1 min</text>
    </duration>
    <html_instructions>Head &lt;b&gt;south&lt;/b&gt; on &lt;b&gt;S Federal St&lt;/b&gt; toward &lt;b&gt;W Van Buren St&lt;/b&gt;</html_instructions>
    <distance>
     <value>135</value>
     <text>443 ft</text>
    </distance>
   </step>
   <step>
    <travel_mode>DRIVING</travel_mode>
    <start_location>
     <lat>41.8769003</lat>
     <lng>-87.6297353</lng>
    </start_location>
    <end_location>
     <lat>41.8768866</lat>
     <lng>-87.6307300</lng>
    </end_location>
    <polyline>
     <points>sar~FzdzuO@fC?|@</points>
    </polyline>
    <duration>
     <value>20</value>
     <text>1 min</text>
    </duration>
    <html_instructions>Turn &lt;b&gt;right&lt;/b&gt; at the 1st cross street onto &lt;b&gt;W Van Buren St&lt;/b&gt;</html_instructions>
    <distance>
     <value>82</value>
     <text>269 ft</text>
    </distance>
    <maneuver>turn-right</maneuver>
   </step>
   <!-- Additional steps omitted for brevity -->
   <duration>
    <value>31653</value>
    <text>8 hours 48 mins</text>
   </duration>
   <distance>
    <value>932311</value>
    <text>579 mi</text>
   </distance>
   <start_location>
    <lat>41.8781139</lat>
    <lng>-87.6297872</lng>
   </start_location>
   <end_location>
    <lat>37.0842449</lat>
    <lng>-94.5132840</lng>
   </end_location>
   <start_address>Chicago, IL, USA</start_address>
   <end_address>Joplin, MO, USA</end_address>
  </leg>
  <!-- Additional legs (Joplin to Oklahoma City, Oklahoma City to Los Angeles) omitted for brevity -->
  <copyrights>Map data ©2022 Google, INEGI</copyrights>
  <overview_polyline>
   <points>eir~FdezuOxyFzfFl`G|qZvtSzqo@d}EhlLtqIdjFhrTfvEdca@... (truncated for brevity)</points>
  </overview_polyline>
  <waypoint_index>0</waypoint_index>
  <waypoint_index>1</waypoint_index>
  <bounds>
   <southwest>
    <lat>34.0523525</lat>
    <lng>-118.2435717</lng>
   </southwest>
   <northeast>
    <lat>41.8781139</lat>
    <lng>-87.6297872</lng>
   </northeast>
  </bounds>
 </route>
 <geocoded_waypoint>
  <geocoder_status>OK</geocoder_status>
  <type>locality</type>
  <type>political</type>
  <place_id>ChIJ7cv00DwsDogRAMDACa2m4K8</place_id>
 </geocoded_waypoint>
 <geocoded_waypoint>
  <geocoder_status>OK</geocoder_status>
  <type>locality</type>
  <type>political</type>
  <place_id>ChIJ69Pk6jdlyIcRDqM1KDY3Fpg</place_id>
 </geocoded_waypoint>
 <geocoded_waypoint>
  <geocoder_status>OK</geocoder_status>
  <type>locality</type>
  <type>political</type>
  <place_id>ChIJgdL4flSKrYcRnTpP0XQSojM</place_id>
 </geocoded_waypoint>
 <geocoded_waypoint>
  <geocoder_status>OK</geocoder_status>
  <type>locality</type>
  <type>political</type>
  <place_id>ChIJE9on3F3HwoAR9AhGJW_fL-I</place_id>
 </geocoded_waypoint>
</DirectionsResponse>
      
      
```

The remainder of this documentation will use JSON syntax. In
most cases, the output format does not matter for purposes of illustrating
concepts or field names in the documentation. However, note the following
subtle differences:

- XML results are wrapped in a root `<DirectionsResponse>` element.
- JSON denotes entries with multiple elements by plural arrays (such as `steps` and `legs`), while XML denotes these using multiple singular elements (such as `<step>` and `<leg>`).
- JSON denotes waypoint order via the `waypoint_order` field, while XML denotes these using individual `<waypoint_index>` elements.
- Blank elements are indicated through empty arrays in JSON, but by the absence of any such element in XML. A response that generates no results will return an empty `routes` array in JSON, but no `<route>` elements in XML, for example.

### DirectionsResponse

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `routes` | **required** | Array\<[DirectionsRoute](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsRoute "DirectionsRoute")\> | Contains an array of routes from the origin to the destination. Routes consist of nested Legs and Steps. See [DirectionsRoute](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsRoute) for more information. |
| #### `status` | **required** | [DirectionsStatus](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsStatus "DirectionsStatus") | Contains the status of the request, and may contain debugging information to help you track down why the request failed. See [DirectionsStatus](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsStatus) for more information. |
| #### `available_travel_modes` | optional | Array\<[TravelMode](https://developers.google.com/maps/documentation/directions/responses.md.txt#TravelMode "TravelMode")\> | Contains an array of available travel modes. This field is returned when a request specifies a travel mode and gets no results. The array contains the available travel modes in the countries of the given set of waypoints. This field is not returned if one or more of the waypoints are 'via waypoints'. See [TravelMode](https://developers.google.com/maps/documentation/directions/responses.md.txt#TravelMode) for more information. |
| #### `error_message` | optional | string | When the service returns a status code other than `OK`, there may be an additional `error_message` field within the response object. This field contains more detailed information about the reasons behind the given status code. This field is not always returned, and its content is subject to change. |
| #### `geocoded_waypoints` | optional | Array\<[DirectionsGeocodedWaypoint](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsGeocodedWaypoint "DirectionsGeocodedWaypoint")\> | Contains an array with details about the geocoding of origin, destination and waypoints. Elements in the geocoded_waypoints array correspond, by their zero-based position, to the origin, the waypoints in the order they are specified, and the destination. These details won't be present for waypoints specified as textual latitude/longitude values if the service returns no results. This is because such waypoints are only reverse geocoded to obtain their representative address after a route has been found. An empty JSON object will occupy the corresponding places in the geocoded_waypoints array. See [DirectionsGeocodedWaypoint](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsGeocodedWaypoint) for more information. |

### DirectionsRoute

Routes consist of nested `legs` and `steps`.

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `bounds` | **required** | [Bounds](https://developers.google.com/maps/documentation/directions/responses.md.txt#Bounds "Bounds") | Contains the viewport bounding box of the `overview_polyline`. See [Bounds](https://developers.google.com/maps/documentation/directions/responses.md.txt#Bounds) for more information. |
| #### `copyrights` | **required** | string | Contains the copyright notices to be displayed for this route. You must handle and display this information yourself. This content is meant to be read as-is. Don't programmatically parse this display-only content. |
| #### `legs` | **required** | Array\<[DirectionsLeg](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsLeg "DirectionsLeg")\> | An array which contains information about a leg of the route, between two locations within the given route. A separate leg will be present for each waypoint or destination specified. (A route with no waypoints will contain exactly one leg within the legs array.) Each leg consists of a series of steps. See [DirectionsLeg](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsLeg) for more information. |
| #### `overview_polyline` | **required** | [DirectionsPolyline](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsPolyline "DirectionsPolyline") | Contains an object that holds an encoded polyline representation of the route. This polyline is an approximate (smoothed) path of the resulting directions. See [DirectionsPolyline](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsPolyline) for more information. |
| #### `summary` | **required** | string | Contains a short textual description for the route, suitable for naming and disambiguating the route from alternatives. |
| #### `warnings` | **required** | Array\<string\> | Contains an array of warnings to be displayed when showing these directions. You must handle and display these warnings yourself. |
| #### `waypoint_order` | **required** | Array\<integer\> | An array indicating the order of any waypoints in the calculated route. This waypoints may be reordered if the request was passed optimize:true within its waypoints parameter. |
| #### `fare` | optional | [Fare](https://developers.google.com/maps/documentation/directions/responses.md.txt#Fare "Fare") | If present, contains the total fare (that is, the total ticket costs) on this route. This property is only returned for transit requests and only for routes where fare information is available for all transit legs. See [Fare](https://developers.google.com/maps/documentation/directions/responses.md.txt#Fare) for more information. |

### Bounds

A rectangle in geographical coordinates from points at the southwest and northeast corners.

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `northeast` | **required** | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") for more information. |
| #### `southwest` | **required** | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") for more information. |

### LatLngLiteral

An object describing a specific location with Latitude and Longitude in decimal degrees.

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `lat` | **required** | number | Latitude in decimal degrees |
| #### `lng` | **required** | number | Longitude in decimal degrees |

### DirectionsLeg

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `end_address` | **required** | string | Contains the human-readable address (typically a street address) from reverse geocoding the `end_location` of this leg. This content is meant to be read as-is. Don't programmatically parse the formatted address. |
| #### `end_location` | **required** | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | The latitude/longitude coordinates of the given destination of this leg. Because the Directions API calculates directions between locations by using the nearest transportation option (usually a road) at the start and end points, `end_location` may be different than the provided destination of this leg if, for example, a road is not near the destination. See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral) for more information. |
| #### `start_address` | **required** | string | Contains the human-readable address (typically a street address) resulting from reverse geocoding the `start_location` of this leg. This content is meant to be read as-is. Don't programmatically parse the formatted address. |
| #### `start_location` | **required** | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | The latitude/longitude coordinates of the origin of this leg. Because the Directions API calculates directions between locations by using the nearest transportation option (usually a road) at the start and end points, `start_location` may be different than the provided origin of this leg if, for example, a road is not near the origin. See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral) for more information. |
| #### `steps` | **required** | Array\<[DirectionsStep](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsStep "DirectionsStep")\> | An array of steps denoting information about each separate step of the leg of the journey. See [DirectionsStep](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsStep) for more information. |
| #### `traffic_speed_entry` | optional | Array\<[DirectionsTrafficSpeedEntry](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTrafficSpeedEntry "DirectionsTrafficSpeedEntry")\> | > [!WARNING] > **[Deprecated:](https://developers.google.com/maps/deprecations.md.txt)** This array is always empty. Information about traffic speed along the leg. See [DirectionsTrafficSpeedEntry](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTrafficSpeedEntry) for more information. |
| #### `via_waypoint` | **required** | Array\<[DirectionsViaWaypoint](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsViaWaypoint "DirectionsViaWaypoint")\> | The locations of via waypoints along this leg. See [DirectionsViaWaypoint](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsViaWaypoint) for more information. |
| #### `arrival_time` | optional | [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject "TimeZoneTextValueObject") | Contains the estimated time of arrival for this leg. This property is only returned for transit directions. See [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject) for more information. |
| #### `departure_time` | optional | [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject "TimeZoneTextValueObject") | Contains the estimated time of departure for this leg, specified as a Time object. The `departure_time` is only available for transit directions. See [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject) for more information. |
| #### `distance` | optional | [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject "TextValueObject") | The total distance covered by this leg. See [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject) for more information. |
| #### `duration` | optional | [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject "TextValueObject") | The total duration of this leg. See [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject) for more information. |
| #### `duration_in_traffic` | optional | [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject "TextValueObject") | Indicates the total duration of this leg. This value is an estimate of the time in traffic based on current and historical traffic conditions. See the `traffic_model` request parameter for the options you can use to request that the returned value is optimistic, pessimistic, or a best-guess estimate. The duration in traffic is returned only if all of the following are true: - The request does not include stopover waypoints. If the request includes waypoints, they must be prefixed with `via:` to avoid stopovers. - The request is specifically for driving directions---the mode parameter is set to `driving`. - The request includes a `departure_time` parameter. - Traffic conditions are available for the requested route. See [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject) for more information. |

### DirectionsStep


Each element in the steps array defines a single step of the calculated directions. A step is the
most atomic unit of a direction's route, containing a single step describing a specific, single
instruction on the journey. E.g. "Turn left at W. 4th St." The step not only describes the
instruction but also contains distance and duration information relating to how this step relates
to the following step. For example, a step denoted as "Merge onto I-80 West" may contain a
duration of "37 miles" and "40 minutes," indicating that the next step is 37 miles/40 minutes from
this step.


When using the Directions API to search for transit directions, the steps array will include
additional transit details in the form of a transit_details array. If the directions include
multiple modes of transportation, detailed directions will be provided for walking or driving
steps in an inner steps array. For example, a walking step will include directions from the start
and end locations: "Walk to Innes Ave \& Fitch St". That step will include detailed walking
directions for that route in the inner steps array, such as: "Head north-west", "Turn left onto
Arelious Walker", and "Turn left onto Innes Ave".

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `duration` | **required** | [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject "TextValueObject") | Contains the typical time required to perform the step, until the next step. This field may be undefined if the duration is unknown. See [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject) for more information. |
| #### `end_location` | **required** | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | Contains the location of the last point of this step. See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral) for more information. |
| #### `html_instructions` | **required** | string | Contains formatted instructions for this step, presented as an HTML text string. This content is meant to be read as-is. Don't programmatically parse this display-only content. |
| #### `polyline` | **required** | [DirectionsPolyline](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsPolyline "DirectionsPolyline") | Contains a single points object that holds an [encoded polyline](https://developers..google.com/maps/documentation/utilities/polylinealgorithm) representation of the step. This polyline is an approximate (smoothed) path of the step. See [DirectionsPolyline](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsPolyline) for more information. |
| #### `start_location` | **required** | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | Contains the location of the starting point of this step. See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral) for more information. |
| #### `travel_mode` | **required** | [TravelMode](https://developers.google.com/maps/documentation/directions/responses.md.txt#TravelMode "TravelMode") | Contains the type of travel mode used. See [TravelMode](https://developers.google.com/maps/documentation/directions/responses.md.txt#TravelMode) for more information. |
| #### `distance` | optional | [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject "TextValueObject") | Contains the distance covered by this step until the next step. This field may be undefined if the distance is unknown. See [TextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TextValueObject) for more information. |
| #### `maneuver` | optional | string | Contains the action to take for the current step (turn left, merge, straight, etc.). Values are subject to change, and new values may be introduced without prior notice. The allowed values include: `turn-slight-left`, `turn-sharp-left`, `turn-left`, `turn-slight-right`, `turn-sharp-right`, `keep-right`, `keep-left`, `uturn-left`, `uturn-right`, `turn-right`, `straight`, `ramp-left`, `ramp-right`, `merge`, `fork-left`, `fork-right`, `ferry`, `ferry-train`, `roundabout-left`, and `roundabout-right` |
| #### `steps` | optional |   | Contains detailed directions for walking or driving steps in transit directions. Substeps are only available when travel_mode is set to "transit". The inner steps array is of the same type as steps. |
| #### `transit_details` | optional | [DirectionsTransitDetails](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitDetails "DirectionsTransitDetails") | Details pertaining to this step if the travel mode is `transit`. See [DirectionsTransitDetails](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitDetails) for more information. |

### TextValueObject

An object containing a numeric value and its formatted text representation.

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `text` | **required** | string | String value. |
| #### `value` | **required** | number | Numeric value. |

### DirectionsPolyline


[Polyline encoding](https://developers.google.com/maps/documentation/utilities/polylinealgorithm.md.txt)
is a lossy compression algorithm that lets you store a series of coordinates as a single string.
Point coordinates are encoded using signed values. If you only have a few static points, you may
also want to use the interactive polyline encoding utility.


The encoding process converts a binary value into a series of character codes for ASCII characters
using the familiar base64 encoding scheme: to ensure proper display of these characters, encoded
values are summed with 63 (the ASCII character '?') before converting them into ASCII. The
algorithm also checks for additional character codes for a given point by checking the least
significant bit of each byte group; if this bit is set to 1, the point is not yet fully formed and
additional data must follow.


Additionally, to conserve space, points only include the offset from the previous point (except of
course for the first point). All points are encoded in Base64 as signed integers, as latitudes and
longitudes are signed values. The encoding format within a polyline needs to represent two
coordinates representing latitude and longitude to a reasonable precision. Given a maximum
longitude of +/- 180 degrees to a precision of 5 decimal places (180.00000 to -180.00000), this
results in the need for a 32 bit signed binary integer value.

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `points` | **required** | string | A single string representation of the polyline. |

### TravelMode

- `DRIVING` (default) indicates calculation using the road network.
- `BICYCLING` requests calculation for bicycling using bicycle paths \& preferred streets (where available).
- `TRANSIT` requests calculation using public transit routes (where available).
- `WALKING` requests calculation for walking using pedestrian paths \& sidewalks (where available).


### DirectionsTransitDetails

Additional information that is not relevant for other modes of transportation.

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `arrival_stop` | optional | [DirectionsTransitStop](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitStop "DirectionsTransitStop") | The arrival transit stop. See [DirectionsTransitStop](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitStop) for more information. |
| #### `arrival_time` | optional | [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject "TimeZoneTextValueObject") | See [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject "TimeZoneTextValueObject") for more information. |
| #### `departure_stop` | optional | [DirectionsTransitStop](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitStop "DirectionsTransitStop") | The departure transit stop. See [DirectionsTransitStop](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitStop) for more information. |
| #### `departure_time` | optional | [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject "TimeZoneTextValueObject") | See [TimeZoneTextValueObject](https://developers.google.com/maps/documentation/directions/responses.md.txt#TimeZoneTextValueObject "TimeZoneTextValueObject") for more information. |
| #### `headsign` | optional | string | Specifies the direction in which to travel on this line, as it is marked on the vehicle or at the departure stop. This will often be the terminus station. |
| #### `headway` | optional | integer | Specifies the expected number of seconds between departures from the same stop at this time. For example, with a `headway` value of 600, you would expect a ten minute wait if you should miss your bus. |
| #### `line` | optional | [DirectionsTransitLine](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitLine "DirectionsTransitLine") | Contains information about the transit line used in this step. See [DirectionsTransitLine](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitLine) for more information. |
| #### `num_stops` | optional | integer | The number of stops from the departure to the arrival stop. This includes the arrival stop, but not the departure stop. For example, if your directions involve leaving from Stop A, passing through stops B and C, and arriving at stop D, `num_stops` will return 3. |
| #### `trip_short_name` | optional | string | The text that appears in schedules and sign boards to identify a transit trip to passengers. The text should uniquely identify a trip within a service day. For example, "538" is the `trip_short_name` of the Amtrak train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA. |

<br />

### DirectionsTransitStop

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `location` | **required** | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | The location of the stop. See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral) for more information. |
| #### `name` | **required** | string | The name of the transit stop. |

### TimeZoneTextValueObject

An object containing Unix epoch time, a time zone, and its formatted text representation.

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `text` | **required** | string | The time specified as a string in the time zone. |
| #### `time_zone` | **required** | string | Contains the time zone. The value is the name of the time zone as defined in the [IANA Time Zone Database](http://www.iana.org/time-zones), e.g. "America/New_York". |
| #### `value` | **required** | number | The time specified as Unix epoch time, or seconds since midnight, January 1, 1970 UTC. |

### DirectionsTransitLine

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `agencies` | **required** | Array\<[DirectionsTransitAgency](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitAgency "DirectionsTransitAgency")\> | The transit agency (or agencies) that operates this transit line. See [DirectionsTransitAgency](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitAgency) for more information. |
| #### `name` | **required** | string | The full name of this transit line, e.g. "8 Avenue Local". |
| #### `color` | optional | string | The color commonly used in signage for this line. |
| #### `icon` | optional | string | Contains the URL for the icon associated with this line. |
| #### `short_name` | optional | string | The short name of this transit line. This will normally be a line number, such as "M7" or "355". |
| #### `text_color` | optional | string | The color commonly used in signage for this line. |
| #### `url` | optional | string | Contains the URL for this transit line as provided by the transit agency. |
| #### `vehicle` | optional | [DirectionsTransitVehicle](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitVehicle "DirectionsTransitVehicle") | The type of vehicle that operates on this transit line. See [DirectionsTransitVehicle](https://developers.google.com/maps/documentation/directions/responses.md.txt#DirectionsTransitVehicle) for more information. |

### DirectionsTransitAgency

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `name` | optional | string | The name of this transit agency. |
| #### `phone` | optional | string | The transit agency's phone number. |
| #### `url` | optional | string | The transit agency's URL. |

### DirectionsTransitVehicle

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `name` | **required** | string | The name of this vehicle, capitalized. |
| #### `type` | **required** | string | The type of vehicle used. - `BUS` - Bus. - `CABLE_CAR` - A vehicle that operates on a cable, usually on the ground. Aerial cable cars may be of the type GONDOLA_LIFT. - `COMMUTER_TRAIN` - Commuter rail. - `FERRY` - Ferry. - `FUNICULAR` - A vehicle that is pulled up a steep incline by a cable. A Funicular typically consists of two cars, with each car acting as a counterweight for the other. - `GONDOLA_LIFT` - An aerial cable car. - `HEAVY_RAIL` - Heavy rail. - `HIGH_SPEED_TRAIN` - High speed train. - `INTERCITY_BUS` - Intercity bus. - `LONG_DISTANCE_TRAIN` - Long distance train. - `METRO_RAIL` - Light rail transit. - `MONORAIL` - Monorail. - `OTHER` - All other vehicles will return this type. - `RAIL` - Rail. - `SHARE_TAXI` - Share taxi is a kind of bus with the ability to drop off and pick up passengers anywhere on its route. - `SUBWAY` - Underground light rail. - `TRAM` - Above ground light rail. - `TROLLEYBUS` - Trolleybus. The allowed values include: `BUS`, `CABLE_CAR`, `COMMUTER_TRAIN`, `FERRY`, `FUNICULAR`, `GONDOLA_LIFT`, `HEAVY_RAIL`, `HIGH_SPEED_TRAIN`, `INTERCITY_BUS`, `LONG_DISTANCE_TRAIN`, `METRO_RAIL`, `MONORAIL`, `OTHER`, `RAIL`, `SHARE_TAXI`, `SUBWAY`, `TRAM`, and `TROLLEYBUS` |
| #### `icon` | optional | string | Contains the URL for an icon associated with this vehicle type. |
| #### `local_icon` | optional | string | Contains the URL for the icon associated with this vehicle type, based on the local transport signage. |

### DirectionsTrafficSpeedEntry

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `offset_meters` | **required** | number | The offset along the path (in meters) up to which this speed category is valid. |
| #### `speed_category` | **required** | string | The current traffic/speed conditions on this portion of a path. |

### DirectionsViaWaypoint

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `location` | optional | [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral "LatLngLiteral") | The location of the waypoint. See [LatLngLiteral](https://developers.google.com/maps/documentation/directions/responses.md.txt#LatLngLiteral) for more information. |
| #### `step_index` | optional | integer | The index of the step containing the waypoint. |
| #### `step_interpolation` | optional | number | The position of the waypoint along the step's polyline, expressed as a ratio from 0 to 1. |

### Fare

The total fare for the route.

    {
      "currency" : "USD",
      "value" : 6,
      "text" : "$6.00"
    }

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `currency` | **required** | string | An [ISO 4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) indicating the currency that the amount is expressed in. |
| #### `text` | **required** | string | The total fare amount, formatted in the requested language. |
| #### `value` | **required** | number | The total fare amount, in the currency specified. |


### DirectionsStatus


The status field within the Directions response object contains the status of the request, and may
contain debugging information to help you track down why the Directions service failed. The status
field may contain the following values:

- `OK` indicates the response contains a valid result.
- `NOT_FOUND` indicates at least one of the locations specified in the request's origin, destination, or waypoints couldn't be geocoded.
- `ZERO_RESULTS` indicates no route could be found between the origin and destination.
- `MAX_WAYPOINTS_EXCEEDED` indicates that too many waypoints were provided in the request. For applications using the Directions API as a web service, or the directions service in the Maps JavaScript API, the maximum allowed number of waypoints is 25, plus the origin and destination.
- `MAX_ROUTE_LENGTH_EXCEEDED` indicates the requested route is too long and cannot be processed. This error occurs when more complex directions are returned. Try reducing the number of waypoints, turns, or instructions.
- `INVALID_REQUEST` indicates that the provided request was invalid. Common causes of this status include an invalid parameter or parameter value.
- `OVER_DAILY_LIMIT` indicates any of the following:
  - The API key is missing or invalid.
  - Billing has not been enabled on your account.
  - A self-imposed usage cap has been exceeded.
  - The provided method of payment is no longer valid (for example, a credit card has expired).

  See the [Maps FAQ](https://developers.google.com/maps/faq.md.txt#over-limit-key-error) to learn how to fix this.
- `OVER_QUERY_LIMIT` indicates the service has received too many requests from your application within the allowed time period.
- `REQUEST_DENIED` indicates that the service denied use of the directions service by your application.
- `UNKNOWN_ERROR` indicates a directions request couldn't be processed due to a server error. The request may succeed if you try again.

<br />

### DirectionsGeocodedWaypoint

| Field | Required | Type | Description |
|:---|---|---|---|
| #### `geocoder_status` | optional | string | Indicates the status code resulting from the geocoding operation. This field may contain the following values. The allowed values include: `OK`, and `ZERO_RESULTS` |
| #### `partial_match` | optional |   | Indicates that the geocoder did not return an exact match for the original request, though it was able to match part of the requested address. You may want to examine the original request for misspellings and/or an incomplete address. Partial matches most often occur for street addresses that don't exist within the locality you pass in the request. Partial matches may also be returned when a request matches two or more locations in the same locality. For example, "21 Henr St, Bristol, UK" will return a partial match for both Henry Street and Henrietta Street. Note that if a request includes a misspelled address component, the geocoding service may suggest an alternative address. Suggestions triggered in this way will also be marked as a partial match. |
| #### `place_id` | optional | string | A unique identifier that can be used with other Google APIs. See the [Place ID overview](https://developers.google.com/maps/documentation/places/web-service/place-id.md.txt). |
| #### `types` | optional | Array\<string\> | Indicates the address type of the geocoding result used for calculating directions. - `administrative_area_level_1` indicates a first-order civil entity below the country level. Within the United States, these administrative levels are states. Not all nations exhibit these administrative levels. In most cases, administrative_area_level_1 short names will closely match ISO 3166-2 subdivisions and other widely circulated lists; however this is not guaranteed as our geocoding results are based on a variety of signals and location data. - `administrative_area_level_2` indicates a second-order civil entity below the country level. Within the United States, these administrative levels are counties. Not all nations exhibit these administrative levels. - `administrative_area_level_3` indicates a third-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels. - `administrative_area_level_4` indicates a fourth-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels. - `administrative_area_level_5` indicates a fifth-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels. - `airport` indicates an airport. - `colloquial_area` indicates a commonly-used alternative name for the entity. - `country` indicates the national political entity, and is typically the highest order type returned by the Geocoder. - `intersection` indicates a major intersection, usually of two major roads. - `locality` indicates an incorporated city or town political entity. - `natural_feature` indicates a prominent natural feature. - `neighborhood` indicates a named neighborhood - `park` indicates a named park. - `plus_code` indicates an encoded location reference, derived from latitude and longitude. Plus codes can be used as a replacement for street addresses in places where they don't exist (where buildings are not numbered or streets are not named). See [](https://plus.codes/)<https://plus.codes> for details. - `point_of_interest` indicates a named point of interest. Typically, these "POI"s are prominent local entities that don't readily fit into another category, such as "Empire State Building" or "Eiffel Tower". - `political` indicates a political entity. Usually, this type indicates a polygon of some civil administration. - `postal_code` indicates a postal code as used to address postal mail within the country. - `premise` indicates a named location, usually a building or collection of buildings with a common name - `route` indicates a named route (such as "US 101"). - `street_address` indicates a precise street address. - `sublocality` indicates a first-order civil entity below a locality. For some locations may receive one of the additional types: sublocality_level_1 to sublocality_level_5. Each sublocality level is a civil entity. Larger numbers indicate a smaller geographic area. - `subpremise` indicates a first-order entity below a named location, usually a singular building within a collection of buildings with a common name - `tourist_attraction` indicates a tourist attraction. - `train_station` indicates a train station. - `transit_station` indicates a transit station. An empty list of types indicates there are no known types for the particular address component, for example, Lieu-dit in France. |