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.
Our geospatial engine is optimized to handle high loads and compute the most optimal result in milliseconds.
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.
Zero dependencies, fully typed, every endpoint covered. Make your first call in under a minute.
npm install osrmrouteimport { OSRMRoute } from 'osrmroute';
const maps = new OSRMRoute({ apiKey: process.env.OSRMROUTE_API_KEY });
// Coordinates are [lat, lon] everywhere — no lon/lat mix-ups.
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 our official JavaScript, Python and Java SDK libraries to speed up your integration.
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.
Our high-availability clusters are ready to answer your requests at any moment.
All internal roads, speed limits and geographic features across 26 countries in the Caucasus, Central Asia, Türkiye, Iran and the Middle East are updated every day.
# 1. Send a route request with your API key
curl -X GET "https://osrmroute.com/api/v1/route/driving/\
49.8671,40.4093;49.8550,40.4150?overview=full&key=YOUR_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
}]
}