Getting street directions with ArcGIS API

Number of APIs: 3

This collection uses the ArcGIS API to geocode addresses and find directions between two locations.

Watch the livestream demo here

How to use

1. Get an access token

See the instructions on the Auth folder

2. Enter locations

On the Getting street directions with ArcGIS API collection, head to the collection Variables tab and provide a single line address for locationA and locationB

3. Run the Get directions folder

Select the Get directions folder and click the Run button in the upper right to run all the requests. Press the big blue button on the next screen to start the run.

This will populate important variables automatically for our workflow (you can see how this happens in the Tests tab of each request).

4. Visualize the Get directions request

After completing the run in step three, click the GET Get directions request and run it once manually.

Head to the Visualize tab in the response to see the directions printed: image

That's it!

Feel free to add on to this - how long does it take to get from location A to B?

  1. Get directions - Get directions GET https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve?f=json&stops={{aX}},{{aY}};{{bX}},{{bY}};&startTime=now&returnDirections=true&directionsLanguage=en

  2. Get directions - Geocode location B GET https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?token={{access_token}}&f=json&singleLine={{locationB}}

  3. Auth - Get access token POST https://www.arcgis.com/sharing/rest/generateToken