<!--
{
  "availability" : [
    "MapKit JS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/Directions/route",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "instm/mapkit.Directions/route"
  },
  "title" : "route(request)"
}
-->

# route(request)

Retrieves directions and estimated travel time based on the specified start and end points.

```
route(request: DirectionsRequest): Promise<DirectionsResponse>;
```

## Parameters

`request`

A [`DirectionsRequest`](/documentation/MapKitJS/DirectionsRequest) object that specifies details for the directions you want to retrieve.

## Return Value

A promise that resolves with a [`DirectionsResponse`](/documentation/MapKitJS/DirectionsResponse) on success, or rejects with an `Error` on failure.

## Discussion

Call the [`route(request)`](/documentation/MapKitJS/Directions/route) method to get directions.

The resolved [`DirectionsResponse`](/documentation/MapKitJS/DirectionsResponse) object has the following properties:

- [`request`](/documentation/MapKitJS/DirectionsResponse/request) is the request object associated with this response.
- [`routes`](/documentation/MapKitJS/DirectionsResponse/routes) contains an array of up to three [`Route`](/documentation/MapKitJS/Route) objects returned by the server.

Pass an `AbortSignal` from an `AbortController` to the [`signal`](/documentation/MapKitJS/DirectionsRequest/signal) option to allow the controller to cancel a pending request. When the controller aborts, the promise it returns rejects with a `DOMException` whose `name` is `"AbortError"`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)