Traffic
Speeds on the main roads of Iraq, built from anonymous reports by drivers who use Tareky, and from what a road typically does at each time of the week. It is for showing congestion on a map, and for checking a route’s timing against the road’s usual pace. It is not a per-vehicle or per-trip feed: nothing here can be traced to a person.
What is in it, and what is not
Section titled “What is in it, and what is not”- Aggregated, and only from enough drivers. A live speed appears only where at least 5 drivers (on at least 2 networks) reported it in the last minutes. The historical profile has the same floor over the last 8 weeks. A road with too few drivers is simply absent: no colour, no zero.
- Main roads only. Motorways, trunk, primary, secondary and tertiary roads, and their link roads. Residential, service and unclassified roads, and tracks, are never included, whatever the traffic on them.
- Directed. Each direction of a two-way road has its own speed.
- Live first, then typical. Where live speeds exist they are used; elsewhere the profile’s typical speed for that 15-minute slot of the week (Baghdad time) answers, marked
source: "historical". - Fresh within a few minutes. Live speeds are recomputed every minute and a snapshot older than 10 minutes is not live: the profile answers instead.
Congestion compares the speed with a reference speed: what the road does when it is free, taken from the 85th percentile of the speeds the profile holds for it across the week (when at least 8 slots have data), else a typical speed for its class. congestion is free from 75% of the reference, slow from 50%, heavy from 30%, and jammed below. It is unknown when there is no reference. It is a comparison, not a measurement of free flow.
Attribution
Section titled “Attribution”The road geometry and classes come from OpenStreetMap, so anything you show from this API needs “© OpenStreetMap contributors” visible next to it. Responses carry it as attribution. OpenStreetMap data is under the Open Database Licence; see Terms and privacy.
GET /v1/traffic/tiles/{z}/{x}/{y}.mvtA Mapbox Vector Tile, gzip-compressed, zooms 8 to 16 (overzoom above). One layer, traffic, of lines in the direction of travel, joined along each road:
| Property | Meaning |
|---|---|
s |
Speed, km/h |
r |
Reference speed, km/h |
c |
1 free, 2 slow, 3 heavy, 4 jammed |
k |
Road class code (0 motorway, 1 motorway link, 2 trunk, 3 trunk link, 4 primary, 5 primary link, 6 secondary, 7 secondary link, 8 tertiary, 9 tertiary link) |
h |
1 when the speed is the historical profile’s, 0 when live |
o |
1 for a one-way road |
Small roads appear from higher zooms: motorway to primary from 8, secondary from 10, tertiary from 12. An empty tile answers 204. Each tile costs 1 unit; a tile that has not changed answers 304 with the ETag you sent, which is free.
In MapLibre, draw each direction offset to its right (drivers keep right):
map.addSource('traffic', { type: 'vector', minzoom: 8, maxzoom: 16, tiles: ['https://api.tareky.com/v1/traffic/tiles/{z}/{x}/{y}.mvt'],});// Send the key: tiles are keyed. transformRequest adds it only for these URLs.// new maplibregl.Map({ transformRequest: (url) => url.includes('/v1/traffic/')// ? { url, headers: { Authorization: 'Bearer tareky_pk_…' } } : { url } })map.addLayer({ id: 'traffic', type: 'line', source: 'traffic', 'source-layer': 'traffic', layout: { 'line-cap': 'round', 'line-join': 'round', 'line-sort-key': ['get', 'c'] }, paint: { 'line-width': ['interpolate', ['linear'], ['zoom'], 8, 1.2, 12, 2.4, 16, 5], 'line-offset': ['interpolate', ['linear'], ['zoom'], 11, 0, 12, ['case', ['==', ['get', 'o'], 1], 0, 1.2], 16, ['case', ['==', ['get', 'o'], 1], 0, 2.6]], 'line-color': ['match', ['get', 'c'], 1, '#00943e', 2, '#cb6e00', 3, '#d42325', 4, '#7f041e', '#82878c'], },});Tiles are billed on every request and the key travels in a header, so they are Cache-Control: private: your own browser caches them for a minute, a shared cache does not. Keep a public key’s origins restricted (Keys).
GET /v1/traffic/flow?bbox=west,south,east,north&limit=5000GeoJSON LineString features, one per directed segment, for a box at most 0.25 degrees on a side (wider: use tiles). Costs 2 units. Each has:
speedKmh,referenceKmh(ornull),congestion(free,slow,heavy,jammed,unknown)class, the OpenStreetMaphighwayvaluesource:liveorhistoricaloneway
The collection has updatedAt (when live speeds were computed; null when only the profile answered), truncated when more matched than limit (default 5,000, at most 20,000), and attribution.
Historical
Section titled “Historical”GET /v1/traffic/historical?slot=34&bbox=west,south,east,northThe typical speed on each road for one 15-minute slot of the week, in Baghdad time: slot 0 is Monday 00:00 to 00:15 and 671 is Sunday 23:45. Without slot, the current one. Same shape and limits as flow, with slot and profileVersion. Costs 2 units.
Snapshot
Section titled “Snapshot”GET /v1/traffic/snapshotSecret keys only (any other key, a public one included, gets 403). The whole live network in one file, for batch use. The answer names the file and gives a signed link that expires in 15 minutes:
{ "version": "9f2c…", "createdAt": "2026-10-12T08:15:00.000Z", "rows": 1840, "format": "csv.gz", "columns": ["from_node","to_node","kmh","sessions","class","from_lng","from_lat","to_lng","to_lat"], "url": "https://…", "expiresAt": "2026-10-12T08:30:00.000Z", "attribution": "© OpenStreetMap contributors"}The file is gzip CSV with no header; from_node and to_node are OpenStreetMap node ids, sessions is how many drivers back the speed (never under 5), and the coordinates are those two nodes, in the direction of travel. Rewritten every minute. Costs 10 units; poll no more often than once a minute. A key limited to an area (the same feedArea the incident feeds use) cannot take it: use flow or tiles.
Limits
Section titled “Limits”Tiles allow 60 requests a second per key, flow 10, historical 5 and the snapshot 2, under your plan’s own limits (Plans). The API’s scope is traffic.

