PROFESSIONAL DEVELOPER PLATFORM
Integrate location APIs with JavaScript, Python, Kotlin or Swift. Explore code samples, the CLI, remote MCP and mobile access setup.
Choose a goal, test your own input, then copy the matching code. Your API key stays in this page's memory.
Create KeyThis uses your account's normal credits: Route/Search 1, Trip 5; Matrix varies by cell count. Plan and rate limits apply.
Set OSRM_API_KEY in your server environment. Never ship a secret key in public browser code.
curl --fail-with-body 'https://osrmroute.com/api/v1/osrm/route/v1/driving/55.2708,25.2048;55.2796,25.1972?overview=full&geometries=geojson' \
-H "Authorization: Bearer $OSRM_API_KEY"GET /api/v1/osrm/route/v1/driving/ 55.2708,25.2048;55.2796,25.1972Find an API by name, use case or endpoint. Each entry links to its parameters, examples and usage limits.
/api/v1/studio/preview/api/v1/maps/static/api/v1/studio/{resource}/api/v1/osrm/route/v1/{profile}/{coordinates}/api/v1/truck/route/api/v1/load-plans/api/1/vrp/api/v1/osrm/table/v1/{profile}/{coordinates}/api/1/isochrone/api/v1/osrm/match/v1/{profile}/{coordinates}/api/v1/osrm/nearest/v1/{profile}/{coordinates}/api/v1/osrm/trip/v1/{profile}/{coordinates}/api/1/directions/api/1/directions/api/1/snap/api/v1/fuel/estimate/api/v1/places/along-route/api/1/geocode/api/1/places/api/1/autocomplete/api/1/geocode/batch/api/v1/search/natural/api/v1/places/details/api/v1/search/structured/api/v1/search/suggest/api/v1/roads/signs/api/v1/roads/lookup/api/v1/maps/datasets/{id}/query/api/1/cluster/api/1/timezone/api/1/elevation/api/1/boundary/api/1/geofence/api/1/elevation/profile/api/1/solar/api/1/geometry/api/1/convert/api/1/countryJavaScript, Python, Kotlin and Swift clients for your API integrations.
npm install osrmrouteimport { OSRMRoute } from 'osrmroute';
const maps = new OSRMRoute({ apiKey: process.env.OSRMROUTE_API_KEY });
// Point helpers use [lat, lon]; raw VRP arrays use [lon, lat].
const res = await maps.route([
[40.4093, 49.8671],
[40.3777, 49.8920],
]);
const route = res.routes[0];
console.log(`${(route.distance / 1000).toFixed(1)} km`);
// Address search, matrix, isochrones, fleet optimisation…
const hits = await maps.geocode('Nizami küçəsi, Bakı');
const grid = await maps.matrix([[40.40, 49.86], [40.37, 49.89]]);Get the job done fast with tools that make setup easy.
Documentation covering every API detail, from getting-started guides to complex routing scenarios.
Send API requests and see the results instantly, both as code and on an interactive map. The fastest testing tool.
Use JavaScript/TypeScript via npm, Python via PyPI, Kotlin via Maven Central, or Swift via its GitHub package URL. Source downloads and installation guides are included.
Our geospatial routing infrastructure is specifically tuned to solve the toughest logistics and courier problems fast.
Routes are computed instantly via OSRM's internal optimized C++ engine.
Driving, walking and cycling routes and address search worldwide. Routes require mapped, connected roads or paths that allow the selected travel mode. Detailed local data varies by service.
# 1. Send a route request with your API key
curl --fail-with-body "https://osrmroute.com/api/v1/osrm/route/v1/driving/\
49.8671,40.4093;49.8550,40.4150?overview=full&geometries=geojson" \
-H "Authorization: Bearer $OSRM_API_KEY"
# 2. Fast JSON response returned from the server
{
"code": "Ok",
"routes": [{
"geometry": {
"coordinates": [[49.8671, 40.4093], ...],
"type": "LineString"
},
"distance": 3254.2,
"duration": 245.8
}]
}