Skip to content

Measurement

What is derived from operations once the service has run: distances, regularity, ridership, and the trace kept of all of it.

trip-km

Trip kilometres — the distance operated, broken down by trip, by vehicle or by period. Used for per-kilometre billing, contractual monitoring and fleet sizing.

No identifier of its own: the data is obtained per period and per perimeter.

Endpoint Purpose
GET /api/v4/groups/<group_id>/stats/trip-km Aggregates kilometres over a period
GET /api/v4/groups/<group_id>/export/trip-km Exports the detail as CSV

Dead mileage, covered outside commercial service, is carried by the duty — see duties.

punctuality

Punctuality — the measure of the gap between the scheduled time and the actual passing time, aggregated over a period. It is the quality-of-service indicator most closely followed by transport authorities.

No identifier of its own: the data is obtained per period and per perimeter.

Endpoint Purpose
GET /api/v4/groups/<group_id>/stats/punctuality Aggregates punctuality over a period
GET /api/v4/groups/<group_id>/export/punctuality Exports the detail as CSV

The measure relies on the scheduled times — see stop-times — and on the observed passings.

A passing a telematic box made before its headsign showed the line, rebuilt once the line came on, is counted in neither the aggregate nor the export. It stays in the passing history; the trip feed (trip-details-feed) flags it with headsign_missing: true.

Punctuality profiles — the thresholds sorting a gap into five levels: very early, early, on time, late, very late. Each network defines one or more (urban and interurban, for instance), in signed whole minutes, and attaches its routes to them; the default profile holds every route no other profile holds. A gap is early when it is at most early × 60 seconds, late when it is at least late × 60, and alike for the big levels.

Endpoint Purpose
GET /api/v4/groups/<group_id>/config/punctuality-profiles Gives the profiles and their revision
PATCH /api/v4/groups/<group_id>/config/punctuality-profiles Replaces the whole list of profiles, at the revision read

Once profiles are stored, driver_ontime_interval can no longer be changed: it is [early × 60 + 1, late × 60] of the default profile, so that the Driver apps unaware of the profiles classify as the others do.

passenger-counts

Passenger counts — the number of boardings and alightings recorded at stops, per trip. It comes from the on-board counting systems, and feeds service sizing.

No identifier of its own: the data is obtained per period and per perimeter.

Endpoint Purpose
GET /api/v4/groups/<group_id>/stats/passenger-counts Aggregates ridership over a period
GET /api/v4/groups/<group_id>/export/passenger-counts Exports the detail as CSV

stats

Statistics — the cross-cutting family of aggregation and export endpoints. It is not an entity in the sense of the other entries: the tag gathers the outputs computed over the preceding entities, in two constant shapes — an aggregate under /stats/, a CSV export under /export/.

Endpoint Purpose
GET /api/v4/groups/<group_id>/stats/vehicles-used Counts the vehicles committed over a period
GET /api/v4/groups/<group_id>/stats/daily-devices Counts the active devices per day
GET /api/v4/groups/<group_id>/vehicle-amount Gives the group's vehicle count

The eight CSV exports of the datahub spec — trips, drivers, vehicles, alerts, punctuality, kilometres, trip tracking, passenger counts — are the recommended way to feed a data warehouse. They are described in the collection examples.

history

History — the retention of what happened, beyond the real-time window: events reported by the devices, times observed at stops, the GTFS in force on the dates concerned, kilometres recorded. It is the source to query to reconstruct a past day.

No identifier of its own: history is queried per perimeter and per period.

Endpoint Purpose
GET /api/v4/groups/<group_id>/history/events Lists the events reported by the devices
GET /api/v4/groups/<group_id>/history/stop-times Gives the passings observed at stops (optional event filter: arrival or departure)
GET /api/v4/groups/<group_id>/history/gtfs-active Gives the GTFS in force on a date
GET /api/v4/groups/<group_id>/devices/<device_id>/history Traces a device's activity

The observed times kept here are distinct from the scheduled times, which belong to the schedule reference — see stop-times.

A trip change does not count as a stop passage. Passages on the new trip are recorded from its own stop reports; those on the previous trip are preserved.