osrmroute

PROFESSIONAL DEVELOPER PLATFORM

Developer Tools, SDKs & APIs

Integrate location APIs with JavaScript, Python, Kotlin or Swift. Explore code samples, the CLI, remote MCP and mobile access setup.

SDKs & Libraries

Your first working integration

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.

Bash
read -rsp "OSRM_API_KEY: " OSRM_API_KEY && export OSRM_API_KEY
echo
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"

A successful route has code Ok. Read routes[0].distance in metres and routes[0].duration in seconds.

API directory

Find an API by name, use case or endpoint. Each entry links to its parameters, examples and usage limits.

Maps

Navigation

Data

Official SDKs

JavaScript, Python, Kotlin and Swift clients for your API integrations.

Install
npm install osrmroute
import { 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]]);
  • JavaScript and Python SDKs have no runtime dependencies.
  • Helpers cover selected APIs; use HTTP for other operations.
  • Point helpers use [lat, lon]; raw VRP payload coordinates use [lon, lat].

Developer Resources and Tools

Use the documentation, request explorer and SDK installation guides for an integration.

Technical Docs

Reference material, integration guides and examples for the supported APIs.

API Explorer

Send a request and inspect its response as code and on an interactive map. Test with inputs that represent your application.

SDKs & Libraries

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.

OSRMRoute Support

Talk directly to our team

HERE TO HELP

How can we help?

Send a message. Ticket replies are also sent to your verified email.

Your chats

Your chats will appear here.