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

Free Distance Matrix API

Calculate travel times and distances between any set of locations in a single API call

Powered by OSRM and OpenStreetMap.

✅ No credit card required 🇪🇺 Hosted in the EU

Get Free API Key

What Is a Distance Matrix API?

A distance matrix API computes an N×M grid of travel times and distances in a single request. Instead of making separate routing calls for every pair of locations, you send all your points at once and get back every combination instantly.

🚚 Delivery Scheduling

Find the fastest order to visit a set of stops. Feed the matrix into any VRP solver or your own scheduling logic.

📍 Nearest-Store Lookup

Given a customer location, rank your store locations by actual drive time — not straight-line distance.

📦 Logistics Optimization

Pre-compute all pairwise travel times for a fleet assignment problem or warehouse-to-customer matching.

Live Demo

4 NYC landmarks. Click Run Demo to fetch real travel times from the API.

# Distance matrix between 4 NYC landmarks
curl "https://api.simplerouting.io/osrm/table/v1/driving/-73.9855,40.7580;-74.0134,40.7127;-73.9718,40.7678;-73.9614,40.7143" \
  -H "Authorization: Bearer 988b35cc-6183-4922-bbc0-857e1a1d318d"
Response

            

This is a live demo with a real API key (feel free to steal it).

Quick Start

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

# Times Square, World Trade Center, Central Park, Williamsburg
curl "https://api.simplerouting.io/osrm/table/v1/driving/-73.9855,40.7580;-74.0134,40.7127;-73.9718,40.7678;-73.9614,40.7143" \
  -H "Authorization: Bearer YOUR_API_KEY"

Coordinates are longitude,latitude pairs separated by semicolons. The response is a JSON object with a durations array (seconds) and a distances array (meters).

Get Free API Key

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

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

3.9M+
Requests served
99.99%
Uptime
225+
Developers building on the platform

FAQ

What does the response look like?

The API returns a JSON object with a durations array of arrays (travel time in seconds between each pair) and a distances array of arrays (distance in meters). The diagonal is always 0. Example: durations[0][1] is the travel time from point 0 to point 1.

How many points can I query at once?

For most use cases (under 25 points) expect results in well under a second. If you need larger matrices and are hitting limits, email [email protected] and we'll sort it out.

Is this compatible with the standard OSRM /table API?

Yes. The endpoint follows the standard OSRM Table 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