oslew docs
Console
Menu

Live traffic

Every driving time the service gives is a free-flow time by default: the road's posted limit, or its class speed. Where an operator has applied a traffic feed — the speeds on the roads that are slow right now — a request can ask for the answer on those speeds instead. This page is for callers of the routing routes; how a feed is applied is in operator feeds.

Asking for it

Add traffic=live, or send profile=live — the two mean the same thing, and either is enough:

RouteOn live weights
/v1/routeThe route and its time.
/v1/matrixEvery time in the matrix.
/v1/isochroneHow far the time budget reaches.
/v1/optimizeThe order and the leg times, with traffic=live — but the legs' distance and path are routed on the release's speeds. See its pitfalls.

Snapping and map matching always use the release's speeds, and transit is unaffected: its live delays come from a separate realtime feed, described in stops and departures.

curl
curl -G "https://api.oslew.com/v1/route" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'from=19.4406,-99.2047' \
  --data-urlencode 'to=19.4326,-99.1332' \
  --data-urlencode 'traffic=live' \
  --data-urlencode 'geometry=false'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.route(
    "19.4406,-99.2047",
    "19.4326,-99.1332",
    geometry=False,
    traffic="live",
)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.route("19.4406,-99.2047", "19.4326,-99.1332", { geometry: false, traffic: "live" });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 299
ratelimit-reset: 1

{
  "from": [
    19.4406,
    -99.2047
  ],
  "to": [
    19.4326,
    -99.1332
  ],
  "snapped_from": {
    "from": 394836,
    "to": 394840,
    "frac": 0.05159010871941542,
    "lat": 19.440242113128892,
    "lon": -99.20471337400338,
    "distance_m": 39.819960107330104,
    "time_ds": 28,
    "len_m": 39,
    "two_way": false
  },
  "snapped_to": {
    "from": 355496,
    "to": 355490,
    "frac": 0.16199866758190418,
    "lat": 19.43200133133587,
    "lon": -99.13329035902773,
    "distance_m": 67.23995201279342,
    "time_ds": 110,
    "len_m": 92,
    "two_way": false
  },
  "found": true,
  "distance_m": 9269,
  "duration_s": 695.2,
  "nodes": 165,
  "settled": 65350,
  "geometry": [],
  "engine": "live/dijkstra",
  "provenance": {
    "name": "overture-transportation",
    "release": "2026-08-19.0",
    "license": "ODbL-1.0"
  },
  "took_us": 7120
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

The same trip as the driving example in routes and profiles, asked withtraffic=live just after a feed slowed a stretch of Paseo de la Reforma to a third of its speed. This route does not use that stretch, so its time is unchanged at 695.2 s. What did change is how it was found:engine is live/dijkstra, and the search settled 65,350 junctions where the release's hierarchy settled 431.

Driving only

Live weights are the driving network with some roads' times changed, so no other profile can use them.profile=walking&traffic=live is a 400, live traffic applies to the driving profile; `walking` has its own weights. profile=live already means driving.

engine says what answered

engineMeans
base/hierarchyThe release's free-flow speeds. What a request without live gets — and what a request with it gets when no feed is applied.
live/dijkstraLive speeds from a feed applied moments ago. The fast search structure for the new speeds — a contraction hierarchy — is still being built in the background, so the search is plain Dijkstra: the same answer, more work.
live/hierarchyLive speeds, with their hierarchy built. As fast as the release's.

The Dijkstra phase matters most for matrices: until the hierarchy is ready, a live matrix runs one full search per point, and a large one is much slower than usual. A route is still quick.

No feed, no error

Asking for live where no feed is applied is not refused. The answer comes back on the release's speeds, with engine: "base/hierarchy", and that field is the only way to tell. If your product shows "with live traffic", check it:

Python
from oslew import Client

client = Client(base_url="https://api.oslew.com")

route = client.route("19.4406,-99.2047", "19.4326,-99.1332", traffic="live", geometry=False)
live = route["engine"].startswith("live/")
label = "with live traffic" if live else "typical, without live traffic"
TypeScript
import { Client } from "@oslew/client";

const client = new Client({ baseUrl: "https://api.oslew.com" });

const route = await client.route("19.4406,-99.2047", "19.4326,-99.1332", { traffic: "live", geometry: false });
const live = route.engine.startsWith("live/");
const label = live ? "with live traffic" : "typical, without live traffic";

Where the speeds come from

A traffic feed is applied by an operator — someone running the service with the operator product, on Enterprise — with POST /v1/traffic. It names the roads whose speed differs from usual, each by a point on it or a stretch between two points, with a speed or a factor on the release's time; TomTom's and HERE's flow formats are read directly. Operator feeds has the details. What a caller needs to know:

  • Only the roads a feed names change. Every other road keeps its free-flow time, so live answers are only as current as the feed is complete.
  • Each feed replaces the last. A new feed is the whole picture, built on the release's speeds, not a change on top of the previous feed.
  • A feed is held in memory, per pod. It changes the server that received it and is gone when that server restarts; nothing copies it to the others. Behind a load balancer, two requests a second apart can reach servers with different feeds, or one with none. engine on each answer says which you got.
  • Only times change. The network, its access rules and its distances are the release's. A road closed by an incident is slow in a feed, not missing.

The feed's status

GET /v1/traffic says whether a feed is in force on the server that answers, how many road edges it changed, when it was applied, and which engine is serving it — none, dijkstra orhierarchy. It belongs to the operator product, like the feed itself; a key with only routing reads theengine field of its own answers instead.

curl
curl "https://api.oslew.com/v1/traffic" \
  -H "Authorization: Bearer $GEO_API_KEY"
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.traffic()
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.traffic();
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 10
ratelimit-remaining: 19
ratelimit-reset: 1

{
  "applied": false,
  "version": 0,
  "edges_updated": 0,
  "applied_at": null,
  "engine": "none",
  "took_us": 0
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Before any feed is applied: nothing in force, version 0, no engine.

Endpoints

GET/v1/routerouting

The fastest road route between two points, each snapped to the nearest point on a road.

GET/v1/trafficoperator

Whether live weights are in force, and which engine answers profile=live.