Route and directions
What is routing?
Routing, also known as simple routing, is the process of finding the best path from an origin to a destination for an individual or single vehicle. Routing takes into consideration many different data parameters in the street network such as speed limit, number of lanes, and time of day. Routing can also take into consideration other real-time data such as road conditions, accidents, and other barriers.
You can use routing to build applications that:
- Find the shortest path from an origin to a destination
- Find the quickest path to multiple destinations
- Generate driving directions in multiple languages
How routing works
The typical workflow for creating a route is to:
- Define the origin, and stops, and destination.
- Define the type of travel for the route.
- Call the service to find the route features and directions.
You can create simple or optimized routes using the routing service.
A simple route is the shortest path between stops.
An optimized route is the most efficient path between stops.
To create an optimized route, you will need to use the find
parameter. Using the parameter will result in the stops being reordered to return the most efficient path between them.
How to navigate a route
Once you have a route, if you want to use your current device's location to track progress and provide navigation instructions (voice guidance) as you traverse the route, the best way to accomplish this is with the ArcGIS Maps SDKs for Native Apps.
URL requests
You can find a route and directions by making an HTTPS request to the routing service solve
operation or by using client APIs. Specify the origin, destination, and optionally, additional parameters to refine the results with directions. Some of the most common parameters are described provided below.
Request limits
Limit | Direct | Job |
---|---|---|
Maximum number of stops | 150 | 10,000 |
Maximum transaction time: | 5 minutes | 60 minutes |
Maximum number of point barriers: | 250 | 250 |
Maximum number of street features intersected by polyline barriers: | 500 | 500 |
Maximum number of street features intersected by polygon barriers: | 2,000 | 2,000 |
Maximum straight-line distance for the walking travel mode: (If the straight-line distance between any stops is greater than this limit, the analysis will fail when the walking restriction is used.) | 27 miles (43.45 kilometers) | 27 miles (43.45 kilometers) |
Force hierarchy beyond a straight-line distance of: (If the straight-line distance between any stops is greater than the limit shown here, the analysis uses hierarchy, even if the travel_ defines not to use hierarchy.) | 50 miles (80.46 kilometers) | 50 miles (80.46 kilometers) |
Maximum snap tolerance: (If the distance between an input point and its nearest traversable street is greater than the distance specified here, the point is excluded from the analysis.) | 12.42 miles (20 kilometers) | 12.42 miles (20 kilometers) |
Maximum number of directions features that can be returned: | No limit | 1,000,000 |
Maximum number of route edges that can be returned: | Not available | 1,000,000 |
Required parameters
Name | Description | Examples |
---|---|---|
f | The format of the data returned. | f=json f=pjson f=geojson f=html |
token | An API key or OAuth 2.0 access token. Learn how to get an access token in Security and authentication. | token=< token=< |
stops | The two or more locations that need to be visited in the route. | stops=-117,34; -117.5,34.5 |
find | Specify whether the service should find the best sequence when visiting multiple destinations. Note: Set this parameter to true to generate an optimized route. | find |
Direct
Use for shorter transactions with less than 150 stops that will complete in less than 5 minutes.
Key parameters
Name (Direct) | Description | Examples |
---|---|---|
travel | The mode of transportation such as driving a car or a truck or walking. | travel JSON Object |
start | The time at which travel begins from the input stops. You can also specify a value of now , to set the depart time to the current time. | start |
return | Generate driving directions for each route. | return |
directions | The language to be used when generating driving directions. | directions |
Additional parameters: Set additional constraints for a route such as temporary slowdowns, using polygon
, or set output
to specify the type of route feature created by the service.
Job
Use for longer transactions with up to 10,000 stops that will complete in less than 60 minutes.
Required parameters
Name | Description | Examples |
---|---|---|
f | The format of the data returned. | f=json f=pjson f=geojson f=html |
token | An API key or OAuth 2.0 access token. Learn how to get an access token in Security and authentication. | token=< token=< |
stops | The two or more locations that need to be visited in the route. | stops=-117,34; -117.5,34.5 |
reorder_ | Specify whether the service should find the best sequence when visiting multiple destinations. Note:Set this parameter to true to return an optimized route. | reorder_ |
Key parameters
Name (Job) | Description | Examples |
---|---|---|
travel_ | The mode of transportation such as driving a car or a truck or walking. | travel_ JSON Object |
time_ | The time at which travel begins from the input stops. | time_ |
populate_ | Generate driving directions for each route. | populate_ |
directions_ | The language to be used when generating driving directions. | directions_ |
Additional parameters: Set additional constraints such as temporary slowdowns, using polygon_
, route_
to specify the type of route feature created by the service, or set return_
if the start and end location for your route is same.
Code examples
Direct: Find a route and directions
In this example, use the routing service to find a route between a set of stops that accounts for current traffic conditions and generate driving directions in Spanish.
To find a route, you need to define at least two stops to visit. The default travel
is driving time by vehicle, but you can use walk or trucking travel modes as well. It is always good to provide the start
to get the best results. In this example, we specify start
as now
which sets the route departure time as the current time and also indicates to the service that the route should use the current traffic conditions. We also set the directions
to generate driving directions in our language of choice.
The response contains a set of ordered stops to visit, the route segments, and turn-by-turn text directions.
APIs
REST API
Job: Find multiple routes
In this example, you will find the travel time and travel distance for multiple routes operated by a long-haul logistics company.
We group a pair of stops that define a route by assigning them a unique
Route
value. This allows the service to find all the routes in a single request as compared to sending multiple requests for each route, thus improving the overall performance.Name We specify the Trucking Time
travel_
since we are finding routes for trucks and not cars.mode Since we are only interested in finding the travel time and travel distance for our routes and do not need the route geometry, we set the
route_
toshape None
.We also do not need driving directions for our routes. So we set the
populate_
todirections false
.
APIs
REST API
Unlike Direct request type which allows you to make a request and get back all the results in the response, when working with a Job request type, you need to follow a three step workflow:
- Make the
submit
request with the appropriate request parameters to get a job id.Job - Using the job id, check the job status to see if the job completed successfully.
- Use the job id to get one or more results.
Tutorials

Find a route and directions
Find a route and directions with the routing service.

Find service areas
Create an isochrone with driving distance with the routing service.
Services
Routing service
Get turn-by-turn directions and solve advanced routing problems.
API support
Routing | Optimized Routing | Fleet routing | Closest facility routing | Service areas | Location-allocation | Travel cost matrix | |
---|---|---|---|---|---|---|---|
ArcGIS Maps SDK for JavaScript | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for .NET | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Kotlin | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Swift | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Java | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Qt | 1 | 1 | 1 | ||||
ArcGIS API for Python | |||||||
ArcGIS REST JS | |||||||
Esri Leaflet | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
MapLibre GL JS | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
OpenLayers | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
- 1. Access with geoprocessing task.
- 2. Access via ArcGIS REST JS.
Tools
Developer dashboard
Manage API keys, service usage, and data with the ArcGIS Developers website.
ArcGIS Online
Create, manage, and share content and data with cloud-based GIS tools.
Map Viewer
Create, explore, and share web maps for 2D applications.
Scene Viewer
Create, explore, and share web scenes for 3D applications.
ArcGIS Pro
Explore, visualize, and analyze both 2D and 3D data with desktop GIS tools.