GET /api/v1/cities/{slug}/traffic
Roadworks and traffic warnings per city (Autobahn API)
Roadworks and traffic warnings around a city from the Autobahn API in the canonical envelope. Items are filtered by a bounding box around the city's coordinates; data contains the matching entries. Full coverage: each of the 84 cities has its nearby motorways curated (data-driven from the Autobahn API); a city with no current message honestly responds with no_data. Congestion: each traffic warning additionally carries a congestion field (level stau/stockend/dicht/unspezifisch derived from the DATEX abnormalTrafficType, delay_minutes = travel-time loss, blocked), and payload.congestion_summary aggregates the congestion situation per city (count/stau/stockend/blocked/max_delay_minutes; null if no congestion message). Field names: every item also carries its values in the API convention (is_blocked as a real boolean, start_timestamp, delay_minutes, average_speed_kmh, abnormal_traffic_type, name, description_text plus bbox/lat/lon derived from extent); the camelCase raw fields of the Autobahn feed are deprecated and will be removed no earlier than 30 days after the announcement. Other special cases: a disabled source returns 200 with source_status="disabled"; a dead upstream with no cache returns 503 with a hint to GET /api/v1/health.
Parameters
| Name | In | Required | Type | Example | Description |
|---|---|---|---|---|---|
slug | path | yes | string | ||
include | query | no | string | Field opt-in: include=geometry keeps the raw polyline (geometry) per roadwork/warning; default is slim (geometry omitted). | |
full | query | no | boolean | Equivalent flag to include=geometry (?full=1 keeps the polyline). |
Code samples
curl "https://infranode.dev/api/v1/cities/hamburg/traffic"const res = await fetch("https://infranode.dev/api/v1/cities/hamburg/traffic");
const data = await res.json();
console.log(data);import httpx
res = httpx.get("https://infranode.dev/api/v1/cities/hamburg/traffic")
res.raise_for_status()
print(res.json())