# Vietnam Driver Hours Checker API

> Check a driving log against Vietnam’s 4-hour continuous driving rule, rest stops, daily / weekly limits and NĐ 168/2024 fines, or plan driver changes.

- Endpoint: `GET | POST https://apibox.io.vn/v1/vn-driver-hours`
- Category: Data & JSON
- HTML docs: https://apibox.io.vn/docs/vn-driver-hours/ (Vietnamese: https://apibox.io.vn/vi/docs/vn-driver-hours/)
- Online tool: https://apibox.io.vn/tools/vn-driver-hours/
- Authentication: `Authorization: Bearer <API key>` or `X-API-Key: <API key>` (free key: https://apibox.io.vn/dashboard/#signup)

Send a driving log as `log` (intervals `{ start, end, status, driver }` or events `{ time, status }`), or as CSV (`csv` or a text body with `start,end,status` / `time,status` columns, e.g. exported from a journey-monitoring device). Times are Vietnam local time. The answer lists, per driver, every continuous-driving period, daily and weekly totals and each violation with the minute it started and the excess.

Rules by date: until 30/6/2026 the Road Traffic Order and Safety Law 36/2024 article 64 caps driving at 10 h a day, 48 h a week and 4 h continuous. From 1/7/2026 (Law 118/2025) only the 4-hour continuous limit stays in the traffic law; daily / weekly working time follows the Labour Code, checked here as driving + other work (12 h a day incl. overtime, 48 h a week; both overridable). A stop of at least 15 minutes (5 minutes for intra-provincial buses and taxis) resets the continuous counter, per `service`. Fines of Decree 168/2024: driver 3–5 million VND and 2 licence points, owner 4–6 million (individual) or 8–12 million (organisation).

`action=plan` with `trip_hours` (and optional `start`, `drivers`) returns how many drivers a trip needs and a schedule of driving blocks and stops. The log is processed in memory only; use pseudonymous driver ids. Reference only, not legal advice.

## Parameters

| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| `log` | body | array | no |  | Intervals [{start, end, status: driving\|work\|rest, driver}] or events [{time, status, driver}] (Vietnam time, YYYY-MM-DDTHH:MM). |
| `csv` | body | string | no |  | The same log as CSV (start,end,status[,driver] or time,status[,driver]); a text/csv body also works. |
| `service` | body|query | string | no | `cargo` | fixed_route, contract, tourist, bus_interprovince, bus_intraprovince, taxi, cargo, internal_cargo, internal_passenger. |
| `action` | body|query | string | no | `check` | check (log) or plan (trip). |
| `trip_hours` | body|query | number | no |  | plan: total driving hours of the trip. |
| `start` | body|query | string | no |  | plan: departure (YYYY-MM-DDTHH:MM). |
| `drivers` | body|query | number | no |  | plan: number of drivers available. |
| `min_rest_min` | body|query | number | no |  | Override the minimum stop (minutes). |
| `work_day_cap_h` | body|query | number | no | `12` | From 1/7/2026: daily working-time cap (Labour Code). |
| `work_week_cap_h` | body|query | number | no | `48` | From 1/7/2026: weekly working-time cap. |

## Example request

```bash
curl -X POST "https://apibox.io.vn/v1/vn-driver-hours" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"service":"cargo","log":[{"start":"2026-08-03T05:00","end":"2026-08-03T09:20","status":"driving","driver":"D1"},{"start":"2026-08-03T09:20","end":"2026-08-03T09:40","status":"rest","driver":"D1"},{"start":"2026-08-03T09:40","end":"2026-08-03T12:00","status":"driving","driver":"D1"}]}'
```

## Example response

```json
{
  "action": "check",
  "period": {
    "from": "2026-08-03",
    "to": "2026-08-03"
  },
  "regimes": [
    "law118"
  ],
  "compliant": false,
  "service": "cargo",
  "min_rest_min": 15,
  "drivers": [
    {
      "driver": "D1",
      "totals": {
        "driving_min": 400,
        "driving": "6h40",
        "longest_continuous_min": 260,
        "longest_continuous": "4h20"
      },
      "violations": [
        {
          "type": "continuous_driving",
          "rule": "continuous_4h",
          "at": "2026-08-03T09:00",
          "period_start": "2026-08-03T05:00",
          "limit_min": 240,
          "vi": "Lái xe liên tục quá 4 giờ mà không dừng nghỉ đủ 15 phút",
          "en": "Continuous driving over 4 h without a stop of at least 15 min",
          "fine": true,
          "driving_min": 260,
          "excess_min": 20
        }
      ],
      "compliant": false,
      "fine_estimate": {
        "per_violation_driver_vnd": {
          "min": 3000000,
          "max": 5000000
        },
        "licence_points": 2,
        "owner_individual_vnd": {
          "min": 4000000,
          "max": 6000000
        },
        "owner_organisation_vnd": {
          "min": 8000000,
          "max": 12000000
        },
        "note": "One decision may cover several violations; the amount within the range is set by the officer. Labour Code working-time checks are not traffic fines."
      }
    }
  ]
}
```

## Use cases

- Audit journey-monitoring data before a police or inspector check
- Plan driver changes for an overnight coach trip
- Add a driving-time report to a fleet-management dashboard
- Explain to drivers which stop was too short

## FAQ

### Is the 10-hour daily limit still in force?

Not in the traffic law from 1/7/2026: Law 118/2025 keeps only the 4-hour continuous limit and refers daily / weekly time to the Labour Code. Logs before that date are checked against 10 h / 48 h.

### How long must the break be?

At least 15 minutes after 4 hours of continuous driving (fixed-route, contract, tourist, cargo, inter-provincial bus) or 5 minutes for intra-provincial buses and taxis; shorter stops do not reset the counter.

### Does traffic-jam time count?

Only time with the vehicle moving counts as driving under the calculation method; mark standing time as rest or work in your log.
