DocsIDarsa.technology

Docs / AI Box And Video Analytics Software / Traffic Monitor API Quick Start

Traffic Monitor API Quick Start

Read vehicle volumes, speeds, incidents and the vehicle log from a Traffic Monitor box with an API token, and find the DATEX II feed.

This quick start reads a road site’s traffic figures from a Traffic Monitor box. You need curl and about ten minutes. The numbers in the answers below are sample values.

Before You Start

Ask an admin of the box to create an API account on the dashboard (API accounts page) with:

  • the role Viewer on the site you want to read;
  • the scope read (add export to download the log as a file);
  • an expiry date.

Plates are personal data: the account sees them only with the personal_data scope, which only the box’s owner can give. This quick start works without it.

They give you the token (<API_KEY> below), the box’s address (<BOX_HOST>) and a copy of the box’s certificate (box.pem, from Download the box’s certificate on the API accounts page) with its SHA-256 fingerprint: check it as The Box’s Certificate shows. Authentication and Scopes explains each of these.

Find Your Site

curl --cacert box.pem \
  -H "Authorization: Bearer <API_KEY>" \
  "https://<BOX_HOST>/api/v1/sites"
{
  "items": [
    {
      "id": 1,
      "name": "North Plant",
      "timezone": "Asia/Jakarta",
      "created": "2026-10-01T02:00:00Z",
      "version": 4,
      "my_role": "viewer",
      "location": { "lat": -6.2, "lon": 106.8 },
      "area": null,
      "zones": 3
    }
  ]
}

Keep the site’s id (here 1). The site’s cameras are at GET /api/v1/cameras.

Read The Traffic Overview

Ask for one period with from and to (RFC 3339; %2B is the + of the time zone offset):

curl --cacert box.pem \
  -H "Authorization: Bearer <API_KEY>" \
  "https://<BOX_HOST>/api/traffic/v1/sites/1/overview?from=2026-11-01T00:00:00%2B07:00&to=2026-11-02T00:00:00%2B07:00"
{
  "vehicles": 18452,
  "by_class": { "car": 7311, "motorcycle": 9870, "bus": 212, "truck": 1003, "bicycle": 56 },
  "flow_per_min": 12.8,
  "speeds_measured": 15207,
  "mean_speed_kmh": 38.6,
  "p85_speed_kmh": 51.0,
  "plates_read_pct": 0.0,
  "incidents": { "speeding": 41, "wrong_way": 3, "stopped": 5, "congestion": 2, "watchlist": 0 },
  "congested_now": [
    { "camera_id": 21, "lane": "Lane 2", "occupancy": 82.0, "since": "2026-11-02T09:41:00Z" }
  ]
}
Field Meaning
vehicles, by_class Vehicles counted in the period, in total and per class
flow_per_min Vehicles per minute over the last 5 minutes
speeds_measured, mean_speed_kmh, p85_speed_kmh Vehicles with a speed, their mean and 85th percentile speed
plates_read_pct The share of the vehicles with a plate read (0 on a site without plate reading)
incidents Incidents in the period, per kind
congested_now Lanes congested now, since when

Speeds are advisory estimates for traffic management; they are no basis for enforcement. For volumes per hour or day, call GET /api/traffic/v1/sites/1/trend; for the peak hour, speed histogram and class share, GET /api/traffic/v1/sites/1/analytics.

Read The Vehicle Log

curl --cacert box.pem \
  -H "Authorization: Bearer <API_KEY>" \
  "https://<BOX_HOST>/api/traffic/v1/sites/1/logs?from=2026-11-01T00:00:00%2B07:00&to=2026-11-02T00:00:00%2B07:00&limit=50"
{
  "items": [
    {
      "id": "21:90311",
      "time": "2026-11-02T09:44:12Z",
      "camera_id": 21,
      "line": "count",
      "direction": "in",
      "lane": "Lane 1",
      "class": "car",
      "colour": "white",
      "speed_kmh": 42.5,
      "plate": null,
      "media": null,
      "photo": null
    }
  ],
  "next_before": "2026-11-02T09:44:09Z"
}

Each row is one vehicle crossing a counting line. Without the personal_data scope plate and photo are null. For the next page, send next_before as before. Filter with class and camera; download the period as a file with GET /api/traffic/v1/sites/1/logs/export?format=csv and the scope export.

Incidents (speeding, wrong way, stopped vehicles, congestion, watchlist hits) are at GET /api/traffic/v1/sites/1/incidents.

The DATEX II Feed

A traffic management centre can pull the site’s measurements as DATEX II v3 XML with a feed token of its own, without an API account: GET /api/traffic/v1/feeds/datex/1/measured-data with Authorization: Bearer <FEED_TOKEN>. An admin of the site makes the feed token on the dashboard. The documents are measurement-sites, measured-data and situations.

Next Steps

  • Push passages and incidents to your system instead of polling: Webhooks (event types such as traffic.passage, traffic.speeding and traffic.congestion, and periodic summaries).
  • Keep a plate watchlist in step with another system through the signed watchlist push (POST /api/traffic/v1/feeds/watchlist/{site}), described in the reference.
  • Every operation and field: Traffic Monitor API reference and platform API reference.
Was this page helpful?

1.0.0. Updated 2026-11-06