Punctuality

De Lijn: bus and tram operator in flanders, with lines into brussels

Format
Parquet
Updates
Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)
Latest snapshot
Snapshots stored
about 801
curl -H "Authorization: Bearer $MOBILITYTWIN_TOKEN" -o punctuality.parquet "https://api.mobilitytwin.brussels/de-lijn/punctuality"

Daily punctuality table derived from De Lijn's GTFS-RT trip-update stream over a full Brussels-day window.

Each row represents one (trip, stop) observation with the latest known arrival/departure times, delays, and schedule_relationship — plus a synthetic row per cancelled trip when the feed signals cancellation without stop-time entries.

Single Parquet file (zstd-compressed). Read with Polars, DuckDB or PyArrow. The data is consistent with the GTFS schedule: scheduled = actual_time − delay matches the static GTFS arrival_time for De Lijn feeds that publish absolute times. Trip ids lack the gt:delijn: prefix of the published GTFS. The realtime feed carries no route or direction; from 2026-09-30 route_id and direction_id are filled from the timetable where the trip matches (about 98%).

A single Parquet file. Read it with Polars, DuckDB or PyArrow.

Which days have data

Data from 21 Aug 2024 to 22 Nov 2026, on 479 days. 30 of the last 30 days have data. A typical day holds 1 snapshot. Days are in UTC.

2026
JanFebMarAprMayJunJulAugSepOctNovDec
2025
JanFebMarAprMayJunJulAugSepOctNovDec
2024
JanFebMarAprMayJunJulAugSepOctNovDec
  • Full day
  • Partial, 50–90% of a typical day
  • Low, under 50%
  • No snapshot
  • Not expected

Click a day above, or pick a date, to get its requests.

Parameters

NameMeaning
timestampReturn the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. 2026-05-06T12:00:00Z). Without it, the latest snapshot is returned.

Python example

# pip install polars requests
import io
import requests
import polars as pl

from datetime import datetime, timedelta, timezone

# Yesterday's Brussels-day file (the harvester anchors windows to local midnight,
# so any timestamp inside that day returns the same parquet).
yesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(
    hour=12, minute=0, second=0, microsecond=0
)
params = {"timestamp": yesterday_noon.isoformat()}  # ISO accepted; epoch also works

url = "https://api.mobilitytwin.brussels/de-lijn/punctuality"
data = requests.get(url, headers={
    "Authorization": "Bearer [MY_API_KEY]"
}, params=params).content

df = pl.read_parquet(io.BytesIO(data))

print(f"rows: {df.height:,}, columns: {df.columns}")

# Average arrival delay per route, ignoring cancellations and no-data rows.
delays = (
    df.filter(pl.col("arrival_delay").is_not_null() & ~pl.col("cancelled"))
      .group_by("route_id")
      .agg([
          pl.col("arrival_delay").mean().round(1).alias("mean_delay_s"),
          pl.col("arrival_delay").quantile(0.9).alias("p90_delay_s"),
          pl.len().alias("n"),
      ])
      .sort("mean_delay_s", descending=True)
)
print("\nWorst 10 routes by mean arrival delay:")
print(delays.head(10))

# How many trips were cancelled and on which routes?
cancellations = (
    df.filter(pl.col("cancelled"))
      .select(["route_id", "trip_id", "start_date", "start_time"])
      .unique()
)
print(f"\ncancelled trip-instances: {cancellations.height:,}")
print(cancellations.group_by("route_id").len()
      .sort("len", descending=True).head(10))