Speed limits, road attributes and traffic-sign observations within available coverage.
Add enterprise-grade routing to your apps via a REST API. Get started right away with clear documentation, ready-made code samples and the high-performance OSRM engine.
Your first working integrationChoose a goal, test your own input, then copy the matching code. Your API key stays in this page's memory.
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"Combine routing, search and optimization APIs for your application. Validate performance with representative requests.
From point A to point B: industry-grade routing for different transport modes. Turn instructions, elevation profiles and accurate arrival times (ETA) — all within a single API.
Handle complex logistics and turn your fleet's toughest routing tasks into efficient delivery plans. Work with time windows, driver skills and custom vehicle constraints.
Connect place with logic: convert addresses to coordinates and coordinates to precise real addresses. High-performance geocoding and reverse geocoding for enterprise-grade applications.
Fast distance computation at scale: instantly compute the time and distance matrix between hundreds of points at once. Speed up your optimization algorithms based on real road networks.
Analyze travel time with reachability maps. Generate custom coverage polygons for any point, tailored to transport mode and road preferences.
Snap noisy GPS signals to the real road network. Turn scattered tracking coordinates into clean, accurate and logical route data.
Find points of interest near any location — cafes, shops, hotels, ATMs, pharmacies and more — filtered by category and radius, sorted by distance.
Snap any coordinate to the closest point on the real road network. Essential for cleaning GPS input before routing.
Solve the travelling-salesman problem: order a set of stops into the shortest round trip. Ideal for delivery loops and multi-stop errands.
Group large sets of locations into balanced clusters by proximity — perfect for splitting deliveries across drivers or defining service zones.
Turn-by-turn navigation with a clean, easy-to-render instruction list for car, bike and foot.
Get several distinct route options in a single request so users can pick their preferred path.
Snap noisy GPS coordinates onto the nearest point of the real road network.
Fast, typo-tolerant place suggestions as the user types, with optional location bias.
Geocode hundreds of addresses in a single request — ideal for data pipelines and imports.
Get the IANA time zone, current UTC offset, DST status and local time for any coordinate on Earth.
Height above sea level, in metres, for any coordinate — one point or a whole route profile.
Find which country, state, city and district a coordinate falls in — with the boundary polygon on request.
Test in one call which of your zones each point falls inside — polygon or circular fences.
Elevation at every point of a path plus total ascent, descent and distance — a full route profile.
Sunrise, sunset, twilight, solar noon and day length for any coordinate and date.
Distance, bearing, area, centroid, simplification and polyline encode/decode — spatial math as a service.
Convert latitude/longitude to and from UTM and MGRS grid references.
Currency, calling code, languages, capital and flag for any country by ISO code or name.
JavaScript, 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.
See measured availability and response times on our public status page. Contractual SLA terms are agreed separately.
Driving routes and address search worldwide. Walking, cycling and detailed local data vary by service and region; see Coverage for availability.
# 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
}]
}Speed limits, road attributes and traffic-sign observations within available coverage.
Find road sign observations within a map area. Retrieve sign classifications, coordinates, directions and observation dates with cursor pagination.
Send loaded vehicle dimensions and weight with each request to calculate a truck route.
Find places using a short English query.
Read source attributes from a retrieved suggestion or route search.
Describe palette and layer changes, review the map, then apply.
Export styled maps as PNG images for reports and applications.
Find nearby features in your own uploaded geographic datasets.
Discover useful stops and compare their additional driving time.
Search addresses with street, city, postcode and country components.
Build place search with suggestions and a secure retrieval step.
Manage map styles, datasets and publication from your application.