Navvo
Guides

Traffic & routing integration guide

Everything an app needs to show traffic on every road, plan routes with realistic travel times in every travel mode, and build ETAs, matrices, reachability areas, optimised tours and turn-by-turn navigation on Navvo.

Traffic & routing integration guide

This guide takes you from an API key to a complete traffic and routing integration: a traffic layer on your map, directions with travel times you can promise to a customer, ETAs for many trips at once, "what can I reach in 15 minutes" areas, optimised delivery tours, single-road lookups and live turn-by-turn navigation. It explains what every number means, so you can show it correctly, and links to the API reference for every field.

It is written for app developers on web, iOS, Android and backend services. All examples use plain HTTPS and JSON, so they translate directly to any language or SDK.

On this page

  1. What you get
  2. Before you start
  3. Core concepts
  4. Show traffic on your map
  5. Directions with a real ETA
  6. Colour a route by traffic
  7. Turn-by-turn navigation
  8. ETAs for many trips: the matrix
  9. How far can I get: isochrones
  10. Optimise stops and fleets
  11. One road, or one view
  12. Traffic for planning ahead
  13. Travel modes
  14. Road signs, closures and borders
  15. Freshness and caching
  16. Errors and edge cases
  17. Contributing traffic data
  18. Checklist and FAQ
  19. Endpoint map

What you get

  • Traffic on every road, in each direction, at any hour, in every city Navvo covers. Each road's answer says what it is based on: measured recently, typical for that road at that hour, or expected. There is never a blank map and never an unlabelled guess.
  • Travel times you can show as an ETA, on every routing endpoint. Each road is timed at the moment the vehicle reaches it, from the speed traffic really drives there, the vehicle's own speed, traffic at that time, and the time lost at junctions and traffic lights for the turn made there.
  • Routes chosen by that travel time. Traffic shapes which route comes first, and a route around heavy traffic is offered when it clearly saves time.
  • Seven travel modes, each timed its own way: car, truck, motorcycle, scooter, bicycle, walking and wheelchair. Public transport has its own planner.
  • Road rules respected: no-entry and turn-ban signs by direction, closures, incidents, and no routes across national borders until crossings are verified.
  • The same answer everywhere: the map layer, routes, matrices, isochrones, optimised tours and navigation all use the same traffic and the same timing, so a number on one screen agrees with the number on the next.

Before you start

Base URL and authentication

https://navvo.io/api/v1

Send your developer API key in the x-api-key header on every request. Apps whose users sign in to Navvo can send the user's token as Authorization: Bearer <token> instead.

curl -s "https://navvo.io/api/v1/routing/profiles" -H "x-api-key: $NAVVO_API_KEY"

Keep server keys on your server. For a browser or mobile app, create a key restricted to your website or app in the developer portal, and never ship an unrestricted key.

Scopes

ScopeUnlocks
routing/routing/* (directions, matrix, isochrone, optimise, map-match), /navigation/*
traffic/traffic/* (tiles, segments, summary, analysed traffic)
routing + trafficPOST /traffic/route (a route coloured by traffic)
optimize/optimize/* (fleet routing with vehicles, capacities and time windows)
telemetry/telemetry/* (contributing trips)

A request without a valid key returns 401; a key without the scope returns 403.

Coordinates and units

WhereCoordinates
/routing/plan, /traffic/route{ "lon": …, "lat": … } objects
/routing/route, /matrix, /isochrone, /optimize, /map-match{ "lat": …, "lon": … } objects (note lon)
/navigation/sessions{ "lat": …, "lng": … }
GeoJSON output, shape arrays in /traffic/route[lng, lat]
Encoded route shapes (legs[].shape)polyline with precision 1e6

Times are seconds unless a field name says minutes. Distances are kilometres unless you ask for miles. Speeds are km/h.

Response envelope

Routing endpoints answer 201 and wrap the route in { provider, available, path, data }. Always check available before reading data: if the routing service is briefly unreachable you get available: false rather than an error.


Core concepts

Evidence: measured, typical, expected

Every traffic answer carries its evidence. Show it, so your users know what they are looking at.

EvidenceLabel (en / ar)MeansDraw it
observedMeasured recently / حركة مرصودة مؤخراMeasured on that road and direction within the last few minutes, by at least three independent contributors, so no single trip can be seen.Solid line, white casing
typicalTypical / حركة معتادةThat road's own history on this kind of day at this hour.Solid or dashed line
expectedExpected / حركة متوقعةNavvo's expected traffic for that road at that time. It follows the time of day, the day of the week, each country's weekend, public and school holidays, Ramadan and Eid, salary days near shops, the weather, the direction commuting traffic flows and the queues that form before junctions.Solid or dashed line

Route-level answers use a slightly longer list (observed_supplied, observed, forecast, typical, structural, unknown). forecast is the route's word for expected; structural and unknown appear only where no expected value can be computed. Every response that carries evidence also carries the ready-to-show en and ar labels, so you never have to translate.

Note: only observed is "live". Never label typical or expected traffic as live. The labels above are the honest wording.

Traffic levels and colours

levelcongestionColourMeaning
freelight#2DBE60Moving at more than about three-quarters of the road's own quiet-hour speed
slowmoderate#F9A825About half to three-quarters
heavyheavy#E84B36About a quarter to a half
standstillblocked#A01A12A quarter or less

Levels compare each road with itself at its quietest, not with its speed limit. A city street never reaches its limit, even when empty, because of lights, junctions and parked cars, so comparing with the limit would paint every city orange.

Colour shows where traffic slows. A street's delay stands in the queue before its lights or busy junction, so from zoom 13 that last stretch is its own line with the queue's colour, while the rest of the street shows how it is moving. Route segments follow the same rule, so a route and the map around it agree. Travel times count the whole delay, queues included.

Travel time

Every time Navvo returns is a travel time: what a person can expect, door to door, on the route given.

  • Each road is timed at the moment the vehicle reaches it. A road you reach 20 minutes after leaving is timed with the traffic expected 20 minutes from now.
  • It uses the speed traffic really drives on that kind of street, capped by the vehicle's own speed.
  • It adds the time lost at each junction for the turn made there: going straight through a small junction costs almost nothing, a left turn across a main road costs much more, and junctions with traffic lights cost the usual wait for the green (short at night, long in the rush hours).
  • For walking, cycling and wheelchair routes it follows the travel mode's own pace instead (see Travel modes).

So a kilometre of plain city street takes about one and a half minutes in light traffic, and more with turns, lights and traffic.

Routes also carry the routing graph's own time as static_time, for comparison only. Never show static_time as the ETA.

Departure time

Everything is evaluated for a departure. By default it is now. Pass a departure to plan ahead:

EndpointField
/routing/plan, /routing/matrix, /traffic/routedepartureTime (ISO 8601, e.g. 2026-12-01T05:30:00Z)
/routing/route, /isochrone, /optimizepayload.date_time: { "type": 1, "value": "2026-12-01T08:30" } (local time) or { "type": 0 } for now
/traffic/tilest query parameter
/traffic/segments/{ref}at query parameter

Show traffic on your map

One vector-tile source draws traffic on every road, in each direction. This is the recommended traffic layer.

GET /traffic/tiles/{z}/{x}/{y}.mvt?t=<ISO time or epoch ms>
  • Zooms 6 to 14; let the map overzoom above 14. Zooms 6–9 carry motorways and trunk roads, 10–11 add primary roads, 12 secondary, 13 tertiary, 14 minor and service roads.
  • One layer, traffic, of lines with these properties: level, ratio (speed as a percentage of the road's quiet-hour speed), ev (observed, typical, expected), cls (road class), rank (0 = motorway) and dir.
  • dir is 0 for a one-way road (or one line for both directions), and 1 / -1 for the two directions of a two-way road. Each direction is already drawn in its own direction of travel, so a positive line-offset puts it on its right-hand side.
  • Service roads (inside compounds, campuses, malls, car parks) and dead-end streets appear only where real measurements exist; they are never drawn from expected traffic.
  • Use one URL per 5-minute slot (t rounded down to 5 minutes): tiles for a slot are cacheable, and the next slot brings new traffic.

MapLibre GL JS (web)

const KEY = 'nvvo_YOUR_KEY';
const slot = () => new Date(Math.floor(Date.now() / 300000) * 300000).toISOString();
const tiles = () => [`https://navvo.io/api/v1/traffic/tiles/{z}/{x}/{y}.mvt?t=${encodeURIComponent(slot())}`];

const map = new maplibregl.Map({
  container: 'map',
  style: `https://navvo.io/api/v1/tiles/style?style=standard&api_key=${KEY}`,
  transformRequest: (url) => (url.includes('/traffic/tiles/') ? { url, headers: { 'x-api-key': KEY } } : { url }),
});

const COLOR = ['match', ['get', 'level'], 'slow', '#F9A825', 'heavy', '#E84B36', 'standstill', '#A01A12', '#2DBE60'];
const WIDTH = ['interpolate', ['linear'], ['zoom'], 6, 1, 10, 2, 13, 3, 16, 5, 19, 8];
const OFFSET = ['interpolate', ['linear'], ['zoom'], 14.9, 0, 15, ['*', 1.5, ['get', 'dir']], 18, ['*', 4, ['get', 'dir']]];
const MINOR = ['in', ['get', 'cls'], ['literal', ['minor', 'service']]];
const SORT = ['match', ['get', 'level'], 'standstill', 3, 'heavy', 2, 'slow', 1, 0];

map.on('load', () => {
  const before = map.getStyle().layers.find((l) => l.type === 'symbol')?.id; // keep labels on top
  map.addSource('navvo-traffic', { type: 'vector', tiles: tiles(), minzoom: 6, maxzoom: 14 });
  map.addLayer({ id: 'traffic-measured-casing', type: 'line', source: 'navvo-traffic', 'source-layer': 'traffic',
    filter: ['all', ['==', ['get', 'ev'], 'observed'], ['!', MINOR]],
    layout: { 'line-cap': 'round', 'line-join': 'round' },
    paint: { 'line-color': '#FFFFFF', 'line-width': ['+', WIDTH, 3], 'line-offset': OFFSET } }, before);
  map.addLayer({ id: 'traffic-major', type: 'line', source: 'navvo-traffic', 'source-layer': 'traffic',
    filter: ['!', MINOR], layout: { 'line-cap': 'round', 'line-join': 'round', 'line-sort-key': SORT },
    paint: { 'line-color': COLOR, 'line-width': WIDTH, 'line-offset': OFFSET, 'line-opacity': 0.85 } }, before);
  map.addLayer({ id: 'traffic-minor', type: 'line', source: 'navvo-traffic', 'source-layer': 'traffic', minzoom: 15,
    filter: MINOR, layout: { 'line-cap': 'round', 'line-join': 'round', 'line-sort-key': SORT },
    paint: { 'line-color': COLOR, 'line-width': ['*', WIDTH, 0.6], 'line-offset': OFFSET, 'line-opacity': 0.85 } }, before);
  setInterval(() => map.getSource('navvo-traffic').setTiles(tiles()), 300000);
});

// Tooltip: the level and what it is based on
const LABEL = { observed: 'Measured recently', typical: 'Typical', expected: 'Expected' };
map.on('mousemove', 'traffic-major', (e) => {
  const p = e.features[0].properties;
  console.log(`${p.level} · ${LABEL[p.ev]}`);
});

iOS and Android

MapLibre Native (iOS and Android) and the Navvo mobile SDKs read the same tiles. Add a vector source with the tile URL template above, send the x-api-key header through the SDK's request hook (or a key restricted to your app), and add the same three line layers with the same expressions: MapLibre Native accepts the style expressions shown above unchanged.

Legend

Show the four colours with their labels, and the evidence with more than colour: the white casing marks roads measured recently, and the tooltip or a legend line names the evidence. Use the labels from Evidence in your user's language.

Traffic at another time

Pass t up to 7 days ahead (or within the last day): "What will traffic be like at 8:30 tomorrow?" is the same layer with t=2026-12-01T05:30:00Z. Ahead of time, roads are typical or expected; only the present can be observed.

The 3D cars API

For moving cars that follow the traffic in a 3D view, let Navvo do the traffic work. GET /traffic/cars/tiles/14/{x}/{y} returns every lane of a zoom-14 tile. Each lane is already offset to its side of the road and comes with its speed every ~20 m and its flow of cars. Your app places the cars every frame with the arithmetic below, with no requests in between.

The cars move like the traffic colour under them. On a main road (60 km/h free speed):

ColourSpeedGap between cars (rush hour)
Green42–60 km/h30–60 m, spread out
Orange7–18 km/habout 11 m, stacked
Red3–7 km/habout 9 m, bumper to bumper
Dark red1–3 km/h7.5–8 m

Other classes scale with their free speed.

Positions come from the clock (epoch seconds), so every device shows the same cars at the same moment. GET /traffic/cars/positions returns exactly the points your code must produce, so use it in your tests.

  1. With the 3D map at zoom 16 or closer, fetch the zoom-14 tiles that cover the view, and refetch the visible ones every 60 seconds.
  2. Prepare each lane once. Then, every frame, place its cars and set them as the data of one symbol layer, below the 3D buildings. 30 frames a second is plenty. Rotate the icon to bearing, and set icon-rotation-alignment and icon-pitch-alignment to map.
  3. Keep every view uncrowded: about 120 cars on a phone, 200 on a tablet. When the camera settles, give each lane a keep share. Lanes near the centre of the view keep all their cars, and farther lanes fewer (keepByDistance below). Cars are hidden in groups of 4 consecutive cars, so what stays of a queue is still a stacked queue. A hidden group never moves a car. Never thin by scaling flow: positions come from the clock, so that moves every car.
// A lane = one feature of /traffic/cars/tiles/14/{x}/{y}. Prepare it once per fetch.
function prepareLane(f) {
  const c = f.geometry.coordinates, p = f.properties;
  const metres = (a, b) => Math.hypot((b[0] - a[0]) * 111320 * Math.cos(((a[1] + b[1]) / 2) * Math.PI / 180), (b[1] - a[1]) * 110540);
  const cum = [0];
  for (let i = 1; i < c.length; i++) cum.push(cum[i - 1] + metres(c[i - 1], c[i]));
  const length = cum[cum.length - 1], stepEnd = [], stepTime = [];
  let t = 0;
  p.speeds.forEach((v, k) => { t += p.stepM / v; stepEnd.push(Math.min(length, (k + 1) * p.stepM)); stepTime.push(t); });
  return { ...p, coords: c, cum, length, stepEnd, stepTime, totalTime: t };
}

// A stable 0–1 number per lane and group of 4 cars (32-bit hash): the group is drawn when it is below the lane's `keep`.
function carUnit(seed, n) {
  const lo = ((n % 4294967296) + 4294967296) % 4294967296;
  let h = (seed ^ lo) >>> 0;
  h = Math.imul(h, 0x9e3779b1) >>> 0; h = (h ^ (h >>> 15)) >>> 0;
  h = Math.imul(h, 0x85ebca77) >>> 0; h = (h ^ (h >>> 13)) >>> 0;
  return h / 4294967296;
}

// Every frame: the cars of one lane at `now` (epoch seconds). Cars enter one headway (1 / flow)
// apart and move at the step speeds, so they bunch where it is slow.
function laneCars(L, now, emit) {
  if (!(L.flow > 0) || !(L.keep > 0)) return;
  const h = 1 / L.flow;
  let tau = ((((now / h + L.phase) % 1) + 1) % 1) * h;           // seconds since the newest car entered
  for (let k = 0; tau < L.totalTime && k < 400; tau += h, k++) {
    const car = Math.floor(now * L.flow + L.phase) - k;          // stable id while the car drives
    if (L.keep < 1 && carUnit(L.seed, Math.floor(car / 4)) >= L.keep) continue;   // hidden in groups of 4
    let i = 0; while (L.stepTime[i] < tau && i < L.stepTime.length - 1) i++;          // step the car is in
    const s = Math.min(L.length, (i ? L.stepEnd[i - 1] : 0) + (tau - (i ? L.stepTime[i - 1] : 0)) * L.speeds[i]);
    let j = 0; while (j < L.cum.length - 2 && L.cum[j + 1] <= s) j++;                   // segment it is on
    const a = L.coords[j], b = L.coords[j + 1];
    const f = Math.min(1, Math.max(0, (s - L.cum[j]) / Math.max(1e-9, L.cum[j + 1] - L.cum[j])));
    const bearing = (Math.atan2((b[0] - a[0]) * Math.cos(a[1] * Math.PI / 180) * 111320, (b[1] - a[1]) * 110540) * 180 / Math.PI + 360) % 360;
    emit(a[0] + (b[0] - a[0]) * f, a[1] + (b[1] - a[1]) * f, bearing, (((L.seed + car) % 8) + 8) % 8, Math.max(0, Math.min(1, s / 12, (L.length - s) / 12)));
  }
}

// When the camera settles: about `budget` cars in view. Lanes within R metres of the centre keep all
// their cars, farther lanes R / distance of them; R by bisection. L.visible = share of vertices in view,
// L.dist = metres from the view centre to the lane's nearest vertex.
function keepByDistance(lanes, budget) {
  const keepAt = (R, d) => Math.min(1, R / Math.max(R, d));
  const total = (R) => lanes.reduce((n, L) => n + L.cars * L.visible * keepAt(R, L.dist), 0);
  if (total(1e9) <= budget) { lanes.forEach((L) => { L.keep = 1; }); return; }
  let lo = 0.01, hi = 1e6;
  for (let i = 0; i < 50; i++) { const mid = Math.sqrt(lo * hi); if (total(mid) > budget) hi = mid; else lo = mid; }
  const scale = total(lo) > budget ? budget / total(lo) : 1;   // a jammed road right at the centre
  lanes.forEach((L) => { L.keep = keepAt(lo, L.dist) * scale; });
}

Use the numbers exactly as sent, as 64-bit floats. When a refresh changes a lane's numbers, let the cars already on it finish under the old ones, so nothing jumps: draw the old lane's cars with tau > now − switchAt and the new lane's with tau ≤ now − switchAt, until the old lane's totalTime has passed. Lanes whose numbers didn't change keep their cars as they are.

Animated traffic in 3D scenes

To build the cars yourself instead, the traffic tiles can drive them directly: more cars where traffic is heavy, fewer where it flows, and slow, bunched-up cars in the queues before junctions. Navvo's own 3D map does it this way:

  1. Read the pieces under each lane. For every lane of every direction on screen, look up the traffic piece under it every ~20 m. Match the direction as well as the position: each piece is drawn in its direction of travel, so take the nearest piece within ~12 m whose bearing is within ~50° of the lane's.
  2. Speed = the road class's free speed × a share that follows the colour: green (ratio above 78) 0.7–1, orange (above 50) 0.12–0.3, red (above 25) 0.05–0.11, dark red 0.02–0.05, linear inside each band. Cars crawl in queues and run on green. Free speeds we use: motorway 100, trunk 80, primary 60, secondary 50, tertiary 40, minor 30, service 15 km/h.
  3. Density (cars per km per lane) is the larger of:
    • flowing: 22 × how busy the class is (motorway 1, trunk 0.95, primary 0.85, secondary 0.7, tertiary 0.55, minor 0.28, service 0.12) × how busy the hour is (0.1 at 4 am up to 1 in the afternoon peak);
    • slowing: 125 × (1 − the speed share), which rises towards a standstill queue (about 8 m per car).
  4. One flow per lane. The flow is the lane's average of density × speed, capped at the slowest stretch's speed ÷ your minimum gap between cars (at least the car's length). Cars enter one headway (1 / flow) apart and move at the local speed, so they spread out where it is fast and bunch up where it is slow, and never overlap.
  5. Streets missing from the tiles get no cars. Service roads and dead ends without real measurements are left out of the tiles, so they stay empty instead of showing made-up traffic.
// cars per km per lane, and metres per second, for one traffic piece
const FREE_KMH = { motorway: 100, trunk: 80, primary: 60, secondary: 50, tertiary: 40, minor: 30, service: 15 };
const BUSY = { motorway: 1, trunk: 0.95, primary: 0.85, secondary: 0.7, tertiary: 0.55, minor: 0.28, service: 0.12 };
const density = (p, hourShare) => Math.max(22 * BUSY[p.cls] * hourShare, 125 * (1 - speedShare(p.ratio)));
// share of free speed per colour band: [up to ratio, share at the band's low end, at its top]
const BANDS = [[25, 0.02, 0.05], [50, 0.05, 0.11], [78, 0.12, 0.3], [100, 0.7, 1]];
function speedShare(ratio) {
  let low = 0;
  for (const [top, v0, v1] of BANDS) { if (ratio <= top) return v0 + ((ratio - low) / (top - low)) * (v1 - v0); low = top; }
  return 1;
}
const speed = (p) => (FREE_KMH[p.cls] / 3.6) * speedShare(p.ratio);

// a lane = steps of ~20 m, each with the piece under it
function laneFlow(steps, hourShare, minGapM) {
  const carried = steps.reduce((sum, s) => sum + (density(s.piece, hourShare) / 1000) * speed(s.piece) * s.metres, 0);
  const metres = steps.reduce((sum, s) => sum + s.metres, 0);
  const slowest = Math.min(...steps.map((s) => speed(s.piece)));
  return Math.min(carried / metres, slowest / minGapM); // cars per second
}
// A car that entered the lane `tau` seconds ago is wherever `tau` seconds of travel at the local
// speeds take it; cars enter every 1 / flow seconds.

Keep every view uncrowded: when the total is over budget, keep all the cars of lanes near the centre of the view and fewer of farther lanes, hiding them in groups of a few consecutive cars so queues still read as stacked (as in the 3D cars API above). Refresh the pieces when the 5-minute slot turns.


Directions with a real ETA

POST /routing/plan is the recommended endpoint for directions. You give it stops and preferences; it returns the best route and alternates, each with travel times, traffic, road-sign checks and a routeId for navigation.

curl -s -X POST "https://navvo.io/api/v1/routing/plan" \
  -H "x-api-key: $NAVVO_API_KEY" -H "content-type: application/json" \
  -d '{
    "locations": [ { "lon": 35.9311, "lat": 31.9516 }, { "lon": 35.8999, "lat": 31.9705 } ],
    "costing": "auto",
    "alternates": 2,
    "includeLabels": false
  }'
const res = await fetch('https://navvo.io/api/v1/routing/plan', {
  method: 'POST',
  headers: { 'x-api-key': KEY, 'content-type': 'application/json' },
  body: JSON.stringify({
    locations: [{ lon: 35.9311, lat: 31.9516 }, { lon: 35.8999, lat: 31.9705 }],
    costing: 'auto',
    alternates: 2,
    includeLabels: false, // skip the AI route label for an instant answer
  }),
});
const plan = await res.json();

const minutes = Math.round(plan.trip.summary.time / 60);           // the ETA to show
const arrival = plan.eta?.recommended?.arrivalTime;                 // ISO arrival time
const lightTraffic = Math.round(plan.trip.summary.traffic.free_flow_time / 60);
const routeId = plan.routeId;                                       // start navigation on exactly this route

What to read

FieldUse
trip.summary.timeThe ETA, in seconds, for this route leaving at the departure time.
trip.summary.lengthDistance in km.
eta.recommended{ seconds, minutes, arrivalTime, basis: "travelTime" }, ready to show.
trip.legs[].summary.time, trip.legs[].maneuvers[].timeTime per leg and per instruction, on the same scale; they add up to the trip.
trip.summary.traffic{ free_flow_time, junction_time, evidence }: the same route in light traffic, the seconds spent at junctions and lights, and how much of the distance is measured, typical or expected.
trip.summary.static_timeThe routing graph's own time. For comparison only.
alternates[]Other routes, each { routeId, trip }, already sorted by travel time.
trafficThe route's traffic evidence: sourceMix, measuredShare, evidenceClass, pathChangedByTraffic and ready-to-show labels.
travelTime{ chosenFor, candidates, detourTried }. chosenFor: "traffic_detour" means a route around heavy traffic won.
signRulesRoad signs that applied and any rule breaks steered around.
routeIdPass to POST /navigation/sessions within 15 minutes to navigate exactly this route.

Showing "x minutes slower than usual". Compare trip.summary.time with trip.summary.traffic.free_flow_time (the same route in light traffic). Show the difference only when it is meaningful, for example more than 2 minutes and 10%.

Useful options

OptionEffect
costingauto (default), truck, motorcycle, motor_scooter, bicycle, pedestrian, wheelchair.
departureTimeLeave later (or earlier today); every road is timed for that departure.
alternates0–2 alternative routes.
avoidtolls, highways (motorways and trunk expressways), ferries, unpaved, checked road by road.
vehicle.maxSpeedKphThe vehicle's top speed; route choice and every time respect it. Trucks also take heightM, widthM, lengthM, weightT, axleLoadT, hazmat.
originHeading, originTraceFor a moving vehicle: the route starts on the road being driven, in the direction of travel.
includeLabels: falseSkip the AI route label (saves 1–2 s). Recommended for interactive apps.
languageInstruction language, for example en-US or ar.

To route to a place's entrance rather than its centre, use the place's recommended arrivalIntelligence.candidates[0].routeTarget as the destination (see Places).

The raw route endpoint

If your app already speaks the routing engine's request format, POST /routing/route takes it as { "payload": { … } } and plans the route the same way: travel times in summary.time, legs[].summary.time and maneuvers[].time (with static_time beside them), traffic-aware choice, road signs and the border check. Its response keeps the engine's shape. See POST /routing/route.


Colour a route by traffic

To draw a route in traffic colours, send the route's own shape to POST /traffic/route. Sending the shape you display guarantees the colours match your line.

const coords = decodePolyline6(plan.trip.legs[0].shape); // [[lon, lat], ...]
const r = await (await fetch('https://navvo.io/api/v1/traffic/route', {
  method: 'POST',
  headers: { 'x-api-key': KEY, 'content-type': 'application/json' },
  body: JSON.stringify({ locations: [origin, destination], shape: coords, costing: 'auto' }),
})).json();

// The route goes ABOVE the traffic layer: wider, with a white edge, so it reads first.
map.addSource('route-traffic', { type: 'geojson', data: r.segments });
map.addLayer({ id: 'route-casing', type: 'line', source: 'route-traffic',
  layout: { 'line-cap': 'round', 'line-join': 'round' },
  paint: { 'line-color': '#FFFFFF', 'line-width': ['interpolate', ['linear'], ['zoom'], 10, 8, 14, 11.5, 18, 20] } });
map.addLayer({ id: 'route-traffic', type: 'line', source: 'route-traffic',
  layout: { 'line-cap': 'round', 'line-join': 'round' },
  paint: { 'line-color': ['get', 'color'], 'line-width': ['interpolate', ['linear'], ['zoom'], 10, 5, 14, 8, 18, 15] } });
// Traffic steps back while a route is shown (restore 0.85 when it is cleared).
for (const id of ['traffic-major', 'traffic-minor']) map.setPaintProperty(id, 'line-opacity', 0.45);

// Frame the route ONCE, clear of any panel over the map.
const lons = coords.map((c) => c[0]), lats = coords.map((c) => c[1]);
map.fitBounds([[Math.min(...lons), Math.min(...lats)], [Math.max(...lons), Math.max(...lats)]],
  { padding: { top: 70, right: 80, bottom: 70, left: 430 } }); // left = your panel's width + a margin

console.log(r.durationInTrafficMinutes, 'min, of which', r.delayMinutes, 'min traffic delay');
console.log(r.traffic.evidenceLabel.en); // e.g. "Expected"

segments is a GeoJSON FeatureCollection; each stretch carries its level, colour and evidence. durationInTrafficSeconds is on the same scale as the route's trip.summary.time; baseDurationSeconds is the same route in light traffic.

Keep the traffic layer close to full strength (about 0.85) so its colours read true, and lower it (about 0.45) while a route is on screen. Frame a route once, when it first arrives. When its traffic refreshes or the route is re-planned in the background, update the line without moving the camera, so people can pan and zoom around the route freely.

A minimal polyline decoder (precision 1e6):

function decodePolyline6(str) {
  const out = []; let i = 0, lat = 0, lon = 0;
  while (i < str.length) {
    for (const k of [0, 1]) {
      let r = 0, s = 0, b;
      do { b = str.charCodeAt(i++) - 63; r |= (b & 31) << s; s += 5; } while (b >= 32);
      const d = r & 1 ? ~(r >> 1) : r >> 1;
      if (k === 0) lat += d; else lon += d;
    }
    out.push([lon / 1e6, lat / 1e6]);
  }
  return out;
}

Turn-by-turn navigation

Navigation sessions keep the ETA and the route up to date while the user drives, rides or walks.

  1. Plan and preview with POST /routing/plan. Let the user pick the main route or an alternate.
  2. Start with POST /navigation/sessions, sending the picked routeId (within 15 minutes) plus origin and destination. The session starts on exactly that route, so the distance and time match the preview. When the vehicle is already moving, send origin.heading and origin.speed.
  3. Stream positions over the live socket wss://navvo.io/api/v1/navigation/sessions/{id}/live (recommended) or with PATCH /navigation/sessions/{id}. Each update returns progress, the next instruction, the remaining time and arrival time, and reroutes when the user leaves the route.
  4. Arrive or end with POST /navigation/sessions/{id}/complete or DELETE.

Every reroute is planned like a new route: travel times with traffic, road signs, the session's avoid list, and a start in the direction the vehicle is already moving. Remaining times count down on the same scale as the preview.

const session = await (await fetch('https://navvo.io/api/v1/navigation/sessions', {
  method: 'POST',
  headers: { 'x-api-key': KEY, 'content-type': 'application/json' },
  body: JSON.stringify({
    routeId: plan.routeId,
    origin: { lat: 31.9516, lng: 35.9311, heading: 270, speed: 8.3 },
    destination: { lat: 31.9705, lng: 35.8999, name: 'Shmeisani' },
    costing: 'auto', language: 'en-US',
  }),
})).json();

const ws = new WebSocket(`wss://navvo.io/api/v1/navigation/sessions/${session.sessionId}/live?token=${userToken}`);
// send location_update messages; handle progress, instruction and reroute messages

The socket protocol, message types, keep-alive and reconnection rules are in Navigation WebSocket. The REST endpoints, webhooks and arrival detection are in Navigation.


ETAs for many trips: the matrix

POST /routing/matrix returns travel times between many origins and many destinations in one call: nearest-driver searches, dispatch boards, delivery planning. Each duration is a travel time on the same scale as /routing/plan, including traffic at the departure time, junctions and lights.

const out = await (await fetch('https://navvo.io/api/v1/routing/matrix', {
  method: 'POST',
  headers: { 'x-api-key': KEY, 'content-type': 'application/json' },
  body: JSON.stringify({
    origins: drivers.map((d) => ({ lat: d.lat, lon: d.lon })),
    destinations: [{ lat: pickup.lat, lon: pickup.lon }],
    costing: 'auto',
  }),
})).json();

const m = out.matrix;
const best = m.cells
  .filter((c) => c.status === 'ok')
  .sort((a, b) => a.duration - b.duration)[0];
console.log(`Driver ${best.originIndex} is ${Math.round(best.duration / 60)} min away`);
console.log(m.traffic.applied ? 'with traffic now' : m.traffic.message);
FieldMeaning
cells[].durationTravel time in seconds for the pair. Show this.
cells[].delaySeconds lost to traffic versus light traffic (null without traffic).
cells[].trafficDurationEqual to duration when traffic is applied; null otherwise.
cells[].status, reasonok, unreachable, out_of_range, out_of_coverage or engine_error, with a reason.
traffic.applied, traffic.reasonWhether traffic is included, and why not.
traffic.network.updatedAtWhen the road network's traffic was last refreshed (about every 15 minutes).
  • departureTime plans ahead; trafficAware: false asks for light-traffic durations.
  • Up to 2,500 pairs per call (for example 50 × 50). For up to 250,000 pairs, submit POST /routing/matrix/jobs and poll. Read the live limits from GET /routing/matrix/limits.
  • Large answers: ask for format: "grid" to get compact row-major arrays.
  • A matrix with traffic is cached for at most 10 minutes; ask again for fresh traffic.

A matrix answer and a planned route for the same trip agree closely. They can differ slightly, because a planned route picks among several candidates and its time is computed road by road; use the matrix to rank and estimate, and /routing/plan for the route you will actually drive.


How far can I get: isochrones

POST /routing/isochrone draws the area reachable within N minutes (or N km). The minutes are travel minutes on the same scale as a planned route, and motor modes leave now with traffic unless you set payload.date_time.

{
  "payload": {
    "locations": [ { "lat": 31.9539, "lon": 35.9106 } ],
    "costing": "auto",
    "contours": [ { "time": 10 }, { "time": 20 } ],
    "polygons": true
  }
}

The answer is a GeoJSON FeatureCollection; properties.contour is the minutes you asked for, and the top-level timing says whether traffic was applied. Typical uses: delivery zones, "open now within 15 minutes", store catchments. A place inside the 15-minute area is about 15 minutes away by /routing/plan.


Optimise stops and fleets

NeedEndpoint
One vehicle, best order for a few stopsPOST /routing/optimize (or POST /routing/plan with optimize: true)
Many vehicles, capacities, time windows, pickups and deliveriesPOST /optimize/routes (scope optimize)

Both decide with travel times that include traffic for motor modes. /routing/optimize returns one trip whose summary.time, legs and instructions are travel times (static_time beside them), and data.trip.locations[].original_index maps the order back to your input. A tour that would cross a national border is refused with 422 BORDER_CROSSING_UNAVAILABLE. See Route optimization for the fleet solver.


One road, or one view

One road: GET /traffic/segments/{ref}

What one road is like, in one direction, when a vehicle enters it, split into parts by evidence.

curl -s "https://navvo.io/api/v1/traffic/segments/osm%3A123456%3Af%3A9a8b7c6d?at=2026-11-30T12:05:00Z" \
  -H "x-api-key: $NAVVO_API_KEY"

running_time_s is the time to drive the road at that moment; parts[] says which stretch is measured, typical or expected (forecast). Every road has an answer: stretches with no measurement or history of their own carry the road's expected traffic. Use a stable road reference you received from Navvo, or g:<graph id> with lat/lon.

One view: GET /traffic/summary?bbox=west,south,east,north

A sentence and numbers for the current map view, in English and Arabic: "Slow moving", with a breakdown. With a view up to about 0.6° wide, roads describes every road in view, each direction separately, in kilometres per level, with the share that is measured, typical or expected. Use it for a banner such as "Traffic in view: slow (38% of roads)". conditions keeps the area-level summary with its basis and freshness labels.

const s = await (await fetch(`https://navvo.io/api/v1/traffic/summary?bbox=${b.join(',')}`, { headers: { 'x-api-key': KEY } })).json();
if (s.roads) banner(`${s.roads.summary} · ${s.roads.breakdown.find((x) => x.level === s.roads.level).share}% of roads`);

Traffic for planning ahead

For "when should I leave?" and planning screens, Navvo's analysed traffic gives the usual traffic for any place and time, with the day type, holidays, Ramadan, the season and the weather applied:

  • GET /traffic/analysed?lat=…&lng=…&at=…: the expected traffic at a point and time, with its main factors.
  • GET /traffic/analysed/week: a week of hourly expectations for a place.
  • GET /traffic/analysed/grid?bbox=…&at=…: a coloured grid for a view.
  • GET /traffic/analysed/outlook: the next hours.

These are area-level answers, ideal for "usually busy at 8 am" messages. For a specific road or route use the tiles, segments, /traffic/route or /routing/plan with a departureTime. See Analysed traffic.


Travel modes

ModecostingHow traffic affects itWhat else is timed
CarautoIn fullStreet speeds, junctions, turns and traffic lights
TrucktruckIn fullTruck speed limits, slower climbs and careful descents, wider and slower turns. Send vehicle dimensions and weight to keep off restricted roads.
MotorcyclemotorcyclePartly: it passes queuesReaches the front at traffic lights, so waits less
Scootermotor_scooterPartlyScooter speeds, slower on steep climbs
BicyclebicycleHardlyRider effort: hills matter, rough surfaces are slower, red lights still apply
WalkingpedestrianNot at allWalking pace on the real slope, stairs, and the wait to cross busy roads at busy hours
WheelchairwheelchairNot at allA gentler pace, slopes weigh much more, step-free paths, longer crossings
Public transportPOST /transit/planBuses ride in trafficWalk to the stop, the usual wait, the ride, the walk to the destination

GET /routing/profiles lists the profiles this deployment offers and whether each is available. Every endpoint in this guide accepts the same costing values (the raw endpoints use the engine names, such as pedestrian with a wheelchair option).


Road signs, closures and borders

  • No-entry signs are followed by direction: a street is not entered from the end a sign closes, you can still leave it the other way, and a destination on such a street is reached from its open end. This holds for motor modes on every routing endpoint, including matrices, isochrones and optimised tours. Walking and cycling are not bound by it.
  • Turn bans (no left turn, no right turn, no U-turn) are followed on /routing/plan and /routing/route.
  • Closures, restrictions and confirmed incidents are routed around on /routing/plan (see its roadEditConstraints, incidentConstraints and reportedConstraints). Set avoidIncidents: false or avoidReported: false to opt out of community reports.
  • A sign never makes a route fail: when no clean route exists the best route is returned and signRules.remaining says so. A rider's disregard list switches individual signs off.
  • Borders. Routes across national borders are not offered until crossings are verified. An in-country route is always preferred; when every route crosses, the request fails with 422 BORDER_CROSSING_UNAVAILABLE and details.crossing: { from, to }. Plan a cross-border journey in two parts, up to the border and on from the other side.

Freshness and caching

DataRefreshedCache in your app
Traffic tilesEach 5-minute slotOne URL per slot (t rounded to 5 minutes); the server allows 5 minutes with t, 60 seconds without
Road network traffic used by routes, matrices and isochronesAbout every 15 minutes; measured roads every 2 minutesDo not cache a route's ETA for long; re-plan or use a navigation session
Matrix answers with trafficServer cache up to 10 minutesAsk again for fresh traffic; cache: false forces a recompute
GET /traffic/summaryOn requestRefresh with the map view, at most once a minute
Analysed trafficFitted dailyCache for an hour

Two calls a few minutes apart can return slightly different times. That is traffic changing, not an error.


Errors and edge cases

Status / fieldMeaningWhat to do
available: falseThe routing service did not answer this timeRetry with backoff; keep the last answer on screen
400Invalid body (bad coordinates, unknown option)Fix the request; message and details say what is wrong
401 / 403Missing key, or a key without the scope or not allowed for this site or appCheck the key, its scopes and its restrictions
422 BORDER_CROSSING_UNAVAILABLEEvery route crosses a national borderPlan in two parts
422 DESTINATION_OUT_OF_COVERAGEA location is outside the routable network (on /routing/plan)Ask the user to pick a point on a road; or send allowOutOfCoverage: true knowingly
Matrix status other than okThat pair has no durationRead reason; other pairs still answer
signRules.remaining > 0No route avoided every signShow the route; optionally warn
traffic.applied: false in a matrixDurations are for light trafficShow traffic.message
429Rate limit for your keyBack off; batch with the matrix instead of many single routes

Contributing traffic data

Measured traffic comes from trips. If your app has its own location stream (delivery drivers, ride-hail, fleets), sending it improves traffic for everyone, including your own ETAs.

  • POST /telemetry/batches sends a trip while it happens, in small batches of 2–600 points with time, position, accuracy, speed and heading (scope telemetry). Each answer says what was measured. Trips feed aggregate traffic only; a road is shown as measured only when at least three independent contributors drove it, and individual trips are never exposed.
  • Navigation sessions contribute automatically.
  • Data owners with their own road measurements can supply them with POST /traffic/imports.

See Telemetry and Supplying your own traffic measurements. Tell your users how their location is used, in your own privacy notice.


Checklist and FAQ

Integration checklist

  • Restricted API key with only the scopes you use
  • Traffic layer: one tile URL per 5-minute slot, labels kept above traffic, minor roads from zoom 15
  • Route drawn above traffic, wider and with a white edge; traffic lighter while a route is shown
  • Camera framed once per new route, clear of your panels; refreshes never move the user's map
  • Evidence shown with labels (measured / typical / expected), never "live" for typical or expected
  • ETA from trip.summary.time (or eta.recommended), never static_time
  • includeLabels: false on interactive directions
  • routeId passed to navigation sessions
  • Matrix for many trips instead of many single routes
  • available: false handled with retry and the last answer kept
  • 422 border and coverage errors shown with clear text
  • Arabic labels used for Arabic users (every label ships in both languages)

FAQ

Why is the ETA longer than static_time? static_time is the routing graph's own figure, close to speed limits with almost no junction time. The ETA adds real street speeds, traffic and the time lost at junctions and lights.

Why did the ETA change between two calls? Traffic changes, and the network's traffic is refreshed every few minutes. A route planned for "now" at 07:55 and at 08:05 meets different traffic.

Why does a walking route ignore traffic? Traffic does not slow walking. It does lengthen waits to cross busy roads, which walking times include.

Why doesn't the route take the shortest street? That street may be closed by a no-entry sign in your direction, or the slower option once junctions and traffic are counted. signRules and travelTime.chosenFor say which.

Is "Expected" traffic real? It is Navvo's expected traffic for that road and time, from the time of day, the calendar, the place and the road. It is labelled as expected so it is never mistaken for a measurement. Where people have recently driven, the road shows as measured instead.

Can I get traffic for tomorrow morning? Yes: tiles with t, routes and matrices with departureTime, segments with at, and analysed traffic for any time.

Which countries are covered? The Middle East markets Navvo serves. A location outside the routable network is reported, never silently snapped to a distant road.


Endpoint map

TaskEndpointScope
Traffic layerGET /traffic/tiles/{z}/{x}/{y}.mvttraffic
Moving cars for a 3D mapGET /traffic/cars/tiles/14/{x}/{y}, GET /traffic/cars, GET /traffic/cars/positionstraffic
Traffic in a viewGET /traffic/summary?bbox=…traffic
One roadGET /traffic/segments/{ref}traffic
Route coloured by trafficPOST /traffic/routerouting + traffic
Directions (recommended)POST /routing/planrouting
Directions, engine formatPOST /routing/routerouting
Many origins × destinationsPOST /routing/matrix, /routing/matrix/jobsrouting
Reachable areaPOST /routing/isochronerouting
Best stop orderPOST /routing/optimizerouting
Fleet routingPOST /optimize/routesoptimize
Turn-by-turnPOST /navigation/sessions, wss://…/navigation/sessions/{id}/liverouting
Snap a GPS tracePOST /routing/map-matchrouting
Speed limits along a routePOST /routing/route-attributesrouting
Public transportPOST /transit/planrouting
Usual traffic for planningGET /traffic/analysed*traffic
Contribute tripsPOST /telemetry/batchestelemetry

Full field-by-field reference: Routing · Traffic · Navigation · Navigation WebSocket · Route optimization · Telemetry · Transit

Copyright © 2026