Traffic Incident Details parameters (bbox or ids)
OptionalcustomTemplate: Partial<TrafficIncidentDetailsTemplate>Advanced customization for request/response handling
Promise resolving to a TrafficIncidentDetails object containing the matching incidents
Two query modes:
bbox): Returns all incidents within the given area.
Maximum area is 10,000 km².ids): Returns the specified incidents directly.
GET is used automatically for up to 5 IDs; POST for up to 100 IDs.Key data provided per incident:
iconCategory): type of incident (accident, roadworks, jam, etc.)minor, moderate, major, …)present or future// Query by bounding box (Amsterdam area)
const result = await trafficIncidentDetails({
bbox: [4.728, 52.278, 5.080, 52.479]
});
result.incidents.forEach(incident => {
console.log(incident.properties.iconCategory); // 'accident' | 'jam' | …
console.log(incident.properties.magnitudeOfDelay); // 'minor' | 'major' | …
console.log(incident.geometry); // Point or LineString
});
// Query up to 5 specific incidents by ID (GET)
const result = await trafficIncidentDetails({
ids: ['incident-id-1', 'incident-id-2']
});
// Query many incident IDs — POST is used automatically when ids.length > 5
const result = await trafficIncidentDetails({
ids: largeIdArray
});
Fetch detailed information about traffic incidents.
Query incidents either by a geographic bounding box or by a list of incident IDs. Results are GeoJSON Features whose geometry is a
Point(localised incidents) or aLineString(incidents spanning a stretch of road).