interface DirectionsResponseData {
    available_travel_modes: string[];
    error_message: string;
    geocoded_waypoints: GeocodedWaypoint[];
    html_attributions?: string[];
    next_page_token?: string;
    routes: DirectionsRoute[];
    status: Status;
}

Hierarchy (view full)

Properties

available_travel_modes: string[]

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.

error_message: string

When the top-level status code is other than OK, this field contains more detailed information about the reasons behind the given status code.

geocoded_waypoints: GeocodedWaypoint[]

contains an array with details about the geocoding of origin, destination and waypoints.

These details will not 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.

html_attributions?: string[]

may contain a set of attributions about this listing which must be displayed to the user (some listings may not have attribution).

next_page_token?: string

contains a token that can be used to return up to 20 additional results. A next_page_token will not be returned if there are no additional results to display. The maximum number of results that can be returned is 60. There is a short delay between when a next_page_token is issued, and when it will become valid.

routes: DirectionsRoute[]

contains an array of routes from the origin to the destination.

When the Directions API returns results, it places them within a (JSON) routes array. Even if the service returns no results (such as if the origin and/or destination doesn't exist) it still returns an empty routes array. (XML responses consist of zero or more <route> elements.)

Each element of the routes array contains a single result from the specified origin and destination. This route may consist of one or more legs depending on whether any waypoints were specified. As well, the route also contains copyright and warning information which must be displayed to the user in addition to the routing information.

status: Status

contains metadata on the request. See Status Codes below.