This quarter, Simple Routing donated to the OpenStreetMap Foundation and the Nature Conservancy. Learn more about our give back program and values.

Free Maplines API

Get the actual road-following route geometry between any set of waypoints in a single API call

Powered by OSRM and OpenStreetMap.

βœ… No credit card required πŸ‡ͺπŸ‡Ί Hosted in the EU πŸ”“ Open source, no lock-in

Get Free API Key

Always free for small projects. $10/mo covers most apps

What Is a Maplines API?

A maplines API returns the actual road-following geometry of a route β€” a sequence of coordinates that traces the real road network between your waypoints. Instead of drawing a straight line between A and B, you get the path a driver would actually take, ready to render on any map.

πŸ—ΊοΈ Route Visualization

Draw accurate driving routes on your map. Show customers or drivers exactly where the vehicle will travel, not just a crow-flies line.

πŸ“¦ Delivery Tracking

Animate a delivery vehicle along the real road path. Feed route geometry into your frontend map to show live or planned progress.

🧭 Navigation Apps

Embed turn-by-turn ready route data in your app. The response includes distance, duration, and step-by-step maneuver instructions.

Live Demo

3 NYC landmarks. Click Run Demo to fetch the real road route from the API.

# Route geometry: Times Square β†’ Central Park β†’ Brooklyn Bridge
curl "https://api.simplerouting.io/osrm/route/v1/driving/-73.9855,40.7580;-73.9718,40.7678;-73.9969,40.7061?overview=full&geometries=geojson"
Response

            

This is a live demo β€” no account required to get started.

Quick Start

Sign up for a free key, then drop it into this curl command:

# Times Square β†’ Central Park β†’ Brooklyn Bridge
curl "https://api.simplerouting.io/osrm/route/v1/driving/-73.9855,40.7580;-73.9718,40.7678;-73.9969,40.7061?overview=full&geometries=geojson" \
  -H "Authorization: Bearer YOUR_API_KEY"

Coordinates are longitude,latitude pairs separated by semicolons. Add ?overview=full&geometries=geojson to get the full route geometry as a GeoJSON LineString you can pass directly to Leaflet, Mapbox, or any mapping library.

Get Free API Key

Draw the Route, Then Hand Off to Google or Apple Maps

The default response carries an encoded polyline. Decode it, draw it on Leaflet (or MapLibre), and build an "open in maps" link from the same waypoints:

// npm install @mapbox/polyline leaflet
import polyline from '@mapbox/polyline';

const stops = [[40.7580, -73.9855], [40.7678, -73.9718], [40.7061, -73.9969]];  // lat, lng
const coords = stops.map(([lat, lng]) => `${lng},${lat}`).join(';');

const res = await fetch(`https://api.simplerouting.io/osrm/route/v1/driving/${coords}?overview=full`, {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
const { routes } = await res.json();

// 1. Draw the road-following line
const line = L.polyline(polyline.decode(routes[0].geometry)).addTo(map);
map.fitBounds(line.getBounds());

// 2. Deep links for turn-by-turn in the user's own maps app
const fmt = ([lat, lng]) => `${lat},${lng}`;
const [origin, destination] = [stops[0], stops.at(-1)];
const via = stops.slice(1, -1).map(fmt).join('|');

const googleMapsUrl = 'https://www.google.com/maps/dir/?api=1&travelmode=driving'
  + `&origin=${fmt(origin)}&destination=${fmt(destination)}`
  + (via ? `&waypoints=${encodeURIComponent(via)}` : '');
const appleMapsUrl = `https://maps.apple.com/?saddr=${fmt(origin)}&daddr=${fmt(destination)}&dirflg=d`;

Using MapLibre instead? Request geometries=geojson and pass routes[0].geometry straight to map.addSource(). Apple Maps links take a single destination, so intermediate stops are dropped there.

A Google Directions API Alternative

If all you need from Google is the line on the map and the distance and duration that go with it, this does the same job at a flat monthly price instead of a per-request bill. See the cost comparison →

Pricing

Free
$0/forever
  • 100 requests/dayiMax 5 req/s
    • Counted per call, not per element
  • Distance matrix, maplines, turn by turn, isochrone APIs
    • OSRM and Valhalla
  • Fleet optimization API
    • VROOM
  • Bicycle, car, HGV profiles iCar only for OSRM
  • North America & Europe coverage
  • No credit card required
Get Free API Key
Scale
$100/month
  • 200,000 requests/dayiMax 20 req/s
    • Counted per call, not per element
  • Distance matrix, maplines, turn by turn, isochrone APIs
    • OSRM and Valhalla
  • Fleet optimization API
    • VROOM
  • Bicycle, car, HGV profiles iCar only for OSRM
  • North America & Europe coverage
  • Cancel anytime
Get Started

No overages β€” your plan is your bill.

Hitting the limits, want more countries, or need a bespoke solution? Email [email protected] β€” we'll figure it out.

πŸŽ“
Education, non-profit, or open source? We offer discounted rates β€” email [email protected] to connect.

Global Stats

4.3M+
Requests served
99.99%
Uptime
300+
Developers building on the platform

FAQ

What does the response look like?

The API returns a JSON object with a routes array. Each route has a geometry (GeoJSON LineString or encoded polyline), distance (meters), duration (seconds), and a legs array with per-segment steps and maneuver details.

How do I draw the route on a map?

Request with geometries=geojson and pass routes[0].geometry directly to L.geoJSON() in Leaflet, or map.addSource() in Mapbox GL JS. No coordinate decoding needed.

Is this compatible with the standard OSRM /route API?

Yes. The endpoint follows the standard OSRM Route Service specification. If you are already using a self-hosted OSRM instance, switching is a one-line URL change plus an Authorization header.

What geographic coverage is available?

The free tier covers North America and Europe. Need more regions? Email [email protected] β€” coverage is added based on demand.

Ready to start?

Get your free API key β€” no credit card required.

Get Free API Key