Skip to content

Traffic-Aware Routing

Traffic-aware routing extends Directions with typical congestion patterns. Pass a departure time and Plaza slows each road according to how busy that kind of road usually is at that hour. Route choice and duration_s both change, so a rush-hour trip can take a different road than the same trip at 3 am.

This is not live traffic. Plaza has no feed of current speeds, incidents or closures. The adjustment comes from a fixed table of typical speeds, the same every week, scaled by how built-up the area around each road is. Use it for planning and estimates, not for guidance on a trip that’s already underway.

Traffic-aware routing is a premium endpoint, so each request counts as 4x.

POST /api/v1/route

It’s the same endpoint as standard directions. Add depart_at to turn the adjustment on. All Directions parameters apply, plus:

FieldTypeDefaultDescription
depart_atstringnoneDeparture time: an ISO 8601 timestamp with Z or an offset (an exact instant), one without an offset (local time at the origin), or "now".
traffic_modelstring"best_guess"best_guess, pessimistic or optimistic. Used only when depart_at is set.

depart_at also works with EV routing, waypoints and alternatives. It applies to every leg.

Terminal window
curl -X POST https://plaza.fyi/api/v1/route \
-H "x-api-key: $PLAZA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": { "type": "Point", "coordinates": [-73.9857, 40.7484] },
"destination": { "type": "Point", "coordinates": [-73.9680, 40.7614] },
"mode": "auto",
"depart_at": "2026-03-23T08:00:00-04:00"
}'

The response is the standard route Feature. Compare duration_s with a request that leaves out depart_at, which uses free-flow speeds.

Traffic patterns follow the clock on the wall at the place you’re leaving. Plaza finds the origin’s time zone (daylight saving included) and picks the profile for the local hour and weekday there.

A timestamp with Z or a UTC offset is an exact instant. Plaza converts it to the origin’s local time, so the same instant gives a different hour in different places. A timestamp without an offset is read as local time at the origin, as written.

You sendOriginPlaza uses
2026-07-20T12:30:00ZNew YorkMonday, 08:30
2026-07-20T08:30:00-04:00New YorkMonday, 08:30
2026-07-20T08:30:00New YorkMonday, 08:30
2026-07-20T12:30:00ZParisMonday, 14:30
2026-07-20T08:30:00ParisMonday, 08:30

If your system keeps UTC, send the instant with Z. If you have the traveller’s local departure time, send it without an offset.

A value that isn’t ISO 8601 or "now" is rejected with a 422 validation_error:

depart_at must be an ISO 8601 datetime such as "2026-03-16T08:00:00-04:00" (an instant) or "2026-03-16T08:00:00" (local time at the origin), or "now"

A traffic_model that isn’t one of the three names below is rejected the same way. In PlazaQL the same mistakes fail the query with a 400 query_error.

"now" is read on the local clock at the origin. Plaza looks up the origin’s time zone (from time zone boundaries, else from the country it’s in) and applies that zone’s rules, daylight saving included. New York in July is UTC-4, Paris is UTC+1 or UTC+2 depending on the season, and all of China is UTC+8.

An origin outside every country Plaza knows (at sea, or in a region it hasn’t loaded) falls back to UTC plus round(longitude / 15) hours. Send an explicit depart_at there if the hour matters.

Plaza keeps one speed factor for each combination of road class, density band, day type and hour. The day type is weekday (Monday to Friday) or weekend. The factor is the share of free-flow speed you can expect:

  • 1.0 means free-flow.
  • 0.5 means travel takes twice as long as free-flow.

The road classes are motorway, trunk, primary, secondary, tertiary, unclassified, residential and service. Roads of any other class, such as ramps or paths, always run at free-flow. A sample of the urban table, for weekdays:

HourMotorwayPrimaryResidential
03:001.001.001.00
08:000.450.560.81
17:000.480.580.82

On weekends the peaks flatten: an urban motorway at noon runs at 0.82 and at 08:00 at 0.92.

The hourly curves are modelled. They describe a typical commuting pattern, not a particular road or city, and nobody measured them. What comes from OpenStreetMap is how much of that pattern each road gets:

Density bandStreet network around the roadShare of the urban slowdownMotorway, weekday 08:00
Urbandense, like a city centreall of it0.45
Suburbanin between60%0.67
Ruralsparse25%0.86

The band comes from how many road junctions and way ends OSM has per square kilometre in the H3 cell around the road (cells about 250 km² across). A road whose band Plaza hasn’t worked out yet counts as urban.

On roads with few lanes, rush hours bite harder. When a road’s factor is below 0.8, a two-way road with one lane in total runs at a further 80%, one with two lanes at 90% and one with three or four at 95%. A one-way road’s lanes count double, so a one-lane one-way is treated like a two-lane road. Roads without a lanes tag aren’t adjusted.

Traffic lights follow the clock too. The time a car waits at a signal is halved at night (22:00 to 06:00) and grows by half in the weekday rush hours (07:00 to 09:00 and 16:00 to 18:00). Turn times at junctions don’t change with the hour. See Directions for how signal delays are counted.

The adjusted cost of a road is its free-flow cost divided by the speed factor. That changes which route wins as well as how long it takes: a motorway that’s fastest at night can lose to an arterial road at 08:00.

The profiles describe car traffic. They apply to cars and trucks. Walking and cycling times don’t depend on depart_at.

traffic_model changes how the profile is applied:

ModelEffect
best_guessUses the profile as is. This is the default.
pessimisticCaps every road at 70% of free-flow speed, or lower where the profile is already slower.
optimisticIgnores congestion and uses free-flow speeds.

An unknown model returns a 422 validation_error.

Terminal window
curl -X POST https://plaza.fyi/api/v1/route \
-H "x-api-key: $PLAZA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": { "type": "Point", "coordinates": [-73.9857, 40.7484] },
"destination": { "type": "Point", "coordinates": [-73.9680, 40.7614] },
"mode": "auto",
"depart_at": "2026-03-23T08:00:00-04:00",
"traffic_model": "pessimistic"
}'

Send the same trip at several times to find a good window. This loop prints the duration for each:

Terminal window
for t in 03:00 08:00 12:00 17:00; do
curl -s -X POST https://plaza.fyi/api/v1/route \
-H "x-api-key: $PLAZA_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"origin\": { \"type\": \"Point\", \"coordinates\": [-73.9857, 40.7484] },
\"destination\": { \"type\": \"Point\", \"coordinates\": [-73.9680, 40.7614] },
\"mode\": \"auto\",
\"depart_at\": \"2026-03-23T${t}:00-04:00\"
}" | jq -r --arg t "$t" '"\($t) \(.properties.duration_s) s"'
done

Each request counts as a premium request.

Isochrones and distance matrices take the same depart_at and traffic_model. Car, truck, motorcycle and scooter times follow the profile for that hour, and conditional limits apply then too. A matrix reads "now" at its first origin. Walking and cycling don’t change.

Terminal window
curl -X POST https://plaza.fyi/api/v1/matrix \
-H "x-api-key: $PLAZA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"origins": [{ "type": "Point", "coordinates": [-73.9857, 40.7484] }],
"destinations": [{ "type": "Point", "coordinates": [-73.9680, 40.7614] }],
"depart_at": "2026-03-23T08:00:00-04:00"
}'

In PlazaQL, isochrone() and matrix() take depart_at: and traffic_model: as route() does.