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.
Verify your account, then create a key in Dashboard → Projects. Save it securely when it is shown and enter it here. If you lose it, create a new key. Sign in to Dashboard
This uses your account's normal credits: Route/Search 1, Trip 5; Matrix varies by cell count. Plan and rate limits apply. Usage calculator
Set OSRM_API_KEY in your server environment. Never ship a secret key in public browser code.
read -rsp "OSRM_API_KEY: " OSRM_API_KEY && export OSRM_API_KEY
echocurl --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"A successful route has code Ok. Read routes[0].distance in metres and routes[0].duration in seconds.
Find an API by name, use case or endpoint. Each entry links to its parameters, examples and usage limits.
/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/v1/fuel/estimate/api/1/geocode/api/1/places/api/v1/roads/signs/api/v1/roads/lookup/api/1/timezone/api/1/elevation/api/1/boundary/api/1/geofenceJavaScript, Python, Kotlin and Swift clients for your API integrations.
npm install osrmrouteimport { OSRMRoute } from 'osrmroute';
const apiKey = process.env.OSRM_API_KEY;
if (!apiKey) throw new Error('OSRM_API_KEY is required');
const maps = new OSRMRoute({ apiKey, authMode: 'bearer', retries: 0 });
// 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]]);Use the documentation, request explorer and SDK installation guides for an integration.
Reference material, integration guides and examples for the supported APIs.
Send a request and inspect its response as code and on an interactive map. Test with inputs that represent your application.
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.