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.

Create Key

This 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"
Request exampleIllustrative demo
GET /api/v1/osrm/route/v1/driving/55.2708,25.2048;55.2796,25.1972

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 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]]);
  • Zero dependencies — nothing to conflict with your existing HTTP stack.
  • Fully typed, with all 23 endpoints covered.
  • Takes [lat, lon] everywhere and flips it internally, so routes never land in the ocean.

Developer Resources and Tools

Get the job done fast with tools that make setup easy.

Technical Docs

Documentation covering every API detail, from getting-started guides to complex routing scenarios.

API Explorer

Send API requests and see the results instantly, both as code and on an interactive map. The fastest testing tool.

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.

Why OSRMRoute?

Our geospatial routing infrastructure is specifically tuned to solve the toughest logistics and courier problems fast.

Millisecond-Level Latency

Routes are computed instantly via OSRM's internal optimized C++ engine.

Worldwide coverage

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.

routing-request.sh
# 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
  }]
}

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.