OSRM Alternative Routes API
RoutingHosted OSRM (Open Source Routing Machine) — production-ready API, no self-hosting.
Get several distinct route options in a single request so users can pick their preferred path.
Overview
The Alternative Routes API computes up to three genuinely different routes between your points in a single request. Ideal for giving drivers a choice, avoiding a blocked road, or comparing a fast vs. shorter path — each option includes full geometry, distance and duration.
API reference
GET
/api/1/directions| Parameter | Type | Status |
|---|---|---|
| point | string | Required |
| alternatives | integer | Optional |
| profile | string | Optional |
Example request
Credit cost: 1 creditcurl "https://osrmroute.com/api/1/directions?point=40.3777,49.8516&point=40.40,49.86&alternatives=2&key=YOUR_KEY"
Other services
Routing APIRoute Optimization APIGeocoding APIPlaces APIMatrix APIIsochrones APIMap Matching APINearest APITrip API (TSP)Location ClusteringDirections APISnap to Road APIAutocomplete APIBatch Geocoding APITimezone APIElevation APIBoundary Lookup APIGeofencing APIElevation Profile APISolar APIGeometry Utilities APICoordinate Conversion APICountry Info API