Search for directions and estimated travel time between locations
Find directions by specific criteria.
URL
GET https://maps-api.apple.com/v1/directionsQuery Parameters
| Name | Type | Description |
|---|---|---|
origin Required | string | The starting location as an address, or coordinates you specify as latitude, longitude. For example, |
destination Required | string | The destination as an address, or coordinates you specify as latitude, longitude. For example, |
arrivalDate Optional | string | The date and time to arrive at the destination in ISO 8601 format in UTC time. For example, You can specify only |
avoid Optional | [DirectionsAvoid] | A comma-separated list of the features to avoid when calculating direction routes. For example, See DirectionsAvoid for a complete list of possible values. |
departureDate Optional | string | The date and time to depart from the origin in ISO 8601 format in UTC time. For example, You can only specify |
lang Optional | Lang | The language the server uses when returning the response, specified using a BCP 47 language code. For example, for English, use |
requestsAlternateRoutes Optional | boolean | When you set this to |
searchLocation Optional | SearchLocation | A If you don’t provide a |
searchRegion Optional | SearchRegion | A region the app defines as a hint for the query input for If you don’t provide a |
transportType Optional | string | The mode of transportation the server returns directions for. |
userLocation Optional | UserLocation | The location of the user, specified as a comma-separated string that contains the latitude and longitude. For example, If you don’t provide a |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 200 | OK Content-Type: application/json | DirectionsResponse | Returns a DirectionsResponse result that describes the steps and routes from the origin to the destination. |
| 400 | Bad Request Content-Type: application/json | ErrorResponse | An ErrorResponse object that contains an error message and an array of strings that contain additional details about the error. |
| 401 | Unauthorized Content-Type: application/json | ErrorResponse | An ErrorResponse object that contains an error message that indicates the Maps access token is missing or invalid, and an array of strings that contains additional details about the error. |
| 429 | Content-Type: application/json | ErrorResponse | An ErrorResponse object that indicates the call exceeds the daily service call quota for the authorization token. The app can try again later. If your app requires a larger daily quota, submit a quota increase request form. |
| 500 | Internal Server Error Content-Type: application/json | ErrorResponse | An ErrorResponse object that contains a server error message and an array of strings that describe additional details about the error. |