Routing API
Driving, walking, and cycling routes through up to 20 stops, with the distance, the travel time, and a line to draw for every leg. Here's downtown Portland to Multnomah Falls, three ways:
- 34 min
- 2 h 58 min
- 11 h 29 min
Try a route
Routes start at Pioneer Courthouse Square. Click the map to pick a destination, then switch the travel mode. Each route comes from the live API.
- Pioneer Courthouse Square
- OMSI
Click the map to change the destination.
Travel times by mode
Six trips from downtown Portland, from a bookstore around the corner to the Oregon coast, each routed three ways. Every mode follows its own network: bike lanes and paths, footpaths and stairs, or roads.
Times use a log scale, so each gridline is 10 times longer than the one before. Hover a dot for the details.
Show the data as a table
| To | Drive | Bike | Walk |
|---|---|---|---|
| Powell's City of Books | 3 min, 0.7 mi | 4 min, 0.6 mi | 9 min, 0.4 mi |
| OMSI | 4 min, 1.3 mi | 8 min, 1.3 mi | 23 min, 1.2 mi |
| Portland Airport | 17 min, 13 mi | 54 min, 9.5 mi | 2 h 44 min, 8.6 mi |
| Multnomah Falls | 34 min, 30 mi | 2 h 58 min, 32 mi | 11 h 29 min, 36 mi |
| Timberline Lodge | 1 h 19 min, 63 mi | 6 h 17 min, 63 mi | 17 h 35 min, 56 mi |
| Cannon Beach | 1 h 30 min, 79 mi | 10 h 6 min, 95 mi | 26 h 56 min, 85 mi |
Request and response
POST the stops and a travel mode. The route comes back with whole meters and seconds, one entry in legs per pair of stops, and an encoded polyline with six decimal places.
- 2 to 20 waypoints, visited in the order you give
drive,walk, orbicycle- No route between the stops? It isn't billed.
Routes don't include live traffic, public transit, turn-by-turn instructions, tolls, or route matrices, and stops aren't reordered for you.
Routing docscurl "https://api.mapricot.com/v1/route" \
-H "Authorization: Bearer $MAPRICOT_KEY" \
-H "Content-Type: application/json" \
-d '{
"waypoints": [
{ "lat": 43.7396, "lon": 7.4275 },
{ "lat": 43.734, "lon": 7.4222 }
],
"mode": "walk"
}'{ "routes": [ { "distanceMeters": 1044, "durationSeconds": 739, "polyline": "{{slrAmyidMzImEvQwGlE}ATJXDTC@Ab@Qb@[`Au…", "legs": [ { "distanceMeters": 1044, "durationSeconds": 739 } ] } ], "attribution": [ { "source": "openstreetmap", "text": "© OpenStreetMap contributors", "url": "https://www.openstreetmap.org/copyright" } ]}Valhalla and OpenStreetMap
Routing runs on Valhalla, the open-source routing engine, with a road network built from OpenStreetMap for every country. Show the credit in each response's attribution.
- OpenStreetMap
Other APIs
One account and one API key cover every Mapricot API, and the free allowance is shared between them.
Start with 250,000 free requests
Sign in with your email, create an API key, and make your first request in a few minutes. No credit card required.