The TEC is the main public transport operator in Wallonia with a fraction of its network
in Brussels. It publishes a GTFS feed which is used to provide the schedule of the vehicles and a
GTFS-RT feed which is used to provide real-time data.
Endpoints
Gtfs
/tec/gtfs
GTFSAPPLICATION/ZIP
The GTFS zip file of TEC
From
2024-08-21 14:53:16
To
2026-04-07 05:45:23
Records
502
import gtfs_kit as gk
import requests
import tempfile
url = "https://api.mobilitytwin.brussels/tec/gtfs"
data = requests.get(url, headers={
'Authorization': 'Bearer [MY_API_KEY]'
}).content
with tempfile.NamedTemporaryFile(delete=False, suffix=".zip") as f:
f.write(data)
feed = gk.read_feed(f.name, 'm')
# Explore the TEC schedule
print(f"Routes: {len(feed.routes)}, Stops: {len(feed.stops)}, Trips: {len(feed.trips)}")
print("\nSample routes:")
print(feed.routes[['route_short_name', 'route_long_name']].head(10))
GTFS (Parquet)
/tec/gtfs-parquet
GTFS-PARQUETAPPLICATION/ZIP
The GTFS feed of TEC converted to Apache Parquet format (zip archive of .parquet files). Parquet uses columnar storage with zstd compression and strong typing, resulting in 40-75% smaller files compared to the original GTFS zip. This format enables extremely efficient data transfer and near-zero RAM overhead when reading specific columns via Polars or DuckDB, making it ideal for analytical workloads and large-scale processing. Produced using gtfs-parquet.
From
2024-08-21 14:53:16
To
2026-04-07 05:45:23
Records
579
import requests
import tempfile
from gtfs_parquet import read_parquet
url = "https://api.mobilitytwin.brussels/tec/gtfs-parquet"
data = requests.get(url, headers={
'Authorization': 'Bearer [MY_API_KEY]'
}).content
with tempfile.NamedTemporaryFile(delete=False, suffix=".zip") as f:
f.write(data)
feed = read_parquet(f.name)
# List all routes (Polars DataFrame — zero-copy, extremely low RAM usage)
print(feed.routes.select("route_short_name", "route_long_name"))
# Count trips per route
print(feed.trips.group_by("route_id").len().sort("len", descending=True))
Gtfs realtime
/tec/gtfs-realtime
GTFS-RTAPPLICATION/OCTET-STREAM
The GTFS-RT binary file of TEC
From
2024-08-21 14:54:58
To
2026-04-07 22:06:40
Records
2,448,352
import requests
from google.transit import gtfs_realtime_pb2
url = "https://api.mobilitytwin.brussels/tec/gtfs-realtime"
data = requests.get(url, headers={
'Authorization': 'Bearer [MY_API_KEY]'
}).content
feed = gtfs_realtime_pb2.FeedMessage()
feed.ParseFromString(data)
# List all vehicle positions
for entity in feed.entity:
v = entity.vehicle
pos = v.position
print(f"Route {v.trip.route_id} at ({pos.latitude:.4f}, {pos.longitude:.4f})")
GTFS-RT Alerts
/tec/gtfs-rt-alert
GTFS-RTAPPLICATION/OCTET-STREAM
Real-time service alerts for TEC (disruptions, detours, cancellations).
From
2026-03-30 11:01:24
To
2026-04-07 21:59:19
Records
2,069
import requests
from google.transit import gtfs_realtime_pb2
url = "https://api.mobilitytwin.brussels/tec/gtfs-rt-alert"
data = requests.get(url, headers={
'Authorization': 'Bearer [MY_API_KEY]'
}).content
feed = gtfs_realtime_pb2.FeedMessage()
feed.ParseFromString(data)
# Display all active service alerts
for entity in feed.entity:
alert = entity.alert
header = alert.header_text.translation[0].text if alert.header_text.translation else "N/A"
routes = [s.route_id for s in alert.informed_entity]
print(f"[{alert.cause}] {header} — Routes: {', '.join(routes)}")
GTFS-RT Trip updates
/tec/gtfs-rt-trip-update
GTFS-RTAPPLICATION/OCTET-STREAM
Real-time trip updates for TEC including schedule deviations and cancellations.
From
2026-03-30 11:00:46
To
2026-04-07 22:06:32
Records
29,363
import requests
from google.transit import gtfs_realtime_pb2
url = "https://api.mobilitytwin.brussels/tec/gtfs-rt-trip-update"
data = requests.get(url, headers={
'Authorization': 'Bearer [MY_API_KEY]'
}).content
feed = gtfs_realtime_pb2.FeedMessage()
feed.ParseFromString(data)
# Show delayed trips (delay > 5 minutes)
for entity in feed.entity:
tu = entity.trip_update
for stu in tu.stop_time_update:
delay = stu.arrival.delay if stu.HasField('arrival') else 0
if delay > 300:
print(f"Trip {tu.trip.trip_id} — {delay // 60}min late at stop {stu.stop_id}")