Punctuality
TEC: bus operator in wallonia, with lines into brussels
- Format
- Parquet
- Updates
- Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)
- Latest snapshot
- Snapshots stored
- about 806
curl -H "Authorization: Bearer $MOBILITYTWIN_TOKEN" -o punctuality.parquet "https://api.mobilitytwin.brussels/tec/punctuality"
Daily punctuality table derived from TEC'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 TEC feeds that publish absolute times.
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 819 days. 30 of the last 30 days have data. A typical day holds 1 snapshot. Days are in UTC.
- 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
| Name | Meaning |
|---|---|
timestamp | Return 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_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(
hour=12, minute=0, second=0, microsecond=0
)
params = {"timestamp": yesterday_noon.isoformat()}
url = "https://api.mobilitytwin.brussels/tec/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:,}")
# Note: TEC's GTFS-RT feed publishes delays only — no absolute arrival_time /
# departure_time. Join to static GTFS on (trip_id, stop_id) to recover times.
not_cancelled = df.filter(~pl.col("cancelled") & pl.col("arrival_delay").is_not_null())
# Distribution of arrival delays.
print("\nArrival delay distribution (seconds):")
print(not_cancelled.select([
pl.col("arrival_delay").quantile(0.05).alias("p05"),
pl.col("arrival_delay").median().alias("median"),
pl.col("arrival_delay").mean().round(1).alias("mean"),
pl.col("arrival_delay").quantile(0.95).alias("p95"),
pl.col("arrival_delay").max().alias("max"),
(pl.col("arrival_delay") <= 60).mean().round(3).alias("share_within_60s"),
]))
# Where do the worst delays accumulate?
print("\nMean arrival delay per route (top 10):")
print(not_cancelled.group_by("route_id")
.agg([pl.col("arrival_delay").mean().round(1).alias("mean_delay_s"),
pl.len().alias("n")])
.filter(pl.col("n") >= 50)
.sort("mean_delay_s", descending=True)
.head(10))
# Cancellations.
cancelled = df.filter(pl.col("cancelled"))
print(f"\ncancelled rows: {cancelled.height:,}, unique trip-instances: "
f"{cancelled.select(['trip_id', 'start_date', 'start_time']).unique().height}")