SPRINT 2.4 · GLOBAL ROUTING ENGINE

Drive, walk, bike, truck.
One routing endpoint.

Turn-by-turn directions, isolines, many-to-many matrices, map-matching, multi-stop optimization, snap-to-road and elevation — all driven by a single self-hosted Valhalla engine over the global OpenStreetMap network.

Seven endpoints, five modes, one plan. No "directions API" plus "matrix API" plus "isoline API" plus a separate "truck routing" SKU. Hit /v1/routing with two coordinates and a mode, get back the polyline, the duration, the legs, and (optionally) every turn-by-turn instruction. Truck attributes (truck_height, truck_weight, truck_hazmat, …) are first-class parameters on every endpoint that accepts a mode.

Available on the Pro plan and above. Routing calls share the standard daily quota — no per-call surcharge.
5 modes 7 endpoints Global OSM coverage Truck attrs built in

Five transport modes

One mode= parameter on every routing call. Costing models tuned per profile — cars use highways, walkers don't, trucks avoid low bridges.

🚗

drive

Cars and vans. Highways, toll roads, one-ways.

🚚

truck

Height, weight, length, width and hazmat constraints respected.

🏍️

motorcycle

Faster on twisty roads, smaller-vehicle restrictions.

🚲

bike

Bike lanes, cycle routes, no motorways.

🚶

walk

Pedestrian-safe paths, sidewalks, stairs.

Seven routing endpoints

Same authentication, same response envelope, same daily quota. Pick the one that matches the question.

Point-to-point route

Two or more waypoints in, polyline + distance + duration + turn-by-turn out. Up to two alternates per request, time-aware via depart_at.

GET /v1/routing?waypoints=…&mode=drive

Isolines

Polygon of everywhere reachable in N minutes (or N kilometers) from a point. Up to three ranges per call — render layered drive-time rings in one request.

GET /v1/isoline?lat=…&lng=…&ranges=300,600,900

Many-to-many matrix

Distance + duration between every source and every target. Up to 10,000 cells per call — perfect for scheduling, nearest-N, capacity planning.

POST /v1/route-matrix

Map matching

Send a noisy GPS trace, get back the cleaned line snapped to road segments — plus per-point matched road metadata. Up to 1,000 points per request.

POST /v1/map-match

Route optimization (TSP)

Multi-stop traveling-salesman: hand in 3 or more waypoints, get back the visit order that minimizes total drive time. Optional round-trip.

GET /v1/optimize_route?waypoints=…

Snap-to-road locate

One lat/lng in, the nearest road segment out — with road name, class, speed limit and the corrected coordinate. Cheap, fast.

GET /v1/locate?lat=…&lng=…

Elevation profile

Per-point elevation along a list of coordinates or an encoded polyline. Drop into a route response to compute gradient, climb, descent.

GET /v1/elevation?points=…

Truck routing without a second SKU

Set mode=truck on any endpoint that takes a mode, then add the constraints you care about: truck_height, truck_weight, truck_length, truck_width, truck_hazmat. The engine refuses low bridges, weight-limited streets, hazmat-restricted tunnels and narrow lanes automatically.

Works on /v1/routing and /v1/route-matrix — so you can route an entire fleet in one matrix call with each vehicle's profile.

# /v1/routing — truck with attrs
GET /v1/routing?
  waypoints=40.7128,-74.006|34.0522,-118.2437&
  mode=truck&
  truck_height=4.2&
  truck_weight=22000&
  truck_hazmat=true

Try it on a live map

Click two points on the map, pick a mode, watch the polyline come back. Same response shape your code would get — no signup, first 20 calls a minute on us.

Open the live demo →

Three lines of code

Same call, three languages. SDKs ship at version 1.8.0 on PyPI and npm.

curl
# NYC → LA with one alternate, turn-by-turn on
curl "https://csv2geo.com/api/v1/routing?waypoints=40.7128,-74.006|34.0522,-118.2437&mode=drive&alternatives=1&instructions=true" \
  -H "Authorization: Bearer geo_live_..."
Python
from csv2geo import Client
c = Client("geo_live_...")
r = c.route(
  [(40.7128, -74.006),
   (34.0522, -118.2437)],
  mode="drive",
  alternatives=1,
  instructions=True)
print(r["result"]["distance_m"])
Node.js
import { Client } from "csv2geo-sdk";
const c = new Client({ apiKey: "geo_live_..." });
const r = await c.route(
  [[40.7128, -74.006],
   [34.0522, -118.2437]],
  { mode: "drive",
    alternatives: 1,
    instructions: true });
console.log(r.result.distance_m);

What people build with it

Routing is general infrastructure. Here are the patterns we hear most often.

Delivery & dispatch

Plan a driver's day in one matrix call, optimize the visit order with /v1/optimize_route, render the leg polylines on a tracking app.

Drive-time catchments

Isolines turn "everywhere within 10 minutes" into a polygon. Render on a map, intersect with customer addresses, score store locations.

Fleet telematics

Map-match the raw GPS pings from a vehicle to the road network. Compute time-on-road, idle time, illegal-turn detection.

Trucking compliance

Route around bridges your truck doesn't fit under, tunnels it can't enter with hazmat, residential streets that ban heavy vehicles.

Cycling & walking apps

Bike and walk modes pick paths cars can't take. Elevation per point lets you score hilliness or build a climb profile.

Field-service scheduling

Many-to-many distance matrix between technicians and job sites — feed it straight into your assignment optimizer.

Pricing

Routing is unlocked on the Pro plan and above and shares the same daily call pool as every other endpoint. There's no separate routing SKU, no per-call surcharge, no minute-of-driving meter. One call to /v1/routing counts as one call against your plan.

See full API pricing