{"openapi": "3.0.0", "servers": [{"url": "https://api.mobilitytwin.brussels", "description": "Absolute URL to the API. "}], "info": {"title": "MobilityTwin.Brussels API", "version": "0.0.1", "x-logo": {"url": "/static/logo_padding.png", "backgroundColor": "#ffffff", "width": "100px", "altText": "MobilityTwin.Brussels"}, "contact": {"url": "/", "name": "MobilityTwin.Brussels"}, "description": "<p>Real-time and historical mobility data for Brussels: public transport, trains, shared\n    scooters and bikes, road traffic, aircraft, weather and air quality. Every request needs a token from\n    <a href=\"/account/\">your account</a>, sent as <code>Authorization: Bearer &lt;token&gt;</code>.</p>\n    <p>This is the full OpenAPI reference. <a href=\"/doc/\">The docs</a> add search and per-day availability.</p>"}, "paths": {"/sncb/vehicle-position": {"get": {"summary": "Vehicle position", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The estimated positions of SNCB/NMBS trains: where the timetable (GTFS) has each train at the moment of every GTFS-RT poll, placed along Infrabel's track segments. Realtime delays are not applied, since the realtime feed's trip ids match the timetable for only about half the trains.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds (derived from the GTFS-RT feed)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:54:59</td></tr><tr><td>End date</td><td>2026-11-20 21:45:21</td></tr><tr><td>Count</td><td>3283138</td></tr></table>", "x-refresh": "Every 20 seconds (derived from the GTFS-RT feed)", "x-description": "The estimated positions of SNCB/NMBS trains: where the timetable (GTFS) has each train at the moment of every GTFS-RT poll, placed along Infrabel's track segments. Realtime delays are not applied, since the realtime feed's trip ids match the timetable for only about half the trains.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}, {"description": "Start of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}, {"description": "Maximum number of snapshots, at most 100.", "schema": {"type": "integer"}, "in": "query", "name": "limit"}, {"description": "Number of snapshots to skip, to page through a range.", "schema": {"type": "integer"}, "in": "query", "name": "offset"}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"name_end": {"type": "string"}, "name_start": {"type": "string"}, "ptcarid_end": {"type": "string"}, "ptcarid_start": {"type": "string"}, "trip_headsign": {"type": "string"}, "trip_id": {"type": "string"}}, "required": ["name_end", "name_start", "ptcarid_end", "ptcarid_start", "trip_headsign", "trip_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/vehicle-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show all currently running trains with their route\nfor _, train in gdf.iterrows():\n    print(f\"{train['name_start']} \u2192 {train['name_end']} ({train['trip_headsign']})\")\n\n# Plot train positions on a map\ngdf.plot(figsize=(10, 8), color=\"#006ab3\", markersize=10)"}]}}, "/sncb/trips": {"get": {"summary": "Trips", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>MF-JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>All the trips of SNCB for the specified period of time. This is an aggregate of the GeoJSON files\nreturned by the vehicle-position endpoint of MobilityTwin.Brussels.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>On request \u2014 aggregated from <code>vehicle-position</code> over the queried interval</span></div><h4>Data information</h4><p>No information available for this component. The availability of this component is dependent on its source data.", "x-refresh": "On request \u2014 aggregated from <code>vehicle-position</code> over the queried interval", "x-description": "All the trips of SNCB for the specified period of time. This is an aggregate of the GeoJSON files\nreturned by the vehicle-position endpoint of MobilityTwin.Brussels.", "parameters": [{"description": "Start of the range, in Unix seconds or ISO 8601. Without any timestamp, the last hour is used; with only one, the hour starting or ending at it.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "description": "MF-JSON (Moving Features JSON) FeatureCollection containing train trajectories over a time period.", "type": "object", "properties": {"type": {"type": "string", "enum": ["FeatureCollection"]}, "features": {"type": "array", "items": {"type": "object", "properties": {"type": {"type": "string", "enum": ["Feature"]}, "properties": {"type": "object", "description": "Static properties of the trajectory (constant over time).", "properties": {"trip_id": {"type": "string", "description": "Unique identifier of the trip."}, "trip_headsign": {"type": "string", "description": "Destination displayed on the train."}, "name_start": {"type": "string", "description": "Name of the departure station."}, "name_end": {"type": "string", "description": "Name of the arrival station."}, "ptcarid_start": {"type": "string", "description": "Infrabel PTCAR id of the first station."}, "ptcarid_end": {"type": "string", "description": "Infrabel PTCAR id of the last station."}}}, "temporalGeometry": {"type": "object", "description": "Time-varying geometry representing the train's movement.", "properties": {"type": {"type": "string", "enum": ["MovingPoint"]}, "coordinates": {"type": "array", "description": "Array of [longitude, latitude] positions.", "items": {"type": "array", "items": {"type": "number"}}}, "datetimes": {"type": "array", "description": "ISO 8601 timestamps corresponding to each coordinate.", "items": {"type": "string"}}, "interpolation": {"type": "string", "description": "Interpolation method between points."}}, "required": ["type", "coordinates", "datetimes"]}}, "required": ["type", "properties", "temporalGeometry"]}}}, "required": ["type", "features"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport movingpandas as mpd\n\nfrom datetime import datetime, timedelta, timezone\n\nend = datetime.now(timezone.utc).replace(minute=0, second=0, microsecond=0)\nstart = end - timedelta(hours=1)\nparams = {\n    \"start_timestamp\": start.isoformat(),      # ISO accepted; epoch also works\n    \"end_timestamp\": end.isoformat(),\n}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/trips\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Load as a MovingPandas TrajectoryCollection\ntc = mpd.io.read_mf_dict(data, traj_id_property=\"trip_id\")\n\n# Print summary of each trajectory\nfor traj in tc.trajectories:\n    print(f\"Trip {traj.id}: {traj.get_length():.0f}m, duration: {traj.get_duration()}\")\n\n# Plot all train trajectories on a map\ntc.plot(figsize=(12, 8), linewidth=1)"}]}}, "/sncb/gtfs": {"get": {"summary": "GTFS", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The SNCB/NMBS timetable as a standard GTFS zip. For train paths, use <b>infrabel/segments</b>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:52:00</td></tr><tr><td>End date</td><td>2026-11-20 01:10:00</td></tr><tr><td>Count</td><td>712</td></tr></table>", "x-refresh": "Daily", "x-description": "The SNCB/NMBS timetable as a standard GTFS zip. For train paths, use <b>infrabel/segments</b>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "GTFS (General Transit Feed Specification) ZIP archive containing the following CSV files:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.txt": {"description": "Transit agency information.", "fields": ["agency_id", "agency_name", "agency_url", "agency_timezone", "agency_lang", "agency_phone"]}, "routes.txt": {"description": "Transit routes (lines).", "fields": ["route_id", "agency_id", "route_short_name", "route_long_name", "route_type", "route_color", "route_text_color"]}, "trips.txt": {"description": "Individual trips per route.", "fields": ["route_id", "service_id", "trip_id", "trip_headsign", "direction_id", "block_id", "shape_id"]}, "stops.txt": {"description": "Stop/station locations.", "fields": ["stop_id", "stop_name", "stop_lat", "stop_lon", "location_type", "parent_station"]}, "stop_times.txt": {"description": "Arrival/departure times per stop per trip.", "fields": ["trip_id", "arrival_time", "departure_time", "stop_id", "stop_sequence", "pickup_type", "drop_off_type"]}, "calendar.txt": {"description": "Service days of the week.", "fields": ["service_id", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "start_date", "end_date"]}, "calendar_dates.txt": {"description": "Service exceptions (added/removed dates).", "fields": ["service_id", "date", "exception_type"]}, "transfers.txt": {"description": "Transfer rules between stops or trips.", "fields": ["from_stop_id", "to_stop_id", "transfer_type", "min_transfer_time", "from_trip_id", "to_trip_id"]}, "translations.txt": {"description": "Translations of stop names and other text.", "fields": ["table_name", "field_name", "language", "translation", "record_id", "record_sub_id", "field_value"]}, "feed_info.txt": {"description": "Feed publisher, languages and validity period.", "fields": ["feed_id", "feed_publisher_name", "feed_publisher_url", "feed_lang", "default_lang", "feed_start_date", "feed_end_date", "feed_version", "feed_contact_email", "feed_contact_url"]}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import gtfs_kit as gk\nimport requests\nimport tempfile\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/gtfs\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = gk.read_feed(f.name, 'm')\n\n# List all routes\nprint(feed.routes[['route_short_name', 'route_long_name']])\n\n# Count trips per route\ntrips_per_route = feed.trips.groupby('route_id').size()\nprint(f\"\\nTotal routes: {len(feed.routes)}, Total trips: {len(feed.trips)}\")"}]}}, "/sncb/gtfs-parquet": {"get": {"summary": "GTFS (Parquet)", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The SNCB/NMBS timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>. No shapes table: SNCB publishes no shapes.txt.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (regenerated from the GTFS feed)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:52:00</td></tr><tr><td>End date</td><td>2026-11-20 01:10:00</td></tr><tr><td>Count</td><td>693</td></tr></table>", "x-refresh": "Daily (regenerated from the GTFS feed)", "x-description": "The SNCB/NMBS timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>. No shapes table: SNCB publishes no shapes.txt.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "ZIP archive of Apache Parquet files (zstd-compressed), one per GTFS file of the day's GTFS feed, with typed columns: identifiers and text as strings, enumerations as integers, dates as Parquet dates, and stop_times arrival_time/departure_time as durations since service-day midnight (may exceed 24h). The archive contains:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.parquet": {"description": "Transit agency information.", "fields": {"agency_fare_url": "string", "agency_id": "string", "agency_lang": "string", "agency_name": "string", "agency_phone": "string", "agency_timezone": "string", "agency_url": "string"}}, "stops.parquet": {"description": "Stop/station locations.", "fields": {"location_type": "integer", "parent_station": "string", "platform_code": "string", "stop_code": "string", "stop_desc": "string", "stop_id": "string", "stop_lat": "number", "stop_lon": "number", "stop_name": "string", "stop_url": "string", "wheelchair_boarding": "integer", "zone_id": "string"}}, "routes.parquet": {"description": "Transit routes (lines).", "fields": {"agency_id": "string", "route_color": "string", "route_desc": "string", "route_id": "string", "route_long_name": "string", "route_short_name": "string", "route_text_color": "string", "route_type": "integer", "route_url": "string"}}, "trips.parquet": {"description": "Individual trips per route.", "fields": {"bikes_allowed": "integer", "block_id": "string", "direction_id": "integer", "route_id": "string", "service_id": "string", "shape_id": "string", "trip_headsign": "string", "trip_id": "string", "trip_short_name": "string", "wheelchair_accessible": "integer"}}, "stop_times.parquet": {"description": "Arrival/departure times per stop per trip.", "fields": {"arrival_time": "duration (ms since service-day midnight)", "departure_time": "duration (ms since service-day midnight)", "drop_off_type": "integer", "pickup_type": "integer", "shape_dist_traveled": "number", "stop_headsign": "string", "stop_id": "string", "stop_sequence": "integer", "trip_id": "string"}}, "calendar.parquet": {"description": "Service days of the week.", "fields": {"end_date": "date", "friday": "integer", "monday": "integer", "saturday": "integer", "service_id": "string", "start_date": "date", "sunday": "integer", "thursday": "integer", "tuesday": "integer", "wednesday": "integer"}}, "calendar_dates.parquet": {"description": "Service exceptions (added/removed dates).", "fields": {"date": "date", "exception_type": "integer", "service_id": "string"}}, "transfers.parquet": {"description": "Transfer rules between stops or trips.", "fields": {"from_stop_id": "string", "min_transfer_time": "integer", "to_stop_id": "string", "transfer_type": "integer", "from_trip_id": "string", "to_trip_id": "string"}}, "translations.parquet": {"description": "Translations of stop names and other text.", "fields": {"table_name": "string", "field_name": "string", "record_id": "string", "record_sub_id": "string", "field_value": "string", "language": "string", "translation": "string"}}, "feed_info.parquet": {"description": "Feed publisher, languages and validity period.", "fields": {"feed_id": "string", "default_lang": "string", "feed_contact_email": "string", "feed_contact_url": "string", "feed_end_date": "date", "feed_lang": "string", "feed_publisher_name": "string", "feed_publisher_url": "string", "feed_start_date": "date", "feed_version": "string"}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install gtfs-parquet>=0.4.0\nimport requests\nimport tempfile\n\nfrom gtfs_parquet import read_parquet\nfrom gtfs_parquet.ops.network import describe\nfrom gtfs_parquet.ops.calendar import get_first_week, compute_busiest_date\nfrom gtfs_parquet.ops.routes import compute_route_stats\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/gtfs-parquet\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = read_parquet(f.name)\n\n# Quick summary of the feed\nprint(describe(feed))\n\n# Find the busiest date in the first week\nweek = get_first_week(feed)\nbusiest = compute_busiest_date(feed, week)\nprint(f\"Busiest date: {busiest}\")\n\n# Compute per-route statistics for that week\nroute_stats = compute_route_stats(feed, week)\nprint(route_stats.sort(\"num_trips\", descending=True))\n"}]}}, "/sncb/gtfs-realtime": {"get": {"summary": "GTFS-RT", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>SNCB's own GTFS-RT feed, as published, with every train.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:54:59</td></tr><tr><td>End date</td><td>2026-11-20 21:45:42</td></tr><tr><td>Count</td><td>3282367</td></tr></table>", "x-refresh": "Every 20 seconds", "x-description": "SNCB's own GTFS-RT feed, as published, with every train.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing trip updates only (delays, cancellations, skipped stops). The feed carries no vehicle positions and no alerts.", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "1.0", "incrementality": "FULL_DATASET", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier (the trip_id)", "trip_update": {"trip": {"trip_id": "GTFS trip identifier", "start_date": "Service date, YYYYMMDD", "start_time": "Scheduled departure of the trip, HH:MM:SS", "schedule_relationship": "CANCELED for a cancelled trip, otherwise omitted (SCHEDULED)"}, "stop_time_update[]": {"stop_id": "GTFS stop identifier (no stop_sequence is published)", "arrival": {"delay": "Delay in seconds (positive = late)", "time": "Predicted arrival Unix timestamp"}, "departure": {"delay": "Delay in seconds (positive = late)", "time": "Predicted departure Unix timestamp (absent at the last stop)"}, "schedule_relationship": "SKIPPED for a skipped stop, otherwise omitted (SCHEDULED)"}, "timestamp": "Unix timestamp of this update"}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/gtfs-realtime\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# The feed carries trip updates only: list cancelled trains and delays > 5 minutes\nfor entity in feed.entity:\n    tu = entity.trip_update\n    if tu.trip.schedule_relationship == gtfs_realtime_pb2.TripDescriptor.CANCELED:\n        print(f\"Trip {tu.trip.trip_id} cancelled\")\n        continue\n    for stu in tu.stop_time_update:\n        delay = stu.arrival.delay if stu.HasField('arrival') else 0\n        if delay > 300:\n            print(f\"Trip {tu.trip.trip_id} \u2014 {delay // 60}min late at stop {stu.stop_id}\")\n"}]}}, "/sncb/gtfs-rt-alert": {"get": {"summary": "GTFS-RT Alerts", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Real-time service alerts for SNCB/NMBS trains (delays, cancellations, disruptions).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 15 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:01:24</td></tr><tr><td>End date</td><td>2026-11-20 21:34:39</td></tr><tr><td>Count</td><td>18945</td></tr></table>", "x-refresh": "Every 15 minutes", "x-description": "Real-time service alerts for SNCB/NMBS trains (delays, cancellations, disruptions).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing service alerts.", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier", "alert": {"informed_entity[]": {"route_id": "Affected GTFS route", "trip": {"trip_id": "Affected trip (optional)"}, "stop_id": "Affected stop (optional)"}, "cause": "CONSTRUCTION | ACCIDENT | TECHNICAL_PROBLEM | STRIKE | ...", "effect": "NO_SERVICE | REDUCED_SERVICE | DETOUR | MODIFIED_SERVICE | ...", "header_text": {"translation[]": {"language": "en/fr/nl", "text": "Short alert summary"}}, "description_text": {"translation[]": {"language": "en/fr/nl", "text": "Detailed description"}}, "active_period[]": {"start": "Unix timestamp", "end": "Unix timestamp"}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/gtfs-rt-alert\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# Display all active service alerts\nfor entity in feed.entity:\n    alert = entity.alert\n    header = alert.header_text.translation[0].text if alert.header_text.translation else \"N/A\"\n    print(f\"[{alert.cause}] {header}\")   # SNCB alerts name the agency, not routes\n"}]}}, "/sncb/gtfs-rt-trip-update": {"get": {"summary": "GTFS-RT Trip updates", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Delays and cancellations of about a fifth of SNCB/NMBS trains, as re-published by the Belgian Mobility API. It keeps only the trips whose id matches its own SNCB timetable exactly (ids prefixed <code>gt:nmbssncb:</code>, each with its full stop list). For every train, use <b>gtfs-realtime</b>, straight from SNCB.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:00:46</td></tr><tr><td>End date</td><td>2026-11-20 21:45:38</td></tr><tr><td>Count</td><td>920405</td></tr></table>", "x-refresh": "Every 20 seconds", "x-description": "Delays and cancellations of about a fifth of SNCB/NMBS trains, as re-published by the Belgian Mobility API. It keeps only the trips whose id matches its own SNCB timetable exactly (ids prefixed <code>gt:nmbssncb:</code>, each with its full stop list). For every train, use <b>gtfs-realtime</b>, straight from SNCB.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing trip updates (delays, cancellations).", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier", "trip_update": {"trip": {"trip_id": "GTFS trip identifier", "route_id": "GTFS route identifier", "schedule_relationship": "SCHEDULED | ADDED | CANCELED"}, "stop_time_update[]": {"stop_id": "GTFS stop identifier", "stop_sequence": "Position of the stop in the trip", "arrival": {"delay": "Delay in seconds (positive = late)", "time": "Predicted arrival Unix timestamp"}, "departure": {"delay": "Delay in seconds (positive = late)", "time": "Predicted departure Unix timestamp"}, "schedule_relationship": "SCHEDULED | SKIPPED | NO_DATA"}, "timestamp": "Unix timestamp of this update"}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/gtfs-rt-trip-update\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# Show delayed trains (delay > 5 minutes)\nfor entity in feed.entity:\n    tu = entity.trip_update\n    for stu in tu.stop_time_update:\n        delay = stu.arrival.delay if stu.HasField('arrival') else 0\n        if delay > 300:\n            print(f\"Trip {tu.trip.trip_id} \u2014 {delay // 60}min late at stop {stu.stop_id}\")\n"}]}}, "/sncb/punctuality": {"get": {"summary": "Punctuality", "tags": ["SNCB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Daily punctuality table derived from SNCB/NMBS's GTFS-RT trip-update stream over a full Brussels-day window.\n\nEach row represents one (trip, stop) observation with the latest known arrival/departure times, delays, and schedule_relationship \u2014 plus a synthetic row per cancelled trip when the feed signals cancellation without stop-time entries.\n\nSingle Parquet file (zstd-compressed). Read with Polars, DuckDB or PyArrow. Trip ids are the realtime feed's: they lack the `gt:nmbssncb:` prefix of the published GTFS and often end with a different validity date, so join on the id without the prefix and without its last `:` component. From 2026-09-30, `route_id` is filled from the timetable where the trip matches (about 90%). `direction_id` and `stop_sequence` are always null: SNCB publishes neither, in realtime or in its timetable.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 00:00:00</td></tr><tr><td>End date</td><td>2026-11-20 00:00:00</td></tr><tr><td>Count</td><td>806</td></tr></table>", "x-refresh": "Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)", "x-description": "Daily punctuality table derived from SNCB/NMBS's GTFS-RT trip-update stream over a full Brussels-day window.\n\nEach row represents one (trip, stop) observation with the latest known arrival/departure times, delays, and schedule_relationship \u2014 plus a synthetic row per cancelled trip when the feed signals cancellation without stop-time entries.\n\nSingle Parquet file (zstd-compressed). Read with Polars, DuckDB or PyArrow. Trip ids are the realtime feed's: they lack the `gt:nmbssncb:` prefix of the published GTFS and often end with a different validity date, so join on the id without the prefix and without its last `:` component. From 2026-09-30, `route_id` is filled from the timetable where the trip matches (about 90%). `direction_id` and `stop_sequence` are always null: SNCB publishes neither, in realtime or in its timetable.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "Single Apache Parquet file (zstd-compressed) holding one day of punctuality observations derived from the GTFS-RT trip-update stream. One row per (trip_id, start_date, start_time, stop_sequence, stop_id) observation, plus one synthetic row per cancelled trip-instance when the feed signals cancellation without stop-time entries.", "type": "string", "format": "binary", "x-parquet-schema": {"trip_id": {"type": "string", "description": "GTFS trip identifier as published in the realtime feed (no `gt:<feed>:` prefix)."}, "start_date": {"type": "string", "description": "Service date in YYYYMMDD (operator local), identifies the trip-instance together with trip_id and start_time."}, "start_time": {"type": "string", "description": "Trip start time in HH:MM:SS (operator local). May be empty if the feed omits it."}, "stop_sequence": {"type": "integer", "description": "Stop position within the trip. Null when the feed does not publish a sequence (e.g. SNCB) or for a cancelled-trip synthetic row."}, "stop_id": {"type": "string", "description": "GTFS stop identifier (no `gs:<feed>:` prefix). Null for a cancelled-trip synthetic row."}, "route_id": {"type": "string", "description": "GTFS route identifier; empty when not provided by the feed."}, "direction_id": {"type": "integer", "description": "Always null for SNCB/NMBS, which publishes no direction: the GTFS-RT has none and direction_id is empty in the GTFS."}, "trip_schedule_relationship": {"type": "integer", "description": "GTFS-RT TripDescriptor.ScheduleRelationship: 0 SCHEDULED, 1 ADDED, 2 UNSCHEDULED, 3 CANCELED, 4 REPLACEMENT, 5 DUPLICATED, 6 DELETED."}, "arrival_time": {"type": "string", "format": "date-time", "description": "Latest known actual arrival timestamp (UTC). Null if the feed only publishes delays."}, "arrival_delay": {"type": "integer", "description": "Latest known arrival delay in seconds (positive = late). Null when the feed has no delay info for this stop."}, "departure_time": {"type": "string", "format": "date-time", "description": "Latest known actual departure timestamp (UTC). Null if the feed only publishes delays."}, "departure_delay": {"type": "integer", "description": "Latest known departure delay in seconds. Null when the feed has no delay info."}, "stop_schedule_relationship": {"type": "integer", "description": "GTFS-RT StopTimeUpdate.ScheduleRelationship: 0 SCHEDULED, 1 SKIPPED, 2 NO_DATA, 3 UNSCHEDULED."}, "cancelled": {"type": "boolean", "description": "True when the trip is CANCELED at trip level or the stop is SKIPPED at stop level."}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install polars requests\nimport io\nimport requests\nimport polars as pl\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\"timestamp\": yesterday_noon.isoformat()}\n\nurl = \"https://api.mobilitytwin.brussels/sncb/punctuality\"\ndata = requests.get(url, headers={\n    \"Authorization\": \"Bearer [MY_API_KEY]\"\n}, params=params).content\n\ndf = pl.read_parquet(io.BytesIO(data))\nprint(f\"rows: {df.height:,}\")\n\n# Note: SNCB's GTFS-RT feed does not populate stop_sequence (always null).\n# Join to static GTFS on stop_id when needed.\nnot_cancelled = df.filter(~pl.col(\"cancelled\") & pl.col(\"arrival_delay\").is_not_null())\n\n# Trains with the largest arrival delays, and where they were observed.\nprint(\"\\nTop 20 worst delays of the day:\")\nprint(not_cancelled.sort(\"arrival_delay\", descending=True)\n      .select([\"trip_id\", \"stop_id\", \"arrival_time\", \"arrival_delay\"])\n      .head(20))\n\n# Cancellation rate per route (one row per cancelled trip).\ncancelled = df.filter(pl.col(\"cancelled\"))\nprint(f\"\\ncancelled trip-instances: \"\n      f\"{cancelled.select(['trip_id', 'start_date', 'start_time']).unique().height}\")\nprint(\"\\nMost-cancelled routes:\")\nprint(cancelled.group_by(\"route_id\").len()\n      .sort(\"len\", descending=True).head(10))\n"}]}}, "/infrabel/line-sections": {"get": {"summary": "Line sections", "tags": ["INFRABEL"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The rail network split into line sections, with each section's route and technical characteristics. Join it with <b>operational-points</b>, which locates the start and end point of each section.\n\nMeant for schematic maps, up to a scale of 1:25,000. Source: <a href=\"https://opendata.infrabel.be/explore/dataset/lijnsecties/information\">Infrabel open data</a>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:52:32</td></tr><tr><td>End date</td><td>2026-11-20 03:20:05</td></tr><tr><td>Count</td><td>707</td></tr></table>", "x-refresh": "Daily", "x-description": "The rail network split into line sections, with each section's route and technical characteristics. Join it with <b>operational-points</b>, which locates the start and end point of each section.\n\nMeant for schematic maps, up to a scale of 1:25,000. Source: <a href=\"https://opendata.infrabel.be/explore/dataset/lijnsecties/information\">Infrabel open data</a>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"anyOf": [{"type": "null"}, {"properties": {"coordinates": {"anyOf": [{"type": "array", "items": {"type": "number"}, "description": "A Point (a few sections are published as one)"}, {"items": {"items": {"anyOf": [{"type": "number"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "array"}, "type": "array"}]}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}]}, "properties": {"properties": {"etat": {"type": "string"}, "geo_point_2d": {"anyOf": [{"type": "null"}, {"properties": {"lat": {"type": "number"}, "lon": {"type": "number"}}, "required": ["lat", "lon"], "type": "object"}]}, "geo_shape": {"type": "null"}, "id": {"type": "string"}, "linecalfa": {"type": "string"}, "linecnum": {"type": ["integer", "null"]}, "modifdate": {"type": "string"}, "trackcode": {"type": "string"}, "trackname": {"type": "string"}}, "required": ["etat", "geo_point_2d", "id", "linecalfa", "linecnum", "modifdate", "trackcode", "trackname"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/infrabel/line-sections\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"], crs=4326)\n\n# Plot the Belgian rail network\ngdf.plot(figsize=(12, 10), linewidth=0.5, color=\"darkblue\")\n\n# Compute total network length\ngdf['length_km'] = gdf.to_crs(31370).geometry.length / 1000   # metres need a projected CRS (Belgian Lambert 72)\nprint(f\"Total rail network: {gdf['length_km'].sum():.0f} km\")"}]}}, "/infrabel/operational-points": {"get": {"summary": "Operational points", "tags": ["INFRABEL"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The operational points of the Belgian rail network: the start and end points of the <b>line-sections</b>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:52:54</td></tr><tr><td>End date</td><td>2026-11-20 02:15:01</td></tr><tr><td>Count</td><td>707</td></tr></table>", "x-refresh": "Daily", "x-description": "The operational points of the Belgian rail network: the start and end points of the <b>line-sections</b>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "properties": {"properties": {"class_fr": {"type": "string"}, "commerciallongnamedutch": {"type": "string"}, "commerciallongnamefrench": {"type": "string"}, "commercialmiddlenamedutch": {"type": "string"}, "commercialmiddlenamefrench": {"type": "string"}, "commercialshortnamedutch": {"type": "string"}, "commercialshortnamefrench": {"type": "string"}, "geo_point_2d": {"properties": {"lat": {"type": "number"}, "lon": {"type": "number"}}, "required": ["lat", "lon"], "type": "object"}, "longnamedutch": {"type": "string"}, "longnamefrench": {"type": "string"}, "ptcarid": {"type": "string"}, "shortnamedutch": {"type": "string"}, "shortnamefrench": {"type": "string"}, "symbolicname": {"type": "string"}, "taftapcode": {"type": "string"}}, "required": ["class_fr", "commerciallongnamedutch", "commerciallongnamefrench", "commercialmiddlenamedutch", "commercialmiddlenamefrench", "commercialshortnamedutch", "commercialshortnamefrench", "geo_point_2d", "longnamedutch", "longnamefrench", "ptcarid", "shortnamedutch", "shortnamefrench", "symbolicname", "taftapcode"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/infrabel/operational-points\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Filter only stations (class_fr \"Gare\")\nstations = gdf[gdf['class_fr'] == 'Gare']\nprint(f\"Total stations: {len(stations)}\")\nfor _, s in stations.head(10).iterrows():\n    print(f\"  {s['commerciallongnamefrench']} ({s['symbolicname']})\")\n\n# Plot all operational points\ngdf.plot(figsize=(10, 8), markersize=5, color=\"navy\")"}]}}, "/infrabel/punctuality": {"get": {"summary": "Punctuality", "tags": ["INFRABEL"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Infrabel's raw punctuality data: every stop of every train on one day, with its planned and actual arrival and departure. A file holds the trains of one day, given by <code>datdep</code>, and is stored at 06:00 UTC the next day: for day D, request any timestamp on D+1 after 06:00 UTC. Some days are missing (Infrabel outages, e.g. 2026-05-26 to 2026-06-23); a request for such a day returns an earlier file or an empty one, so check <code>datdep</code>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 08:00:00</td></tr><tr><td>End date</td><td>2026-11-20 07:16:43</td></tr><tr><td>Count</td><td>759</td></tr></table>", "x-refresh": "Daily", "x-description": "Infrabel's raw punctuality data: every stop of every train on one day, with its planned and actual arrival and departure. A file holds the trains of one day, given by <code>datdep</code>, and is stored at 06:00 UTC the next day: for day D, request any timestamp on D+1 after 06:00 UTC. Some days are missing (Infrabel outages, e.g. 2026-05-26 to 2026-06-23); a request for such a day returns an earlier file or an empty one, so check <code>datdep</code>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"items": {"properties": {"datdep": {"type": "string"}, "delay_arr": {"type": ["integer", "null"]}, "delay_dep": {"type": ["integer", "null"]}, "line_no_arr": {"type": ["null", "string"]}, "line_no_dep": {"type": ["null", "string"]}, "planned_date_arr": {"type": ["null", "string"]}, "planned_date_dep": {"type": ["null", "string"]}, "planned_time_arr": {"type": ["null", "string"]}, "planned_time_dep": {"type": ["null", "string"]}, "ptcar_lg_nm_nl": {"type": "string"}, "real_date_arr": {"type": ["null", "string"]}, "real_date_dep": {"type": ["null", "string"]}, "real_time_arr": {"type": ["null", "string"]}, "real_time_dep": {"type": ["null", "string"]}, "relation": {"type": "string"}, "relation_direction": {"type": ["null", "string"]}, "train_no": {"type": "string"}, "train_serv": {"type": "string"}}, "required": ["datdep", "delay_arr", "delay_dep", "line_no_arr", "line_no_dep", "planned_date_arr", "planned_date_dep", "planned_time_arr", "planned_time_dep", "ptcar_lg_nm_nl", "real_date_arr", "real_date_dep", "real_time_arr", "real_time_dep", "relation", "relation_direction", "train_no", "train_serv"], "type": "object"}, "type": "array"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, time, timedelta, timezone\n\nday = datetime.now(timezone.utc).date() - timedelta(days=2)   # the day you want\n# The trains of day D are stored at 06:00 UTC on D+1\nparams = {\n    \"timestamp\": datetime.combine(day + timedelta(days=1), time(12), timezone.utc).isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/infrabel/punctuality\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ndf = pd.DataFrame(data)\nassert df['datdep'].iloc[0] == day.isoformat()   # a missing day returns an earlier file\n\n# Compute delay statistics\ndf['delay_min'] = df['delay_arr'] / 60   # seconds late at arrival\navg_delay = df['delay_min'].mean()\nlate_trains = df[df['delay_min'] > 5]\nprint(f\"Average delay: {avg_delay:.1f} min\")\nprint(f\"Trains >5min late: {len(late_trains)} / {len(df)}\")\n\n# Most delayed stations\nworst = df.groupby('ptcar_lg_nm_nl')['delay_min'].mean().nlargest(10)\nprint(\"\\nMost delayed stations:\")\nprint(worst)"}]}}, "/infrabel/segments": {"get": {"summary": "Segments", "tags": ["INFRABEL"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The route of every railway track on the Infrabel network, not only the main tracks with a line number.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:52:55</td></tr><tr><td>End date</td><td>2026-11-20 02:45:04</td></tr><tr><td>Count</td><td>705</td></tr></table>", "x-refresh": "Daily", "x-description": "The route of every railway track on the Infrabel network, not only the main tracks with a line number.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "properties": {"properties": {"geo_point_2d": {"properties": {"lat": {"type": "number"}, "lon": {"type": "number"}}, "required": ["lat", "lon"], "type": "object"}, "length": {"type": "number"}, "stationfrom_id": {"type": "string"}, "stationfrom_name": {"type": "string"}, "stationto_id": {"type": "string"}, "stationto_name": {"type": "string"}}, "required": ["geo_point_2d", "length", "stationfrom_id", "stationfrom_name", "stationto_id", "stationto_name"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/infrabel/segments\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Segment lengths are given in km\ngdf['segment'] = gdf['stationfrom_name'] + ' \u2013 ' + gdf['stationto_name']\n\n# Show longest segments\nlongest = gdf.nlargest(5, 'length')[['segment', 'length']]\nprint(\"Longest rail segments:\")\nprint(longest)\n\n# Plot the full railway network\ngdf.plot(figsize=(12, 10), linewidth=0.5, color=\"gray\")"}]}}, "/stib/gtfs": {"get": {"summary": "GTFS", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The STIB/MIVB timetable as a standard GTFS zip.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-04-05 06:20:01</td></tr><tr><td>End date</td><td>2026-11-20 05:20:01</td></tr><tr><td>Count</td><td>707</td></tr></table>", "x-refresh": "Daily", "x-description": "The STIB/MIVB timetable as a standard GTFS zip.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "GTFS (General Transit Feed Specification) ZIP archive containing the following CSV files:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.txt": {"description": "Transit agency information (STIB/MIVB).", "fields": ["agency_id", "agency_name", "agency_url", "agency_timezone", "agency_lang", "agency_phone"]}, "routes.txt": {"description": "Transit routes (metro, tram, bus lines).", "fields": ["route_id", "agency_id", "route_short_name", "route_long_name", "route_type", "route_color", "route_text_color"]}, "trips.txt": {"description": "Individual trips per route.", "fields": ["route_id", "service_id", "trip_id", "trip_headsign", "direction_id", "block_id", "shape_id"]}, "stops.txt": {"description": "Stop/station locations.", "fields": ["stop_id", "stop_name", "stop_lat", "stop_lon", "location_type", "parent_station"]}, "stop_times.txt": {"description": "Arrival/departure times per stop per trip.", "fields": ["trip_id", "arrival_time", "departure_time", "stop_id", "stop_sequence", "pickup_type", "drop_off_type"]}, "calendar.txt": {"description": "Service days of the week.", "fields": ["service_id", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "start_date", "end_date"]}, "calendar_dates.txt": {"description": "Service exceptions (added/removed dates).", "fields": ["service_id", "date", "exception_type"]}, "shapes.txt": {"description": "Geospatial shape of each route variant.", "fields": ["shape_id", "shape_pt_lat", "shape_pt_lon", "shape_pt_sequence", "shape_dist_traveled"]}, "translations.txt": {"description": "Translations of stop names and other text (French/Dutch).", "fields": ["trans_id", "lang", "translation"]}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import gtfs_kit as gk\nimport requests\nimport tempfile\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/gtfs\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = gk.read_feed(f.name, 'm')\n\n# Explore the STIB schedule\nprint(f\"Routes: {len(feed.routes)}\")\nprint(f\"Stops: {len(feed.stops)}\")\nprint(f\"Trips: {len(feed.trips)}\")\nprint(\"\\nRoutes:\")\nprint(feed.routes[['route_short_name', 'route_long_name', 'route_type']])"}]}}, "/stib/gtfs-parquet": {"get": {"summary": "GTFS (Parquet)", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The STIB/MIVB timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (regenerated from the GTFS feed)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-04-05 06:20:01</td></tr><tr><td>End date</td><td>2026-11-20 05:20:01</td></tr><tr><td>Count</td><td>808</td></tr></table>", "x-refresh": "Daily (regenerated from the GTFS feed)", "x-description": "The STIB/MIVB timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "ZIP archive of Apache Parquet files (zstd-compressed), one per GTFS file of the day's GTFS feed, with typed columns: identifiers and text as strings, enumerations as integers, dates as Parquet dates, and stop_times arrival_time/departure_time as durations since service-day midnight (may exceed 24h). The archive contains:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.parquet": {"description": "Transit agency information.", "fields": {"agency_id": "string", "agency_name": "string", "agency_url": "string", "agency_timezone": "string", "agency_lang": "string", "agency_phone": "string"}}, "stops.parquet": {"description": "Stop/station locations.", "fields": {"stop_id": "string", "stop_code": "string", "stop_name": "string", "stop_desc": "string", "stop_lat": "number", "stop_lon": "number", "zone_id": "string", "stop_url": "string", "location_type": "integer", "parent_station": "string", "wheelchair_boarding": "integer"}}, "routes.parquet": {"description": "Transit routes (lines).", "fields": {"route_id": "string", "agency_id": "string", "route_short_name": "string", "route_long_name": "string", "route_desc": "string", "route_type": "integer", "route_url": "string", "route_color": "string", "route_text_color": "string"}}, "trips.parquet": {"description": "Individual trips per route.", "fields": {"route_id": "string", "service_id": "string", "trip_id": "string", "trip_headsign": "string", "direction_id": "integer", "block_id": "string", "shape_id": "string", "wheelchair_accessible": "integer"}}, "stop_times.parquet": {"description": "Arrival/departure times per stop per trip.", "fields": {"trip_id": "string", "arrival_time": "duration (ms since service-day midnight)", "departure_time": "duration (ms since service-day midnight)", "stop_id": "string", "stop_sequence": "integer", "pickup_type": "integer", "drop_off_type": "integer", "timepoint": "integer"}}, "calendar.parquet": {"description": "Service days of the week.", "fields": {"service_id": "string", "monday": "integer", "tuesday": "integer", "wednesday": "integer", "thursday": "integer", "friday": "integer", "saturday": "integer", "sunday": "integer", "start_date": "date", "end_date": "date"}}, "calendar_dates.parquet": {"description": "Service exceptions (added/removed dates).", "fields": {"service_id": "string", "date": "date", "exception_type": "integer"}}, "shapes.parquet": {"description": "Geospatial shape of each route variant.", "fields": {"shape_id": "string", "shape_pt_lat": "number", "shape_pt_lon": "number", "shape_pt_sequence": "integer", "shape_dist_traveled": "number"}}, "translations.parquet": {"description": "Translations of stop names and other text.", "fields": {"table_name": "string", "field_name": "string", "language": "string", "translation": "string", "field_value": "string"}}, "feed_info.parquet": {"description": "Feed publisher, languages and validity period.", "fields": {"feed_publisher_name": "string", "feed_publisher_url": "string", "feed_lang": "string", "feed_start_date": "date", "feed_end_date": "date", "feed_version": "string", "feed_contact_email": "string"}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install gtfs-parquet>=0.4.0\nimport requests\nimport tempfile\n\nfrom gtfs_parquet import read_parquet\nfrom gtfs_parquet.ops.network import describe\nfrom gtfs_parquet.ops.calendar import get_first_week, compute_busiest_date\nfrom gtfs_parquet.ops.routes import compute_route_stats\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/gtfs-parquet\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = read_parquet(f.name)\n\n# Quick summary of the feed\nprint(describe(feed))\n\n# Find the busiest date in the first week\nweek = get_first_week(feed)\nbusiest = compute_busiest_date(feed, week)\nprint(f\"Busiest date: {busiest}\")\n\n# Compute per-route statistics for that week\nroute_stats = compute_route_stats(feed, week)\nprint(route_stats.sort(\"num_trips\", descending=True))\n"}]}}, "/stib/segments": {"get": {"summary": "Segments", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The STIB/MIVB network cut into segments, derived from the shapefile and the stops.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (derived from the STIB shapefile and stops)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:48:24</td></tr><tr><td>End date</td><td>2026-11-20 04:20:00</td></tr><tr><td>Count</td><td>777</td></tr></table>", "x-refresh": "Daily (derived from the STIB shapefile and stops)", "x-description": "The STIB/MIVB network cut into segments, derived from the shapefile and the stops.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"type": "object", "description": "GeoJSON FeatureCollection with one LineString per pair of consecutive stops, per line and direction, cut from the STIB shapefile.", "properties": {"type": {"type": "string", "example": "FeatureCollection"}, "features": {"type": "array", "items": {"type": "object", "properties": {"type": {"type": "string", "example": "Feature"}, "id": {"type": "string", "description": "The start stop id as a string. Not unique: a stop served by several lines starts several segments.", "example": "8161"}, "geometry": {"type": "object", "properties": {"type": {"type": "string", "example": "LineString"}, "coordinates": {"type": "array", "description": "[longitude, latitude] pairs (WGS84) from the start stop to the end stop.", "items": {"type": "array", "items": {"type": "number"}}}}, "required": ["coordinates", "type"]}, "properties": {"type": "object", "properties": {"line_id": {"type": "string", "description": "STIB line number (GTFS route_short_name)", "example": "1"}, "direction": {"type": "integer", "description": "Direction of the line, 1 or 2", "example": 1}, "start": {"type": "integer", "description": "Stop id where the segment starts", "example": 8161}, "end": {"type": "integer", "description": "Stop id where the segment ends", "example": 8151}, "distance": {"type": "number", "description": "Position of the start stop along the line's shape, projected in Belgian Lambert 72 (EPSG:31370), increasing along the direction of travel. Use it to order the segments of a line; it is not the length of the segment.", "example": 1334.56}, "color": {"type": "string", "description": "Line colour, hex", "example": "#B5378C"}}, "required": ["line_id", "direction", "start", "end", "distance", "color"]}}, "required": ["geometry", "id", "properties", "type"]}}}, "required": ["features", "type"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/segments\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"], crs=4326)\n\n# One stop-to-stop segment per feature; `distance` orders them along the line\nline = gdf[(gdf['line_id'] == '71') & (gdf['direction'] == 1)].sort_values('distance')\nline['length_m'] = line.to_crs(31370).geometry.length   # Belgian Lambert 72, metres\nprint(line[['start', 'end', 'length_m']].round(0).to_string(index=False))\n\n# Plot the whole network in the lines' own colours\ngdf.plot(figsize=(12, 10), color=gdf['color'], linewidth=1)\n"}]}}, "/stib/stops": {"get": {"summary": "Stops", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>STIB/MIVB stops, cleaned and enriched from <b>stops-by-line</b> and <b>stop-details</b>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (derived from stops-by-line and stop-details)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:48:23</td></tr><tr><td>End date</td><td>2026-11-20 01:20:00</td></tr><tr><td>Count</td><td>290</td></tr></table>", "x-refresh": "Daily (derived from stops-by-line and stop-details)", "x-description": "STIB/MIVB stops, cleaned and enriched from <b>stops-by-line</b> and <b>stop-details</b>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"direction": {"type": "integer"}, "direction_id": {"type": "string"}, "route_short_name": {"type": "string"}, "stop_id": {"type": "integer"}, "stop_lat": {"type": "number"}, "stop_lon": {"type": "number"}, "stop_name": {"type": "string"}, "stop_sequence": {"type": "integer"}}, "required": ["direction", "direction_id", "route_short_name", "stop_id", "stop_lat", "stop_lon", "stop_name", "stop_sequence"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/stops\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# List stops for a specific line\nline = \"1\"\nline_stops = gdf[gdf['route_short_name'] == line].sort_values('stop_sequence')\nprint(f\"Stops on line {line}:\")\nfor _, stop in line_stops.iterrows():\n    print(f\"  {stop['stop_sequence']}. {stop['stop_name']}\")\n\n# Plot all stops on a map\ngdf.plot(figsize=(10, 8), markersize=3, color=\"red\")"}]}}, "/stib/vehicle-distance": {"get": {"summary": "Vehicle distance", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Raw STIB/MIVB positions as published: each vehicle's distance since its last stop, with no vehicle or trip id. For long time ranges, download Parquet files from <code>/stib/vehicle-distance/parquet</code>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2023-02-24 17:55:46</td></tr><tr><td>End date</td><td>2026-11-20 21:45:31</td></tr><tr><td>Count</td><td>5093864</td></tr></table>", "x-refresh": "Every 20 seconds", "x-description": "Raw STIB/MIVB positions as published: each vehicle's distance since its last stop, with no vehicle or trip id. For long time ranges, download Parquet files from <code>/stib/vehicle-distance/parquet</code>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}, {"description": "Start of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}, {"description": "Maximum number of snapshots, at most 100.", "schema": {"type": "integer"}, "in": "query", "name": "limit"}, {"description": "Number of snapshots to skip, to page through a range.", "schema": {"type": "integer"}, "in": "query", "name": "offset"}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"items": {"properties": {"directionId": {"type": "string"}, "distanceFromPoint": {"type": "integer"}, "lineId": {"type": "string"}, "pointId": {"type": "string"}}, "required": ["directionId", "distanceFromPoint", "lineId", "pointId"], "type": "object"}, "type": "array"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/vehicle-distance\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Convert to DataFrame for analysis\ndf = pd.DataFrame(data)\n\n# Group by line and compute average distance from stop\navg_distance = df.groupby('lineId')['distanceFromPoint'].mean()\nprint(\"Average distance from stop per line:\")\nprint(avg_distance.sort_values(ascending=False))"}]}}, "/stib/vehicle-trip": {"get": {"summary": "Vehicle position", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Every STIB/MIVB vehicle on the road, every 20 seconds, with the GTFS trip it is running and its delay.\n\nSTIB's real-time API gives each vehicle's position on its line. This endpoint tracks each vehicle from poll to poll under the constraint that vehicles on a line do not overtake each other, reads its stop calls as they happen, and pairs the vehicles on the road with the timetabled trips that could be running by the smallest total deviation between observed and scheduled times. It is the live form of the method behind the <code>punctuality</code> table.\n\nEach feature carries <code>uuid</code> (stable for as long as the vehicle is tracked on one run), <code>lineId</code>, <code>directionId</code> (the destination stop), <code>direction</code> (GTFS <code>direction_id</code>), <code>pointId</code> and <code>distanceFromPoint</code>, <code>routeId</code>, and where a trip was established <code>tripId</code>, <code>startDate</code>, <code>startTime</code>, <code>delay</code> (seconds late at the last stop called at, negative when early), <code>stopId</code> and <code>stopSequence</code> (the stop the vehicle is at or heading to) and <code>status</code> (<code>STOPPED_AT</code> or <code>IN_TRANSIT_TO</code>).\n\nA vehicle gets its trip after its second stop call, about a minute after leaving its first stop; a vehicle still waiting at its first stop has none, since which waiting vehicle makes the next departure is not knowable from the feed. Measured over a full replayed day, 91% of the vehicles that had left their first stop carried a trip, and 93% of those trips were the ones the daily method assigns with the whole day in hand (88% at the morning peak, 97% off-peak). For long time ranges, download Parquet files from <code>/stib/vehicle-trip/parquet</code>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds (computed from vehicle-distance)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-04-05 06:21:16</td></tr><tr><td>End date</td><td>2026-11-20 21:45:10</td></tr><tr><td>Count</td><td>3598556</td></tr></table>", "x-refresh": "Every 20 seconds (computed from vehicle-distance)", "x-description": "Every STIB/MIVB vehicle on the road, every 20 seconds, with the GTFS trip it is running and its delay.\n\nSTIB's real-time API gives each vehicle's position on its line. This endpoint tracks each vehicle from poll to poll under the constraint that vehicles on a line do not overtake each other, reads its stop calls as they happen, and pairs the vehicles on the road with the timetabled trips that could be running by the smallest total deviation between observed and scheduled times. It is the live form of the method behind the <code>punctuality</code> table.\n\nEach feature carries <code>uuid</code> (stable for as long as the vehicle is tracked on one run), <code>lineId</code>, <code>directionId</code> (the destination stop), <code>direction</code> (GTFS <code>direction_id</code>), <code>pointId</code> and <code>distanceFromPoint</code>, <code>routeId</code>, and where a trip was established <code>tripId</code>, <code>startDate</code>, <code>startTime</code>, <code>delay</code> (seconds late at the last stop called at, negative when early), <code>stopId</code> and <code>stopSequence</code> (the stop the vehicle is at or heading to) and <code>status</code> (<code>STOPPED_AT</code> or <code>IN_TRANSIT_TO</code>).\n\nA vehicle gets its trip after its second stop call, about a minute after leaving its first stop; a vehicle still waiting at its first stop has none, since which waiting vehicle makes the next departure is not knowable from the feed. Measured over a full replayed day, 91% of the vehicles that had left their first stop carried a trip, and 93% of those trips were the ones the daily method assigns with the whole day in hand (88% at the morning peak, 97% off-peak). For long time ranges, download Parquet files from <code>/stib/vehicle-trip/parquet</code>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"type": "object", "properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"type": {"type": "string"}, "id": {"type": "string"}, "geometry": {"type": "object", "properties": {"type": {"type": "string"}, "coordinates": {"type": "array", "items": {"type": "number"}}}, "required": ["coordinates", "type"]}, "properties": {"type": "object", "properties": {"uuid": {"type": "string", "description": "Tracking uuid, stable for as long as the vehicle is tracked on one run. Same value as the feature id."}, "lineId": {"type": "string", "description": "STIB line number (GTFS route_short_name)"}, "directionId": {"type": "string", "description": "Destination stop id as reported by STIB"}, "direction": {"type": "integer", "description": "GTFS direction_id"}, "pointId": {"type": "string", "description": "Stop point last passed, as reported by STIB"}, "distanceFromPoint": {"type": "number", "description": "Metres past pointId"}, "color": {"type": ["string", "null"], "description": "Line colour from the GTFS routes"}, "routeId": {"type": ["string", "null"], "description": "GTFS route_id"}, "timestamp": {"type": "number", "description": "Unix timestamp of the poll"}, "tripId": {"type": ["string", "null"], "description": "GTFS trip_id, null until established (after the vehicle's second stop call)"}, "startDate": {"type": ["string", "null"], "description": "Service date of the trip, YYYYMMDD"}, "startTime": {"type": ["string", "null"], "description": "Scheduled departure of the trip, HH:MM:SS (may exceed 24:00)"}, "delay": {"type": ["integer", "null"], "description": "Seconds late at the last stop called at; negative when early"}, "status": {"type": ["string", "null"], "description": "STOPPED_AT or IN_TRANSIT_TO; null on the metro (lines 1, 2, 5, 6), whose feed gives the station but no distance, so standing and running cannot be told apart"}, "stopId": {"type": ["string", "null"], "description": "GTFS stop_id the vehicle is at or heading to"}, "stopSequence": {"type": ["integer", "null"], "description": "stop_sequence of that stop in the trip"}}, "required": ["uuid", "lineId", "direction", "pointId", "distanceFromPoint", "timestamp", "status"]}}, "required": ["type", "id", "geometry", "properties"]}}}, "required": ["type", "features"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\n\nurl = \"https://api.mobilitytwin.brussels/stib/vehicle-trip\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}).json()\n\n# Every vehicle on the road, with its GTFS trip and delay where established\nfor feature in data[\"features\"]:\n    p = feature[\"properties\"]\n    if p[\"tripId\"]:\n        print(f\"Line {p['lineId']} trip {p['tripId']} ({p['startTime']}): \"\n              f\"{p['delay']:+d} s, {p['status']} stop {p['stopId']}\")\n    else:\n        print(f\"Line {p['lineId']} vehicle {p['uuid'][:8]}: no trip yet\")\n"}]}}, "/stib/gtfs-rt-vehicle-position": {"get": {"summary": "GTFS-RT Vehicle positions", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>STIB/MIVB vehicle positions as a standard GTFS Realtime feed, built from <code>vehicle-trip</code>. Produced by MobilityTwin.Brussels, not an official STIB feed.\n\nOne <code>VehiclePosition</code> per vehicle, with <code>trip_id</code>, <code>start_date</code> and <code>start_time</code> where the trip was established, and otherwise only <code>route_id</code> and <code>direction_id</code>. <code>vehicle.id</code> is the tracking uuid, stable for one run. IDs match the <code>gtfs</code> endpoint of the same day.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>On request, from the latest vehicle-trip snapshot (every 20 seconds)</span></div><h4>Data information</h4><p>No information available for this component. The availability of this component is dependent on its source data.", "x-refresh": "On request, from the latest vehicle-trip snapshot (every 20 seconds)", "x-description": "STIB/MIVB vehicle positions as a standard GTFS Realtime feed, built from <code>vehicle-trip</code>. Produced by MobilityTwin.Brussels, not an official STIB feed.\n\nOne <code>VehiclePosition</code> per vehicle, with <code>trip_id</code>, <code>start_date</code> and <code>start_time</code> where the trip was established, and otherwise only <code>route_id</code> and <code>direction_id</code>. <code>vehicle.id</code> is the tracking uuid, stable for one run. IDs match the <code>gtfs</code> endpoint of the same day.", "parameters": [{"description": "Start of the range, in Unix seconds or ISO 8601. Without any timestamp, the last hour is used; with only one, the hour starting or ending at it.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary with the positions of STIB/MIVB vehicles, reconstructed by MobilityTwin.Brussels (STIB publishes no GTFS-RT).", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "incrementality": "FULL_DATASET", "timestamp": "Unix timestamp of the poll"}, "entity[]": {"id": "Tracking uuid of the vehicle", "vehicle": {"trip": {"trip_id": "GTFS trip identifier (empty when not yet established)", "start_date": "Service date, YYYYMMDD", "start_time": "Scheduled departure of the trip, HH:MM:SS (may exceed 24:00)", "route_id": "GTFS route identifier", "direction_id": "GTFS direction_id", "schedule_relationship": "SCHEDULED"}, "vehicle": {"id": "Tracking uuid, stable for one run", "label": "Line number"}, "position": {"latitude": "WGS84 latitude", "longitude": "WGS84 longitude"}, "stop_id": "GTFS stop the vehicle is at or heading to", "current_stop_sequence": "stop_sequence of that stop in the trip", "current_status": "STOPPED_AT | IN_TRANSIT_TO", "timestamp": "Unix timestamp of this position"}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nurl = \"https://api.mobilitytwin.brussels/stib/gtfs-rt-vehicle-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# List all vehicle positions (trip_id is empty for a vehicle not yet matched)\nfor entity in feed.entity:\n    v = entity.vehicle\n    print(f\"Route {v.trip.route_id} trip {v.trip.trip_id or '-'}: \"\n          f\"({v.position.latitude:.4f}, {v.position.longitude:.4f}), \"\n          f\"stop {v.stop_id or '-'} seq {v.current_stop_sequence}\")\n"}]}}, "/stib/gtfs-rt-trip-update": {"get": {"summary": "GTFS-RT Trip updates", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Predicted arrivals for STIB/MIVB as a standard GTFS Realtime feed, built from <code>vehicle-trip</code>. Produced by MobilityTwin.Brussels, not an official STIB feed.\n\nOne <code>TripUpdate</code> per trip that has a vehicle on it: the delay measured at the last stop the vehicle called at is applied to every stop still ahead of it (<code>arrival</code> and <code>departure</code> carry both <code>delay</code> and absolute <code>time</code>). Trips with no vehicle on them are left out rather than declared on time, and there are no cancellations: the source has no signal for them.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>On request, from the latest vehicle-trip snapshot (every 20 seconds)</span></div><h4>Data information</h4><p>No information available for this component. The availability of this component is dependent on its source data.", "x-refresh": "On request, from the latest vehicle-trip snapshot (every 20 seconds)", "x-description": "Predicted arrivals for STIB/MIVB as a standard GTFS Realtime feed, built from <code>vehicle-trip</code>. Produced by MobilityTwin.Brussels, not an official STIB feed.\n\nOne <code>TripUpdate</code> per trip that has a vehicle on it: the delay measured at the last stop the vehicle called at is applied to every stop still ahead of it (<code>arrival</code> and <code>departure</code> carry both <code>delay</code> and absolute <code>time</code>). Trips with no vehicle on them are left out rather than declared on time, and there are no cancellations: the source has no signal for them.", "parameters": [{"description": "Start of the range, in Unix seconds or ISO 8601. Without any timestamp, the last hour is used; with only one, the hour starting or ending at it.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary with predicted arrivals for STIB/MIVB trips that have a vehicle on them, reconstructed by MobilityTwin.Brussels (STIB publishes no GTFS-RT).", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "incrementality": "FULL_DATASET", "timestamp": "Unix timestamp of the poll"}, "entity[]": {"id": "trip_id-start_date", "trip_update": {"trip": {"trip_id": "GTFS trip identifier", "start_date": "Service date, YYYYMMDD", "start_time": "HH:MM:SS", "route_id": "GTFS route identifier", "direction_id": "GTFS direction_id", "schedule_relationship": "SCHEDULED"}, "vehicle": {"id": "Tracking uuid of the vehicle running the trip", "label": "Line number"}, "delay": "Seconds late at the last stop called at (negative = early)", "timestamp": "Unix timestamp of the measurement", "stop_time_update[]": {"stop_sequence": "GTFS stop_sequence", "stop_id": "GTFS stop identifier", "arrival": {"delay": "Delay in seconds (positive = late)", "time": "Predicted arrival Unix timestamp"}, "departure": {"delay": "Delay in seconds", "time": "Predicted departure Unix timestamp"}, "schedule_relationship": "SCHEDULED"}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime\n\nurl = \"https://api.mobilitytwin.brussels/stib/gtfs-rt-trip-update\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# Predicted arrival at the next stops of every trip with a vehicle on it\nfor entity in feed.entity:\n    update = entity.trip_update\n    upcoming = [(s.stop_id, datetime.fromtimestamp(s.arrival.time).strftime(\"%H:%M\"))\n                for s in update.stop_time_update[:3]]\n    print(f\"Trip {update.trip.trip_id} ({update.delay:+d} s): {upcoming}\")\n"}]}}, "/stib/punctuality": {"get": {"summary": "Punctuality", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Daily punctuality table for STIB/MIVB, reconstructed from the vehicle-distance feed.\n\nThe source is a set of positions every 20 seconds, each carrying only a line, a direction, the stop point last passed and the metres since. This table is therefore *derived*, not reported. Vehicles are recovered by aligning consecutive polls under the constraint that vehicles on a line do not overtake each other; stop calls are read where a vehicle's distance along the line crosses a stop; and GTFS trip ids are assigned by a second order-preserving alignment of the day's journeys against the day's timetable.\n\nColumns match the other operators' punctuality tables, with seven appended: `route_gtfs_id`, `journey_id`, `match_deviation_minutes`, `observed`, `inferred`, `missing_reason` and `dwell_share`.\n\nTwo limits are structural and must be read before use. **`cancelled` is always false** \u2014 the feed carries no cancellation signal at all, and an unmatched trip is equally evidence that the tracker lost the vehicle, so no cancellation is claimed rather than guessed. Do not compute a STIB cancellation rate from this table. **`observed` marks a measured time and `inferred` a derived one**; they are mutually exclusive, and a consumer wanting measurement only should filter on `observed`. Rows with neither carry a `missing_reason`. `trip_schedule_relationship` is 0 for a timetabled trip and 1 (ADDED) for a run matched to none, whose `trip_id` starts with `added-`.\n\nTypical quality, measured across 146 days spanning April 2024 to August 2026: about 92% of timetabled trips matched on days without a feed outage, 88% of scheduled stop calls carrying a measured time and 94% once inference is included, with a median match deviation of 1.3 minutes. Quality does not degrade with age. The denominator is the timetable, and since no cancellation signal exists, a trip that was short-turned or never ran keeps all of its scheduled calls.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (one file per Brussels service day)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-04-06 00:00:00</td></tr><tr><td>End date</td><td>2026-11-20 00:00:00</td></tr><tr><td>Count</td><td>909</td></tr></table>", "x-refresh": "Daily (one file per Brussels service day)", "x-description": "Daily punctuality table for STIB/MIVB, reconstructed from the vehicle-distance feed.\n\nThe source is a set of positions every 20 seconds, each carrying only a line, a direction, the stop point last passed and the metres since. This table is therefore *derived*, not reported. Vehicles are recovered by aligning consecutive polls under the constraint that vehicles on a line do not overtake each other; stop calls are read where a vehicle's distance along the line crosses a stop; and GTFS trip ids are assigned by a second order-preserving alignment of the day's journeys against the day's timetable.\n\nColumns match the other operators' punctuality tables, with seven appended: `route_gtfs_id`, `journey_id`, `match_deviation_minutes`, `observed`, `inferred`, `missing_reason` and `dwell_share`.\n\nTwo limits are structural and must be read before use. **`cancelled` is always false** \u2014 the feed carries no cancellation signal at all, and an unmatched trip is equally evidence that the tracker lost the vehicle, so no cancellation is claimed rather than guessed. Do not compute a STIB cancellation rate from this table. **`observed` marks a measured time and `inferred` a derived one**; they are mutually exclusive, and a consumer wanting measurement only should filter on `observed`. Rows with neither carry a `missing_reason`. `trip_schedule_relationship` is 0 for a timetabled trip and 1 (ADDED) for a run matched to none, whose `trip_id` starts with `added-`.\n\nTypical quality, measured across 146 days spanning April 2024 to August 2026: about 92% of timetabled trips matched on days without a feed outage, 88% of scheduled stop calls carrying a measured time and 94% once inference is included, with a median match deviation of 1.3 minutes. Quality does not degrade with age. The denominator is the timetable, and since no cancellation signal exists, a trip that was short-turned or never ran keeps all of its scheduled calls.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "Single Apache Parquet file (zstd-compressed) holding one Brussels service day of STIB/MIVB punctuality, reconstructed from the anonymous vehicle-distance feed. One row per scheduled stop call of every matched GTFS trip, plus rows for the vehicles seen running that matched no timetabled trip (trip_id prefixed `added-`, trip_schedule_relationship 1). The first fourteen columns match the other operators' punctuality tables; the last seven are STIB-specific.", "type": "string", "format": "binary", "x-parquet-schema": {"trip_id": {"type": "string", "description": "GTFS trip identifier of the day's STIB GTFS, or `added-<journey_id>` for a vehicle matched to no timetabled trip."}, "start_date": {"type": "string", "description": "Service date in YYYYMMDD (Europe/Brussels)."}, "start_time": {"type": "string", "description": "Trip start time in HH:MM:SS (Europe/Brussels): the scheduled first departure, or the first observed arrival for an `added-` trip."}, "stop_sequence": {"type": "integer", "description": "GTFS stop_sequence of the call. For an `added-` trip, the order in which the stops were seen, starting at 1."}, "stop_id": {"type": "string", "description": "GTFS stop identifier."}, "route_id": {"type": "string", "description": "STIB line number (GTFS route_short_name), not the GTFS route_id, which STIB renumbers between GTFS versions."}, "direction_id": {"type": "integer", "description": "GTFS direction_id (0 / 1)."}, "trip_schedule_relationship": {"type": "integer", "description": "0 SCHEDULED for a matched trip, 1 ADDED for an `added-` trip. Never 3 CANCELED: the source has no cancellation signal."}, "arrival_time": {"type": "string", "format": "date-time", "description": "Measured or inferred arrival timestamp (UTC, naive). Null when neither is available."}, "arrival_delay": {"type": "integer", "description": "Arrival delay in seconds against the GTFS schedule (positive = late). Null when there is no arrival time, and always null for an `added-` trip."}, "departure_time": {"type": "string", "format": "date-time", "description": "Measured or inferred departure timestamp (UTC, naive). Null when neither is available."}, "departure_delay": {"type": "integer", "description": "Departure delay in seconds against the GTFS schedule. Null when there is no departure time, and always null for an `added-` trip."}, "stop_schedule_relationship": {"type": "integer", "description": "Always 0 (SCHEDULED)."}, "cancelled": {"type": "boolean", "description": "Always false: the source carries no cancellation signal."}, "route_gtfs_id": {"type": "string", "description": "GTFS route_id of the day's STIB GTFS. Null for an `added-` trip."}, "journey_id": {"type": "string", "description": "Identifier of the reconstructed vehicle journey matched to the trip."}, "match_deviation_minutes": {"type": "number", "description": "Matching cost in minutes: median absolute deviation between the journey's observed and the trip's scheduled times over their shared stops, plus a penalty for stops of the journey the trip does not share. Lower is a closer match. Null for an `added-` trip."}, "observed": {"type": "boolean", "description": "True when the row carries a time measured from the feed. Mutually exclusive with `inferred`."}, "inferred": {"type": "boolean", "description": "True when the time was derived (extrapolated at a trip's ends or interpolated across a gap) rather than measured."}, "missing_reason": {"type": "string", "description": "Why a row has no time: `dropped_track`, `journey_started_late`, `journey_ended_early`, `unbracketed_hole` or `no_journey_matched`. Null when the row has a time."}, "dwell_share": {"type": "number", "description": "For an `added-` trip, the share of its stop calls where the vehicle stood still at the stop, to judge whether it was in service. Null for timetabled trips."}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install polars requests\nimport io\nimport requests\nimport polars as pl\n\nfrom datetime import datetime, timedelta, timezone\n\n# Yesterday's Brussels-day file (the harvester anchors windows to local midnight,\n# so any timestamp inside that day returns the same parquet).\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\"timestamp\": yesterday_noon.isoformat()}  # ISO accepted; epoch also works\n\nurl = \"https://api.mobilitytwin.brussels/stib/punctuality\"\ndata = requests.get(url, headers={\n    \"Authorization\": \"Bearer [MY_API_KEY]\"\n}, params=params).content\n\ndf = pl.read_parquet(io.BytesIO(data))\nprint(f\"rows: {df.height:,}, trips: {df['trip_id'].n_unique():,}\")\n\n# STIB publishes no realtime feed: every time is reconstructed from vehicle\n# positions. Keep the measured ones (observed) of timetabled trips.\nmeasured = df.filter(pl.col(\"observed\") & (pl.col(\"trip_schedule_relationship\") == 0))\n\ndelays = (\n    measured.group_by(\"route_id\")          # route_id is the line number\n      .agg([\n          pl.col(\"arrival_delay\").median().alias(\"median_delay_s\"),\n          (pl.col(\"arrival_delay\") > 300).mean().round(3).alias(\"share_over_5_min\"),\n          pl.len().alias(\"stop_calls\"),\n      ])\n      .sort(\"median_delay_s\", descending=True)\n)\nprint(\"\\nLines by median arrival delay:\")\nprint(delays.head(10))\n"}]}}, "/stib/speed": {"get": {"summary": "Speed", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>How fast STIB/MIVB vehicles moved on their last move, per line, stop and direction. STIB refreshes a vehicle's distance about every 40 seconds, and a move is timed from when the previous distance first appeared to when the new one did.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds (computed from vehicle-distance)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 02:00:04</td></tr><tr><td>End date</td><td>2026-11-20 21:45:31</td></tr><tr><td>Count</td><td>3373379</td></tr></table>", "x-refresh": "Every 20 seconds (computed from vehicle-distance)", "x-description": "How fast STIB/MIVB vehicles moved on their last move, per line, stop and direction. STIB refreshes a vehicle's distance about every 40 seconds, and a move is timed from when the previous distance first appeared to when the new one did.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"items": {"properties": {"directionId": {"type": "string"}, "lineId": {"type": "string"}, "pointId": {"type": "string"}, "speed": {"type": "number"}}, "required": ["directionId", "lineId", "pointId", "speed"], "type": "object"}, "type": "array"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/speed\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ndf = pd.DataFrame(data)\n\n# Average speed per line (km/h)\nspeed_per_line = df.groupby('lineId')['speed'].mean().sort_values()\nprint(\"Average speed per line (km/h):\")\nprint(speed_per_line)\n\n# Find the slowest segments\nslowest = df.nsmallest(5, 'speed')[['lineId', 'pointId', 'speed']]\nprint(\"\\nSlowest segments:\")\nprint(slowest)"}]}}, "/stib/aggregated-speed": {"get": {"summary": "Aggregated speed", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The average speed of STIB/MIVB vehicles over the last 10 minutes, per line, stop and direction.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds (10-minute rolling average)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 04:23:11</td></tr><tr><td>End date</td><td>2026-11-20 21:45:10</td></tr><tr><td>Count</td><td>2895562</td></tr></table>", "x-refresh": "Every 20 seconds (10-minute rolling average)", "x-description": "The average speed of STIB/MIVB vehicles over the last 10 minutes, per line, stop and direction.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"items": {"properties": {"directionId": {"type": "string"}, "lineId": {"type": "string"}, "pointId": {"type": "string"}, "speed": {"type": "number"}}, "required": ["directionId", "lineId", "pointId", "speed"], "type": "object"}, "type": "array"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/aggregated-speed\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ndf = pd.DataFrame(data)\n\n# Compare average speed across lines over 10-minute intervals\nspeed_by_line = df.groupby('lineId')['speed'].agg(['mean', 'min', 'max'])\nprint(\"Speed statistics per line (km/h):\")\nprint(speed_by_line.sort_values('mean'))"}]}}, "/stib/shapefile": {"get": {"summary": "Shapefile", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The geometry of the STIB/MIVB network, from STIB's shapefile.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (derived from the STIB shapefile)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:48:24</td></tr><tr><td>End date</td><td>2026-11-20 04:20:00</td></tr><tr><td>Count</td><td>714</td></tr></table>", "x-refresh": "Daily (derived from the STIB shapefile)", "x-description": "The geometry of the STIB/MIVB network, from STIB's shapefile.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "properties": {"properties": {"color_hex": {"type": "string"}, "date_debut": {"type": "string"}, "date_fin": {"type": "string"}, "ligne": {"type": "string"}, "variante": {"type": "integer"}}, "required": ["color_hex", "date_debut", "date_fin", "ligne", "variante"], "type": "object"}, "type": {"type": "string"}, "id": {"type": "string", "description": "Index of the feature."}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/shapefile\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Plot the full STIB network colored by line\ngdf.plot(figsize=(12, 10), color=gdf['color_hex'], linewidth=1)\n\n# List all unique lines\nprint(\"STIB lines:\", sorted(gdf['ligne'].unique()))"}]}}, "/stib/stop-details": {"get": {"summary": "Stop details", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Detailed information about each STIB/MIVB stop including GPS coordinates and names in French and Dutch.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-04-29 11:31:03</td></tr><tr><td>End date</td><td>2026-11-20 01:20:00</td></tr><tr><td>Count</td><td>168</td></tr></table>", "x-refresh": "Daily", "x-description": "Detailed information about each STIB/MIVB stop including GPS coordinates and names in French and Dutch.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"results": {"type": "array", "items": {"type": "object", "properties": {"gpscoordinates": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}}, "required": ["gpscoordinates", "id", "name"]}}}, "required": ["results"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport json\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/stop-details\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Parse and display stop details\nfor stop in data['results'][:10]:\n    name = json.loads(stop['name'])\n    coords = json.loads(stop['gpscoordinates'])\n    print(f\"Stop {stop['id']}: {name['fr']} / {name['nl']} ({coords['latitude']}, {coords['longitude']})\")"}]}}, "/stib/stops-by-line": {"get": {"summary": "Stops by line", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The ordered list of stops for each STIB/MIVB line, per direction.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-04-29 11:31:02</td></tr><tr><td>End date</td><td>2026-11-20 01:20:00</td></tr><tr><td>Count</td><td>168</td></tr></table>", "x-refresh": "Daily", "x-description": "The ordered list of stops for each STIB/MIVB line, per direction.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"results": {"type": "array", "items": {"type": "object", "properties": {"destination": {"type": "string"}, "direction": {"type": "string"}, "lineid": {"type": "string"}, "points": {"type": "string"}}, "required": ["destination", "direction", "lineid", "points"]}}}, "required": ["results"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport json\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/stops-by-line\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Display the route of a specific line\nfor route in data['results']:\n    if route['lineid'] == '1':\n        dest = json.loads(route['destination'])\n        stops = json.loads(route['points'])\n        print(f\"Line {route['lineid']} \u2192 {dest['fr']} ({route['direction']})\")\n        print(f\"  {len(stops)} stops: {stops[0]['id']} \u2192 {stops[-1]['id']}\")"}]}}, "/stib/waiting-times": {"get": {"summary": "Waiting times", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Real-time waiting times at STIB/MIVB stops with expected arrival times per line and destination.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 60 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:00:43</td></tr><tr><td>End date</td><td>2026-11-20 21:45:29</td></tr><tr><td>Count</td><td>377554</td></tr></table>", "x-refresh": "Every 60 seconds", "x-description": "Real-time waiting times at STIB/MIVB stops with expected arrival times per line and destination.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}, {"description": "Start of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}, {"description": "Maximum number of snapshots, at most 100.", "schema": {"type": "integer"}, "in": "query", "name": "limit"}, {"description": "Number of snapshots to skip, to page through a range.", "schema": {"type": "integer"}, "in": "query", "name": "offset"}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"results": {"type": "array", "items": {"type": "object", "properties": {"pointid": {"type": "string"}, "lineid": {"type": "string"}, "passingtimes": {"type": "string"}}, "required": ["pointid", "lineid", "passingtimes"]}}}, "required": ["results"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport json\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/waiting-times\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Show next arrivals at each stop\nfor entry in data['results'][:10]:\n    times = json.loads(entry['passingtimes'])\n    for t in times:\n        dest = t.get('destination', {}).get('fr', '?')   # absent on a \"last departure\" message\n        arrival = datetime.fromisoformat(t['expectedArrivalTime'])\n        print(f\"Stop {entry['pointid']} \u2014 Line {entry['lineid']} \u2192 {dest} at {arrival:%H:%M}\")"}]}}, "/stib/travellers-information": {"get": {"summary": "Travellers information", "tags": ["STIB"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Real-time traveller information messages and service alerts for STIB/MIVB lines and stops.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 15 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:15:23</td></tr><tr><td>End date</td><td>2026-11-20 21:45:14</td></tr><tr><td>Count</td><td>17843</td></tr></table>", "x-refresh": "Every 15 minutes", "x-description": "Real-time traveller information messages and service alerts for STIB/MIVB lines and stops.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"results": {"type": "array", "items": {"type": "object", "properties": {"content": {"type": "string"}, "type": {"type": "string"}, "lines": {"type": "string"}, "priority": {"type": "integer"}, "points": {"type": "string"}, "id": {"type": "string", "description": "Message id."}}, "required": ["content", "type", "lines", "priority", "points"]}}}, "required": ["results"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport json\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/stib/travellers-information\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Display active service alerts sorted by priority\nfor alert in sorted(data['results'], key=lambda x: x['priority'], reverse=True):\n    content = json.loads(alert['content'])\n    lines = json.loads(alert['lines'])\n    text = content[0]['text'][0].get('en') or content[0]['text'][0]['fr']   # a few alerts are French/Dutch only\n    line_ids = ', '.join(l['id'] for l in lines)\n    print(f\"[Priority {alert['priority']}] Lines {line_ids}: {text}\")"}]}}, "/tec/gtfs": {"get": {"summary": "GTFS", "tags": ["TEC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The TEC timetable as a standard GTFS zip.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:53:16</td></tr><tr><td>End date</td><td>2026-11-20 04:45:11</td></tr><tr><td>Count</td><td>714</td></tr></table>", "x-refresh": "Daily", "x-description": "The TEC timetable as a standard GTFS zip.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "GTFS (General Transit Feed Specification) ZIP archive containing the following CSV files:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.txt": {"description": "Transit agency information (TEC).", "fields": ["agency_id", "agency_name", "agency_url", "agency_timezone"]}, "routes.txt": {"description": "Transit routes (bus lines).", "fields": ["route_id", "agency_id", "route_short_name", "route_long_name", "route_type", "route_color"]}, "trips.txt": {"description": "Individual trips per route.", "fields": ["route_id", "service_id", "trip_id", "trip_headsign", "direction_id", "shape_id"]}, "stops.txt": {"description": "Stop locations.", "fields": ["stop_id", "stop_name", "stop_lat", "stop_lon", "location_type"]}, "stop_times.txt": {"description": "Arrival/departure times per stop per trip.", "fields": ["trip_id", "arrival_time", "departure_time", "stop_id", "stop_sequence"]}, "calendar.txt": {"description": "Service days of the week.", "fields": ["service_id", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "start_date", "end_date"]}, "calendar_dates.txt": {"description": "Service exceptions (added/removed dates).", "fields": ["service_id", "date", "exception_type"]}, "shapes.txt": {"description": "Geospatial shape of each route variant.", "fields": ["shape_id", "shape_pt_lat", "shape_pt_lon", "shape_pt_sequence"]}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import gtfs_kit as gk\nimport requests\nimport tempfile\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/tec/gtfs\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = gk.read_feed(f.name, 'm')\n\n# Explore the TEC schedule\nprint(f\"Routes: {len(feed.routes)}, Stops: {len(feed.stops)}, Trips: {len(feed.trips)}\")\nprint(\"\\nSample routes:\")\nprint(feed.routes[['route_short_name', 'route_long_name']].head(10))"}]}}, "/tec/gtfs-parquet": {"get": {"summary": "GTFS (Parquet)", "tags": ["TEC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The TEC timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (regenerated from the GTFS feed)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:53:16</td></tr><tr><td>End date</td><td>2026-11-20 04:45:11</td></tr><tr><td>Count</td><td>806</td></tr></table>", "x-refresh": "Daily (regenerated from the GTFS feed)", "x-description": "The TEC timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "ZIP archive of Apache Parquet files (zstd-compressed), one per GTFS file of the day's GTFS feed, with typed columns: identifiers and text as strings, enumerations as integers, dates as Parquet dates, and stop_times arrival_time/departure_time as durations since service-day midnight (may exceed 24h). The archive contains:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.parquet": {"description": "Transit agency information.", "fields": {"agency_fare_url": "string", "agency_id": "string", "agency_lang": "string", "agency_name": "string", "agency_phone": "string", "agency_timezone": "string", "agency_url": "string"}}, "stops.parquet": {"description": "Stop/station locations.", "fields": {"location_type": "integer", "parent_station": "string", "platform_code": "string", "stop_code": "string", "stop_desc": "string", "stop_id": "string", "stop_lat": "number", "stop_lon": "number", "stop_name": "string", "stop_url": "string", "wheelchair_boarding": "integer", "zone_id": "string"}}, "routes.parquet": {"description": "Transit routes (lines).", "fields": {"agency_id": "string", "route_color": "string", "route_desc": "string", "route_id": "string", "route_long_name": "string", "route_short_name": "string", "route_text_color": "string", "route_type": "integer", "route_url": "string"}}, "trips.parquet": {"description": "Individual trips per route.", "fields": {"bikes_allowed": "integer", "block_id": "string", "direction_id": "integer", "route_id": "string", "service_id": "string", "shape_id": "string", "trip_headsign": "string", "trip_id": "string", "trip_short_name": "string", "wheelchair_accessible": "integer"}}, "stop_times.parquet": {"description": "Arrival/departure times per stop per trip.", "fields": {"arrival_time": "duration (ms since service-day midnight)", "departure_time": "duration (ms since service-day midnight)", "drop_off_type": "integer", "pickup_type": "integer", "shape_dist_traveled": "number", "stop_headsign": "string", "stop_id": "string", "stop_sequence": "integer", "trip_id": "string"}}, "calendar.parquet": {"description": "Service days of the week.", "fields": {"end_date": "date", "friday": "integer", "monday": "integer", "saturday": "integer", "service_id": "string", "start_date": "date", "sunday": "integer", "thursday": "integer", "tuesday": "integer", "wednesday": "integer"}}, "calendar_dates.parquet": {"description": "Service exceptions (added/removed dates).", "fields": {"date": "date", "exception_type": "integer", "service_id": "string"}}, "shapes.parquet": {"description": "Geospatial shape of each route variant.", "fields": {"shape_dist_traveled": "number", "shape_id": "string", "shape_pt_lat": "number", "shape_pt_lon": "number", "shape_pt_sequence": "integer"}}, "translations.parquet": {"description": "Translations of stop names and other text.", "fields": {"table_name": "string", "field_name": "string", "record_id": "string", "record_sub_id": "string", "field_value": "string", "language": "string", "translation": "string"}}, "feed_info.parquet": {"description": "Feed publisher, languages and validity period.", "fields": {"feed_id": "string", "default_lang": "string", "feed_contact_email": "string", "feed_contact_url": "string", "feed_end_date": "date", "feed_lang": "string", "feed_publisher_name": "string", "feed_publisher_url": "string", "feed_start_date": "date", "feed_version": "string"}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install gtfs-parquet>=0.4.0\nimport requests\nimport tempfile\n\nfrom gtfs_parquet import read_parquet\nfrom gtfs_parquet.ops.network import describe\nfrom gtfs_parquet.ops.calendar import get_first_week, compute_busiest_date\nfrom gtfs_parquet.ops.routes import compute_route_stats\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/tec/gtfs-parquet\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = read_parquet(f.name)\n\n# Quick summary of the feed\nprint(describe(feed))\n\n# Find the busiest date in the first week\nweek = get_first_week(feed)\nbusiest = compute_busiest_date(feed, week)\nprint(f\"Busiest date: {busiest}\")\n\n# Compute per-route statistics for that week\nroute_stats = compute_route_stats(feed, week)\nprint(route_stats.sort(\"num_trips\", descending=True))\n"}]}}, "/tec/gtfs-realtime": {"get": {"summary": "GTFS-RT (legacy)", "tags": ["TEC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Legacy TEC trip-updates file, kept for its history. For current data, use <b>gtfs-rt-trip-update</b>, which carries the same updates from the Belgian Mobility API.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>No longer updated since 2026-09-21 \u2014 use gtfs-rt-trip-update; historical data only</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:54:58</td></tr><tr><td>End date</td><td>2026-09-21 18:48:23</td></tr><tr><td>Count</td><td>2979231</td></tr></table>", "x-refresh": "No longer updated since 2026-09-21 \u2014 use gtfs-rt-trip-update; historical data only", "x-description": "Legacy TEC trip-updates file, kept for its history. For current data, use <b>gtfs-rt-trip-update</b>, which carries the same updates from the Belgian Mobility API.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "Legacy GTFS-RT (GTFS Realtime) Protocol Buffer binary of TEC containing trip updates only (delays, cancellations, skipped stops); no vehicle positions. No longer updated since 2026-09-21: historical data only, use gtfs-rt-trip-update for current data.", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "1.0", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier", "trip_update": {"trip": {"trip_id": "GTFS trip identifier", "route_id": "GTFS route identifier", "direction_id": "GTFS direction_id (not always present)", "start_date": "Service date, YYYYMMDD", "start_time": "Scheduled departure of the trip, HH:MM:SS", "schedule_relationship": "CANCELED for a cancelled trip, otherwise omitted (SCHEDULED)"}, "vehicle": {"id": "Vehicle identifier"}, "delay": "Current trip delay in seconds (not always present)", "stop_time_update[]": {"stop_id": "GTFS stop identifier", "stop_sequence": "Position of the stop in the trip", "arrival": {"delay": "Delay in seconds (positive = late)"}, "departure": {"delay": "Delay in seconds (positive = late)"}, "schedule_relationship": "SCHEDULED | SKIPPED | NO_DATA"}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\n# Legacy feed, no longer updated since 2026-09-21: query a timestamp before that date.\n# For current data use tec/gtfs-rt-trip-update.\nparams = {\n    \"timestamp\": \"2026-09-15T12:00:00+00:00\",   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/tec/gtfs-realtime\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# The feed carries trip updates only: list cancelled trips and delays > 5 minutes\nfor entity in feed.entity:\n    tu = entity.trip_update\n    if tu.trip.schedule_relationship == gtfs_realtime_pb2.TripDescriptor.CANCELED:\n        print(f\"Trip {tu.trip.trip_id} on route {tu.trip.route_id} cancelled\")\n        continue\n    for stu in tu.stop_time_update:\n        delay = stu.arrival.delay if stu.HasField('arrival') else 0\n        if delay > 300:\n            print(f\"Trip {tu.trip.trip_id} \u2014 {delay // 60}min late at stop {stu.stop_id}\")\n"}]}}, "/tec/gtfs-rt-alert": {"get": {"summary": "GTFS-RT Alerts", "tags": ["TEC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Real-time service alerts for TEC (disruptions, detours, cancellations).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 15 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:01:24</td></tr><tr><td>End date</td><td>2026-11-20 21:33:03</td></tr><tr><td>Count</td><td>18945</td></tr></table>", "x-refresh": "Every 15 minutes", "x-description": "Real-time service alerts for TEC (disruptions, detours, cancellations).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing service alerts.", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier", "alert": {"informed_entity[]": {"route_id": "Affected GTFS route", "stop_id": "Affected stop (optional)"}, "cause": "CONSTRUCTION | ACCIDENT | TECHNICAL_PROBLEM | STRIKE | ...", "effect": "NO_SERVICE | REDUCED_SERVICE | DETOUR | ...", "header_text": {"translation[]": {"language": "en/fr/nl", "text": "Short alert summary"}}, "description_text": {"translation[]": {"language": "en/fr/nl", "text": "Detailed description"}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/tec/gtfs-rt-alert\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# Display all active service alerts\nfor entity in feed.entity:\n    alert = entity.alert\n    header = alert.header_text.translation[0].text if alert.header_text.translation else \"N/A\"\n    routes = [s.route_id for s in alert.informed_entity]\n    print(f\"[{alert.cause}] {header} \u2014 Routes: {', '.join(routes)}\")"}]}}, "/tec/gtfs-rt-trip-update": {"get": {"summary": "GTFS-RT Trip updates", "tags": ["TEC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Delays and cancellations of TEC trips.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:00:46</td></tr><tr><td>End date</td><td>2026-11-20 21:45:34</td></tr><tr><td>Count</td><td>916091</td></tr></table>", "x-refresh": "Every 20 seconds", "x-description": "Delays and cancellations of TEC trips.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing trip updates (delays, cancellations).", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier", "trip_update": {"trip": {"trip_id": "GTFS trip identifier", "route_id": "GTFS route identifier", "schedule_relationship": "SCHEDULED | ADDED | CANCELED"}, "stop_time_update[]": {"stop_id": "GTFS stop identifier", "arrival": {"delay": "Delay in seconds (positive = late)", "time": "Predicted arrival Unix timestamp"}, "departure": {"delay": "Delay in seconds", "time": "Predicted departure Unix timestamp"}, "schedule_relationship": "SCHEDULED | SKIPPED | NO_DATA"}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/tec/gtfs-rt-trip-update\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# Show delayed trips (delay > 5 minutes)\nfor entity in feed.entity:\n    tu = entity.trip_update\n    for stu in tu.stop_time_update:\n        delay = stu.arrival.delay if stu.HasField('arrival') else 0\n        if delay > 300:\n            print(f\"Trip {tu.trip.trip_id} \u2014 {delay // 60}min late at stop {stu.stop_id}\")"}]}}, "/tec/gtfs-rt-vehicle-position": {"get": {"summary": "GTFS-RT Vehicle positions", "tags": ["TEC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Real-time positions of TEC vehicles from the Belgian Mobility API, with bearing, speed, current stop sequence and the trip being served. As published, <code>speed</code> is in km/h although GTFS-RT specifies m/s, and a vehicle without a GPS fix is reported at 0,0 (about one in a thousand positions).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-09-15 16:25:54</td></tr><tr><td>End date</td><td>2026-11-20 21:45:31</td></tr><tr><td>Count</td><td>254376</td></tr></table>", "x-refresh": "Every 20 seconds", "x-description": "Real-time positions of TEC vehicles from the Belgian Mobility API, with bearing, speed, current stop sequence and the trip being served. As published, <code>speed</code> is in km/h although GTFS-RT specifies m/s, and a vehicle without a GPS fix is reported at 0,0 (about one in a thousand positions).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing the live positions of TEC vehicles, from the Belgian Mobility API. position.speed is in km/h as provided by TEC, which deviates from the GTFS-RT specification (m/s). Identifiers carry a feed prefix (gt:tec: for trips, gr:tec: for routes, gs:tec: for stops), the same ids as in the published TEC GTFS (tec/gtfs), so they join as is.", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "1.0", "incrementality": "FULL_DATASET", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier (rv:tec:<vehicle id>)", "vehicle": {"trip": {"trip_id": "GTFS trip identifier, prefixed gt:tec:", "route_id": "GTFS route identifier, prefixed gr:tec:", "direction_id": "GTFS direction_id", "start_date": "Service date, YYYYMMDD", "start_time": "Scheduled departure of the trip, HH:MM:SS"}, "vehicle": {"id": "Vehicle identifier", "label": "Not filled in (empty)", "license_plate": "Not filled in (empty)"}, "position": {"latitude": "WGS84 latitude", "longitude": "WGS84 longitude", "bearing": "Bearing in degrees", "speed": "Speed in km/h (as provided by TEC; the GTFS-RT specification uses m/s)", "odometer": "Not filled in (0)"}, "stop_id": "GTFS stop identifier, prefixed gs:tec:", "current_stop_sequence": "stop_sequence of that stop in the trip", "current_status": "INCOMING_AT | STOPPED_AT | IN_TRANSIT_TO", "congestion_level": "Not filled in (UNKNOWN_CONGESTION_LEVEL)", "occupancy_status": "Not filled in (EMPTY)", "occupancy_percentage": "Not filled in (0)", "timestamp": "Unix timestamp of this position"}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/tec/gtfs-rt-vehicle-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# List all vehicle positions\nfor entity in feed.entity:\n    v = entity.vehicle\n    pos = v.position\n    print(f\"Trip {v.trip.trip_id} on route {v.trip.route_id}: \"\n          f\"({pos.latitude:.4f}, {pos.longitude:.4f}), {pos.speed:.0f} km/h, \"\n          f\"stop sequence {v.current_stop_sequence}\")"}]}}, "/tec/punctuality": {"get": {"summary": "Punctuality", "tags": ["TEC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Daily punctuality table derived from TEC's GTFS-RT trip-update stream over a full Brussels-day window.\n\nEach row represents one (trip, stop) observation with the latest known arrival/departure times, delays, and schedule_relationship \u2014 plus a synthetic row per cancelled trip when the feed signals cancellation without stop-time entries.\n\nSingle Parquet file (zstd-compressed). Read with Polars, DuckDB or PyArrow. The data is consistent with the GTFS schedule: scheduled = actual_time \u2212 delay matches the static GTFS arrival_time for TEC feeds that publish absolute times.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 00:00:00</td></tr><tr><td>End date</td><td>2026-11-20 00:00:00</td></tr><tr><td>Count</td><td>806</td></tr></table>", "x-refresh": "Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)", "x-description": "Daily punctuality table derived from TEC's GTFS-RT trip-update stream over a full Brussels-day window.\n\nEach row represents one (trip, stop) observation with the latest known arrival/departure times, delays, and schedule_relationship \u2014 plus a synthetic row per cancelled trip when the feed signals cancellation without stop-time entries.\n\nSingle Parquet file (zstd-compressed). Read with Polars, DuckDB or PyArrow. The data is consistent with the GTFS schedule: scheduled = actual_time \u2212 delay matches the static GTFS arrival_time for TEC feeds that publish absolute times.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "Single Apache Parquet file (zstd-compressed) holding one day of punctuality observations derived from the GTFS-RT trip-update stream. One row per (trip_id, start_date, start_time, stop_sequence, stop_id) observation, plus one synthetic row per cancelled trip-instance when the feed signals cancellation without stop-time entries.", "type": "string", "format": "binary", "x-parquet-schema": {"trip_id": {"type": "string", "description": "GTFS trip identifier as published in the realtime feed (no `gt:<feed>:` prefix)."}, "start_date": {"type": "string", "description": "Service date in YYYYMMDD (operator local), identifies the trip-instance together with trip_id and start_time."}, "start_time": {"type": "string", "description": "Trip start time in HH:MM:SS (operator local). May be empty if the feed omits it."}, "stop_sequence": {"type": "integer", "description": "Stop position within the trip. Null when the feed does not publish a sequence (e.g. SNCB) or for a cancelled-trip synthetic row."}, "stop_id": {"type": "string", "description": "GTFS stop identifier (no `gs:<feed>:` prefix). Null for a cancelled-trip synthetic row."}, "route_id": {"type": "string", "description": "GTFS route identifier; empty when not provided by the feed."}, "direction_id": {"type": "integer", "description": "Direction of travel (0 / 1). Null when the feed omits it."}, "trip_schedule_relationship": {"type": "integer", "description": "GTFS-RT TripDescriptor.ScheduleRelationship: 0 SCHEDULED, 1 ADDED, 2 UNSCHEDULED, 3 CANCELED, 4 REPLACEMENT, 5 DUPLICATED, 6 DELETED."}, "arrival_time": {"type": "string", "format": "date-time", "description": "Latest known actual arrival timestamp (UTC). Null if the feed only publishes delays."}, "arrival_delay": {"type": "integer", "description": "Latest known arrival delay in seconds (positive = late). Null when the feed has no delay info for this stop."}, "departure_time": {"type": "string", "format": "date-time", "description": "Latest known actual departure timestamp (UTC). Null if the feed only publishes delays."}, "departure_delay": {"type": "integer", "description": "Latest known departure delay in seconds. Null when the feed has no delay info."}, "stop_schedule_relationship": {"type": "integer", "description": "GTFS-RT StopTimeUpdate.ScheduleRelationship: 0 SCHEDULED, 1 SKIPPED, 2 NO_DATA, 3 UNSCHEDULED."}, "cancelled": {"type": "boolean", "description": "True when the trip is CANCELED at trip level or the stop is SKIPPED at stop level."}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install polars requests\nimport io\nimport requests\nimport polars as pl\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\"timestamp\": yesterday_noon.isoformat()}\n\nurl = \"https://api.mobilitytwin.brussels/tec/punctuality\"\ndata = requests.get(url, headers={\n    \"Authorization\": \"Bearer [MY_API_KEY]\"\n}, params=params).content\n\ndf = pl.read_parquet(io.BytesIO(data))\nprint(f\"rows: {df.height:,}\")\n\n# Note: TEC's GTFS-RT feed publishes delays only \u2014 no absolute arrival_time /\n# departure_time. Join to static GTFS on (trip_id, stop_id) to recover times.\nnot_cancelled = df.filter(~pl.col(\"cancelled\") & pl.col(\"arrival_delay\").is_not_null())\n\n# Distribution of arrival delays.\nprint(\"\\nArrival delay distribution (seconds):\")\nprint(not_cancelled.select([\n    pl.col(\"arrival_delay\").quantile(0.05).alias(\"p05\"),\n    pl.col(\"arrival_delay\").median().alias(\"median\"),\n    pl.col(\"arrival_delay\").mean().round(1).alias(\"mean\"),\n    pl.col(\"arrival_delay\").quantile(0.95).alias(\"p95\"),\n    pl.col(\"arrival_delay\").max().alias(\"max\"),\n    (pl.col(\"arrival_delay\") <= 60).mean().round(3).alias(\"share_within_60s\"),\n]))\n\n# Where do the worst delays accumulate?\nprint(\"\\nMean arrival delay per route (top 10):\")\nprint(not_cancelled.group_by(\"route_id\")\n      .agg([pl.col(\"arrival_delay\").mean().round(1).alias(\"mean_delay_s\"),\n            pl.len().alias(\"n\")])\n      .filter(pl.col(\"n\") >= 50)\n      .sort(\"mean_delay_s\", descending=True)\n      .head(10))\n\n# Cancellations.\ncancelled = df.filter(pl.col(\"cancelled\"))\nprint(f\"\\ncancelled rows: {cancelled.height:,}, unique trip-instances: \"\n      f\"{cancelled.select(['trip_id', 'start_date', 'start_time']).unique().height}\")\n"}]}}, "/de-lijn/gtfs": {"get": {"summary": "GTFS", "tags": ["DE LIJN"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The De Lijn timetable as a standard GTFS zip.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:53:16</td></tr><tr><td>End date</td><td>2026-11-20 06:00:13</td></tr><tr><td>Count</td><td>664</td></tr></table>", "x-refresh": "Daily", "x-description": "The De Lijn timetable as a standard GTFS zip.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "GTFS (General Transit Feed Specification) ZIP archive containing the following CSV files:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.txt": {"description": "Transit agency information (De Lijn).", "fields": ["agency_id", "agency_name", "agency_url", "agency_timezone"]}, "routes.txt": {"description": "Transit routes (tram and bus lines).", "fields": ["route_id", "agency_id", "route_short_name", "route_long_name", "route_type", "route_color"]}, "trips.txt": {"description": "Individual trips per route.", "fields": ["route_id", "service_id", "trip_id", "trip_headsign", "direction_id", "shape_id"]}, "stops.txt": {"description": "Stop locations.", "fields": ["stop_id", "stop_name", "stop_lat", "stop_lon", "location_type"]}, "stop_times.txt": {"description": "Arrival/departure times per stop per trip.", "fields": ["trip_id", "arrival_time", "departure_time", "stop_id", "stop_sequence"]}, "calendar.txt": {"description": "Service days of the week.", "fields": ["service_id", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "start_date", "end_date"]}, "calendar_dates.txt": {"description": "Service exceptions (added/removed dates).", "fields": ["service_id", "date", "exception_type"]}, "shapes.txt": {"description": "Geospatial shape of each route variant.", "fields": ["shape_id", "shape_pt_lat", "shape_pt_lon", "shape_pt_sequence"]}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import gtfs_kit as gk\nimport requests\nimport tempfile\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/de-lijn/gtfs\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = gk.read_feed(f.name, 'm')\n\n# Explore the De Lijn schedule\nprint(f\"Routes: {len(feed.routes)}, Stops: {len(feed.stops)}, Trips: {len(feed.trips)}\")\nprint(\"\\nSample routes:\")\nprint(feed.routes[['route_short_name', 'route_long_name']].head(10))"}]}}, "/de-lijn/gtfs-parquet": {"get": {"summary": "GTFS (Parquet)", "tags": ["DE LIJN"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/ZIP</div><br><br>The De Lijn timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (regenerated from the GTFS feed)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:53:16</td></tr><tr><td>End date</td><td>2026-11-20 06:00:13</td></tr><tr><td>Count</td><td>687</td></tr></table>", "x-refresh": "Daily (regenerated from the GTFS feed)", "x-description": "The De Lijn timetable with one Parquet file per GTFS table, in a zip, 40-75% smaller than the GTFS zip. Polars or DuckDB can read single columns without loading a whole table. Built with <a href=\"https://pypi.org/project/gtfs-parquet/0.4.0/\">gtfs-parquet v0.4.0</a>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/zip": {"schema": {"description": "ZIP archive of Apache Parquet files (zstd-compressed), one per GTFS file of the day's GTFS feed, with typed columns: identifiers and text as strings, enumerations as integers, dates as Parquet dates, and stop_times arrival_time/departure_time as durations since service-day midnight (may exceed 24h). The archive contains:", "type": "string", "format": "binary", "x-gtfs-contents": {"agency.parquet": {"description": "Transit agency information.", "fields": {"agency_fare_url": "string", "agency_id": "string", "agency_lang": "string", "agency_name": "string", "agency_phone": "string", "agency_timezone": "string", "agency_url": "string"}}, "stops.parquet": {"description": "Stop/station locations.", "fields": {"location_type": "integer", "parent_station": "string", "platform_code": "string", "stop_code": "string", "stop_desc": "string", "stop_id": "string", "stop_lat": "number", "stop_lon": "number", "stop_name": "string", "stop_url": "string", "wheelchair_boarding": "integer", "zone_id": "string"}}, "routes.parquet": {"description": "Transit routes (lines).", "fields": {"agency_id": "string", "route_color": "string", "route_desc": "string", "route_id": "string", "route_long_name": "string", "route_short_name": "string", "route_text_color": "string", "route_type": "integer", "route_url": "string"}}, "trips.parquet": {"description": "Individual trips per route.", "fields": {"bikes_allowed": "integer", "block_id": "string", "direction_id": "integer", "route_id": "string", "service_id": "string", "shape_id": "string", "trip_headsign": "string", "trip_id": "string", "trip_short_name": "string", "wheelchair_accessible": "integer"}}, "stop_times.parquet": {"description": "Arrival/departure times per stop per trip.", "fields": {"arrival_time": "duration (ms since service-day midnight)", "departure_time": "duration (ms since service-day midnight)", "drop_off_type": "integer", "pickup_type": "integer", "shape_dist_traveled": "number", "stop_headsign": "string", "stop_id": "string", "stop_sequence": "integer", "trip_id": "string"}}, "calendar.parquet": {"description": "Service days of the week.", "fields": {"end_date": "date", "friday": "integer", "monday": "integer", "saturday": "integer", "service_id": "string", "start_date": "date", "sunday": "integer", "thursday": "integer", "tuesday": "integer", "wednesday": "integer"}}, "calendar_dates.parquet": {"description": "Service exceptions (added/removed dates).", "fields": {"date": "date", "exception_type": "integer", "service_id": "string"}}, "shapes.parquet": {"description": "Geospatial shape of each route variant.", "fields": {"shape_dist_traveled": "number", "shape_id": "string", "shape_pt_lat": "number", "shape_pt_lon": "number", "shape_pt_sequence": "integer"}}, "transfers.parquet": {"description": "Transfer rules between stops or trips.", "fields": {"from_stop_id": "string", "min_transfer_time": "integer", "to_stop_id": "string", "transfer_type": "integer", "from_trip_id": "string", "to_trip_id": "string"}}, "feed_info.parquet": {"description": "Feed publisher, languages and validity period.", "fields": {"feed_id": "string", "default_lang": "string", "feed_contact_email": "string", "feed_contact_url": "string", "feed_end_date": "date", "feed_lang": "string", "feed_publisher_name": "string", "feed_publisher_url": "string", "feed_start_date": "date", "feed_version": "string"}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install gtfs-parquet>=0.4.0\nimport requests\nimport tempfile\n\nfrom gtfs_parquet import read_parquet\nfrom gtfs_parquet.ops.network import describe\nfrom gtfs_parquet.ops.calendar import get_first_week, compute_busiest_date\nfrom gtfs_parquet.ops.routes import compute_route_stats\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/de-lijn/gtfs-parquet\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nwith tempfile.NamedTemporaryFile(delete=False, suffix=\".zip\") as f:\n    f.write(data)\n\nfeed = read_parquet(f.name)\n\n# Quick summary of the feed\nprint(describe(feed))\n\n# Find the busiest date in the first week\nweek = get_first_week(feed)\nbusiest = compute_busiest_date(feed, week)\nprint(f\"Busiest date: {busiest}\")\n\n# Compute per-route statistics for that week\nroute_stats = compute_route_stats(feed, week)\nprint(route_stats.sort(\"num_trips\", descending=True))\n"}]}}, "/de-lijn/gtfs-realtime": {"get": {"summary": "GTFS-RT", "tags": ["DE LIJN"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>De Lijn's own GTFS-RT feed, as published.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:54:59</td></tr><tr><td>End date</td><td>2026-11-20 21:45:37</td></tr><tr><td>Count</td><td>3310305</td></tr></table>", "x-refresh": "Every 20 seconds", "x-description": "De Lijn's own GTFS-RT feed, as published.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary mixing three entity types in one feed: trip updates (delays, cancellations), vehicle positions (no speed) and service alerts. Check which field is set on each entity.", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "incrementality": "FULL_DATASET", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier, prefixed by its type (trip:, vehicle:, alert:)", "trip_update": {"trip": {"trip_id": "GTFS trip identifier", "start_date": "Service date, YYYYMMDD", "schedule_relationship": "CANCELED for a cancelled trip, otherwise omitted (SCHEDULED)"}, "vehicle": {"id": "Vehicle identifier"}, "stop_time_update[]": {"stop_id": "GTFS stop identifier", "stop_sequence": "Position of the stop in the trip", "arrival": {"delay": "Delay in seconds (positive = late)", "time": "Predicted arrival Unix timestamp"}, "departure": {"delay": "Delay in seconds (positive = late)", "time": "Predicted departure Unix timestamp"}}, "timestamp": "Unix timestamp of this update"}, "vehicle": {"trip": {"trip_id": "GTFS trip identifier", "start_date": "Service date, YYYYMMDD"}, "position": {"latitude": "WGS84 latitude", "longitude": "WGS84 longitude", "bearing": "Bearing in degrees (no speed is published)"}, "timestamp": "Unix timestamp of this position", "vehicle": {"id": "Vehicle identifier"}}, "alert": {"active_period[]": {"start": "Unix timestamp", "end": "Unix timestamp (optional)"}, "informed_entity[]": {"route_id": "GTFS route identifier", "stop_id": "GTFS stop identifier"}, "cause": "GTFS-RT Alert.Cause", "effect": "GTFS-RT Alert.Effect", "header_text": "Translated title (nl, fr, en, de)", "description_text": "Translated description (nl, fr, en, de)", "url": "Translated link"}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/de-lijn/gtfs-realtime\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# The feed mixes trip updates, vehicle positions and alerts: dispatch on the entity type\nfor entity in feed.entity:\n    if entity.HasField('vehicle'):\n        v = entity.vehicle\n        pos = v.position\n        print(f\"Vehicle {v.vehicle.id} on trip {v.trip.trip_id} at ({pos.latitude:.4f}, {pos.longitude:.4f})\")\n    elif entity.HasField('trip_update'):\n        tu = entity.trip_update\n        print(f\"Trip {tu.trip.trip_id}: {len(tu.stop_time_update)} stop time updates\")\n    elif entity.HasField('alert'):\n        texts = entity.alert.header_text.translation\n        print(f\"Alert: {texts[0].text if texts else ''}\")\n"}]}}, "/de-lijn/gtfs-rt-alert": {"get": {"summary": "GTFS-RT Alerts", "tags": ["DE LIJN"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Real-time service alerts for De Lijn (disruptions, detours, cancellations).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 15 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:01:24</td></tr><tr><td>End date</td><td>2026-11-20 21:31:40</td></tr><tr><td>Count</td><td>18945</td></tr></table>", "x-refresh": "Every 15 minutes", "x-description": "Real-time service alerts for De Lijn (disruptions, detours, cancellations).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing service alerts.", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier", "alert": {"informed_entity[]": {"route_id": "Affected GTFS route", "stop_id": "Affected stop (optional)"}, "cause": "CONSTRUCTION | ACCIDENT | TECHNICAL_PROBLEM | STRIKE | ...", "effect": "NO_SERVICE | REDUCED_SERVICE | DETOUR | ...", "header_text": {"translation[]": {"language": "en/fr/nl", "text": "Short alert summary"}}, "description_text": {"translation[]": {"language": "en/fr/nl", "text": "Detailed description"}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/de-lijn/gtfs-rt-alert\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# Display all active service alerts\nfor entity in feed.entity:\n    alert = entity.alert\n    header = alert.header_text.translation[0].text if alert.header_text.translation else \"N/A\"\n    routes = [s.route_id for s in alert.informed_entity]\n    print(f\"[{alert.cause}] {header} \u2014 Routes: {', '.join(routes)}\")"}]}}, "/de-lijn/gtfs-rt-trip-update": {"get": {"summary": "GTFS-RT Trip updates", "tags": ["DE LIJN"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GTFS-RT</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Delays and cancellations of De Lijn trips.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:00:46</td></tr><tr><td>End date</td><td>2026-11-20 21:45:27</td></tr><tr><td>Count</td><td>834832</td></tr></table>", "x-refresh": "Every 20 seconds", "x-description": "Delays and cancellations of De Lijn trips.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "GTFS-RT (GTFS Realtime) Protocol Buffer binary containing trip updates (delays, cancellations).", "type": "string", "format": "binary", "x-gtfs-rt-structure": {"FeedMessage": {"header": {"gtfs_realtime_version": "2.0", "timestamp": "Unix timestamp of the feed"}, "entity[]": {"id": "Unique entity identifier", "trip_update": {"trip": {"trip_id": "GTFS trip identifier", "route_id": "GTFS route identifier", "schedule_relationship": "SCHEDULED | ADDED | CANCELED"}, "stop_time_update[]": {"stop_id": "GTFS stop identifier", "arrival": {"delay": "Delay in seconds (positive = late)", "time": "Predicted arrival Unix timestamp"}, "departure": {"delay": "Delay in seconds", "time": "Predicted departure Unix timestamp"}, "schedule_relationship": "SCHEDULED | SKIPPED | NO_DATA"}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nfrom google.transit import gtfs_realtime_pb2\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/de-lijn/gtfs-rt-trip-update\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).content\n\nfeed = gtfs_realtime_pb2.FeedMessage()\nfeed.ParseFromString(data)\n\n# Show delayed trips (delay > 5 minutes)\nfor entity in feed.entity:\n    tu = entity.trip_update\n    for stu in tu.stop_time_update:\n        delay = stu.arrival.delay if stu.HasField('arrival') else 0\n        if delay > 300:\n            print(f\"Trip {tu.trip.trip_id} \u2014 {delay // 60}min late at stop {stu.stop_id}\")"}]}}, "/de-lijn/punctuality": {"get": {"summary": "Punctuality", "tags": ["DE LIJN"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>PARQUET</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/OCTET-STREAM</div><br><br>Daily punctuality table derived from De Lijn's GTFS-RT trip-update stream over a full Brussels-day window.\n\nEach row represents one (trip, stop) observation with the latest known arrival/departure times, delays, and schedule_relationship \u2014 plus a synthetic row per cancelled trip when the feed signals cancellation without stop-time entries.\n\nSingle Parquet file (zstd-compressed). Read with Polars, DuckDB or PyArrow. The data is consistent with the GTFS schedule: scheduled = actual_time \u2212 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%).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 00:00:00</td></tr><tr><td>End date</td><td>2026-11-20 00:00:00</td></tr><tr><td>Count</td><td>801</td></tr></table>", "x-refresh": "Daily (one file per Brussels-day, anchored to 00:00 Europe/Brussels)", "x-description": "Daily punctuality table derived from De Lijn's GTFS-RT trip-update stream over a full Brussels-day window.\n\nEach row represents one (trip, stop) observation with the latest known arrival/departure times, delays, and schedule_relationship \u2014 plus a synthetic row per cancelled trip when the feed signals cancellation without stop-time entries.\n\nSingle Parquet file (zstd-compressed). Read with Polars, DuckDB or PyArrow. The data is consistent with the GTFS schedule: scheduled = actual_time \u2212 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%).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/octet-stream": {"schema": {"description": "Single Apache Parquet file (zstd-compressed) holding one day of punctuality observations derived from the GTFS-RT trip-update stream. One row per (trip_id, start_date, start_time, stop_sequence, stop_id) observation, plus one synthetic row per cancelled trip-instance when the feed signals cancellation without stop-time entries.", "type": "string", "format": "binary", "x-parquet-schema": {"trip_id": {"type": "string", "description": "GTFS trip identifier as published in the realtime feed (no `gt:<feed>:` prefix)."}, "start_date": {"type": "string", "description": "Service date in YYYYMMDD (operator local), identifies the trip-instance together with trip_id and start_time."}, "start_time": {"type": "string", "description": "Trip start time in HH:MM:SS (operator local). May be empty if the feed omits it."}, "stop_sequence": {"type": "integer", "description": "Stop position within the trip. Null when the feed does not publish a sequence (e.g. SNCB) or for a cancelled-trip synthetic row."}, "stop_id": {"type": "string", "description": "GTFS stop identifier (no `gs:<feed>:` prefix). Null for a cancelled-trip synthetic row."}, "route_id": {"type": "string", "description": "GTFS route identifier; empty when not provided by the feed."}, "direction_id": {"type": "integer", "description": "Direction of travel (0 / 1). Null when the feed omits it."}, "trip_schedule_relationship": {"type": "integer", "description": "GTFS-RT TripDescriptor.ScheduleRelationship: 0 SCHEDULED, 1 ADDED, 2 UNSCHEDULED, 3 CANCELED, 4 REPLACEMENT, 5 DUPLICATED, 6 DELETED."}, "arrival_time": {"type": "string", "format": "date-time", "description": "Latest known actual arrival timestamp (UTC). Null if the feed only publishes delays."}, "arrival_delay": {"type": "integer", "description": "Latest known arrival delay in seconds (positive = late). Null when the feed has no delay info for this stop."}, "departure_time": {"type": "string", "format": "date-time", "description": "Latest known actual departure timestamp (UTC). Null if the feed only publishes delays."}, "departure_delay": {"type": "integer", "description": "Latest known departure delay in seconds. Null when the feed has no delay info."}, "stop_schedule_relationship": {"type": "integer", "description": "GTFS-RT StopTimeUpdate.ScheduleRelationship: 0 SCHEDULED, 1 SKIPPED, 2 NO_DATA, 3 UNSCHEDULED."}, "cancelled": {"type": "boolean", "description": "True when the trip is CANCELED at trip level or the stop is SKIPPED at stop level."}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "# pip install polars requests\nimport io\nimport requests\nimport polars as pl\n\nfrom datetime import datetime, timedelta, timezone\n\n# Yesterday's Brussels-day file (the harvester anchors windows to local midnight,\n# so any timestamp inside that day returns the same parquet).\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\"timestamp\": yesterday_noon.isoformat()}  # ISO accepted; epoch also works\n\nurl = \"https://api.mobilitytwin.brussels/de-lijn/punctuality\"\ndata = requests.get(url, headers={\n    \"Authorization\": \"Bearer [MY_API_KEY]\"\n}, params=params).content\n\ndf = pl.read_parquet(io.BytesIO(data))\n\nprint(f\"rows: {df.height:,}, columns: {df.columns}\")\n\n# Average arrival delay per route, ignoring cancellations and no-data rows.\ndelays = (\n    df.filter(pl.col(\"arrival_delay\").is_not_null() & ~pl.col(\"cancelled\"))\n      .group_by(\"route_id\")\n      .agg([\n          pl.col(\"arrival_delay\").mean().round(1).alias(\"mean_delay_s\"),\n          pl.col(\"arrival_delay\").quantile(0.9).alias(\"p90_delay_s\"),\n          pl.len().alias(\"n\"),\n      ])\n      .sort(\"mean_delay_s\", descending=True)\n)\nprint(\"\\nWorst 10 routes by mean arrival delay:\")\nprint(delays.head(10))\n\n# How many trips were cancelled and on which routes?\ncancellations = (\n    df.filter(pl.col(\"cancelled\"))\n      .select([\"route_id\", \"trip_id\", \"start_date\", \"start_time\"])\n      .unique()\n)\nprint(f\"\\ncancelled trip-instances: {cancellations.height:,}\")\nprint(cancellations.group_by(\"route_id\").len()\n      .sort(\"len\", descending=True).head(10))\n"}]}}, "/micromobility/lime": {"get": {"summary": "Lime", "tags": ["SCOOTER AND BIKE POSITIONS"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Lime vehicles in Brussels, until Lime left the city.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>No longer updated \u2014 Lime has ceased operations in Brussels; historical data only</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:47</td></tr><tr><td>End date</td><td>2026-02-18 10:04:33</td></tr><tr><td>Count</td><td>106040</td></tr></table>", "x-refresh": "No longer updated \u2014 Lime has ceased operations in Brussels; historical data only", "x-description": "Positions of Lime vehicles in Brussels, until Lime left the city.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}, {"description": "Start of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}, {"description": "Maximum number of snapshots, at most 100.", "schema": {"type": "integer"}, "in": "query", "name": "limit"}, {"description": "Number of snapshots to skip, to page through a range.", "schema": {"type": "integer"}, "in": "query", "name": "offset"}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_range_meters": {"type": "integer"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "last_reported": {"type": "integer"}, "vehicle_type": {"type": "string"}, "vehicle_type_id": {"type": "string"}}, "required": ["bike_id", "current_range_meters", "is_disabled", "is_reserved", "last_reported", "vehicle_type", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/micromobility/lime\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Lime vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), color=\"#00b140\", markersize=5)"}]}}, "/micromobility/dott": {"get": {"summary": "Dott", "tags": ["SCOOTER AND BIKE POSITIONS"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Dott vehicles in Brussels.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:39</td></tr><tr><td>End date</td><td>2026-11-20 21:43:08</td></tr><tr><td>Count</td><td>206836</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Positions of Dott vehicles in Brussels.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}, {"description": "Start of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}, {"description": "Maximum number of snapshots, at most 100.", "schema": {"type": "integer"}, "in": "query", "name": "limit"}, {"description": "Number of snapshots to skip, to page through a range.", "schema": {"type": "integer"}, "in": "query", "name": "offset"}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_range_meters": {"type": "number"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "last_reported": {"type": "integer"}, "pricing_plan_id": {"type": "string"}, "rental_uris.android": {"type": "string"}, "rental_uris.ios": {"type": "string"}, "vehicle_type_id": {"type": "string"}, "current_fuel_percent": {"type": ["number", "null"], "description": "Battery level as a fraction from 0 to 1 (GBFS), not a percentage."}}, "required": ["bike_id", "current_range_meters", "is_disabled", "is_reserved", "last_reported", "pricing_plan_id", "rental_uris.android", "rental_uris.ios", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/micromobility/dott\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Dott vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), color=\"#0a80b4\", markersize=5)"}]}}, "/micromobility/pony": {"get": {"summary": "Pony", "tags": ["SCOOTER AND BIKE POSITIONS"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Pony vehicles in Brussels, until Pony left the city.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>No longer updated \u2014 Pony has ceased operations in Brussels; historical data only</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:39</td></tr><tr><td>End date</td><td>2025-09-15 15:47:23</td></tr><tr><td>Count</td><td>92866</td></tr></table>", "x-refresh": "No longer updated \u2014 Pony has ceased operations in Brussels; historical data only", "x-description": "Positions of Pony vehicles in Brussels, until Pony left the city.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}, {"description": "Start of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}, {"description": "Maximum number of snapshots, at most 100.", "schema": {"type": "integer"}, "in": "query", "name": "limit"}, {"description": "Number of snapshots to skip, to page through a range.", "schema": {"type": "integer"}, "in": "query", "name": "offset"}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_fuel_percent": {"type": "number"}, "current_range_meters": {"type": "number"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "last_reported": {"type": "integer"}, "pricing_plan_id": {"type": "string"}, "rental_uris.android": {"type": "string"}, "rental_uris.ios": {"type": "string"}, "system_id": {"type": "string"}, "vehicle_type_id": {"type": "string"}}, "required": ["bike_id", "current_fuel_percent", "current_range_meters", "is_disabled", "is_reserved", "last_reported", "pricing_plan_id", "rental_uris.android", "rental_uris.ios", "system_id", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/micromobility/pony\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Pony vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), color=\"#2efffe\", markersize=5)"}]}}, "/micromobility/bolt": {"get": {"summary": "Bolt", "tags": ["SCOOTER AND BIKE POSITIONS"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Bolt vehicles in Brussels.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:39</td></tr><tr><td>End date</td><td>2026-11-20 21:45:13</td></tr><tr><td>Count</td><td>210987</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Positions of Bolt vehicles in Brussels.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}, {"description": "Start of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "start_timestamp", "required": false}, {"description": "End of the range, in Unix seconds or ISO 8601.", "schema": {"type": "string"}, "in": "query", "name": "end_timestamp", "required": false}, {"description": "Maximum number of snapshots, at most 100.", "schema": {"type": "integer"}, "in": "query", "name": "limit"}, {"description": "Number of snapshots to skip, to page through a range.", "schema": {"type": "integer"}, "in": "query", "name": "offset"}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_range_meters": {"type": "integer"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "pricing_plan_id": {"type": "string"}, "rental_uris.android": {"type": "string"}, "rental_uris.ios": {"type": "string"}, "vehicle_type_id": {"type": "string"}, "current_fuel_percent": {"type": ["number", "null"], "description": "Battery level as a fraction from 0 to 1 (GBFS), not a percentage."}}, "required": ["bike_id", "current_range_meters", "is_disabled", "is_reserved", "pricing_plan_id", "rental_uris.android", "rental_uris.ios", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/micromobility/bolt\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Bolt vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), color=\"#050187\", markersize=5)"}]}}, "/lime/vehicle-position": {"get": {"summary": "Vehicle position", "tags": ["LIME"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Lime vehicles in Brussels, until Lime left the city.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>No longer updated \u2014 Lime has ceased operations in Brussels; historical data only</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:47</td></tr><tr><td>End date</td><td>2026-02-18 10:04:33</td></tr><tr><td>Count</td><td>106040</td></tr></table>", "x-refresh": "No longer updated \u2014 Lime has ceased operations in Brussels; historical data only", "x-description": "Positions of Lime vehicles in Brussels, until Lime left the city.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_range_meters": {"type": "integer"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "last_reported": {"type": "integer"}, "vehicle_type": {"type": "string"}, "vehicle_type_id": {"type": "string"}}, "required": ["bike_id", "current_range_meters", "is_disabled", "is_reserved", "last_reported", "vehicle_type", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/lime/vehicle-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Lime vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), color=\"#00b140\", markersize=5)"}]}}, "/dott/vehicle-position": {"get": {"summary": "Vehicle position", "tags": ["DOTT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Dott vehicles in Brussels.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:39</td></tr><tr><td>End date</td><td>2026-11-20 21:43:08</td></tr><tr><td>Count</td><td>206836</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Positions of Dott vehicles in Brussels.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_range_meters": {"type": "number"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "last_reported": {"type": "integer"}, "pricing_plan_id": {"type": "string"}, "rental_uris.android": {"type": "string"}, "rental_uris.ios": {"type": "string"}, "vehicle_type_id": {"type": "string"}, "current_fuel_percent": {"type": ["number", "null"], "description": "Battery level as a fraction from 0 to 1 (GBFS), not a percentage."}}, "required": ["bike_id", "current_range_meters", "is_disabled", "is_reserved", "last_reported", "pricing_plan_id", "rental_uris.android", "rental_uris.ios", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/dott/vehicle-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Dott vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), column='current_range_meters', legend=True, markersize=5)"}]}}, "/dott/geofences": {"get": {"summary": "Geofences", "tags": ["DOTT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The geofences of Dott in Brussels<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 03:30:01</td></tr><tr><td>End date</td><td>2026-11-20 02:30:00</td></tr><tr><td>Count</td><td>703</td></tr></table>", "x-refresh": "Daily", "x-description": "The geofences of Dott in Brussels", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"items": {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, "type": "array"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "properties": {"properties": {"name": {"type": "string", "description": "Zone name. Optional in GBFS 2.3."}, "rules": {"items": {"properties": {"maximum_speed_kph": {"type": "integer"}, "ride_allowed": {"type": "boolean"}, "ride_through_allowed": {"type": "boolean"}, "station_parking": {"type": "boolean"}, "vehicle_type_id": {"items": {"type": "string"}, "type": "array"}}, "required": ["ride_allowed", "ride_through_allowed", "station_parking", "vehicle_type_id"], "type": "object"}, "type": "array"}}, "required": ["rules"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/dott/geofences\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\ngdf[\"name\"] = gdf[\"name\"].fillna(\"unnamed zone\") if \"name\" in gdf else \"unnamed zone\"   # most zones have no name\n\n# Show restricted zones and speed limits\nfor _, zone in gdf.iterrows():\n    rules = zone.get('rules', [])\n    for rule in rules:\n        speed = rule.get('maximum_speed_kph', 'N/A')\n        print(f\"{zone['name']}: max {speed} km/h, ride_allowed={rule.get('ride_allowed')}\")\n\n# Plot geofence boundaries\ngdf.plot(figsize=(10, 8), alpha=0.3, edgecolor='blue')"}]}}, "/dott/vehicle-type": {"get": {"summary": "Vehicle type", "tags": ["DOTT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Vehicle type definitions (scooters, bikes) and specifications for Dott in Brussels (GBFS format).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 03:40:00</td></tr><tr><td>End date</td><td>2026-11-20 02:40:00</td></tr><tr><td>Count</td><td>705</td></tr></table>", "x-refresh": "Daily", "x-description": "Vehicle type definitions (scooters, bikes) and specifications for Dott in Brussels (GBFS format).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"last_updated": {"type": "integer"}, "ttl": {"type": "integer"}, "version": {"type": "string"}, "data": {"type": "object", "properties": {"vehicle_types": {"type": "array", "items": {"type": "object", "properties": {"vehicle_type_id": {"type": "string"}, "propulsion_type": {"type": "string"}, "form_factor": {"type": "string"}, "max_range_meters": {"type": "integer"}, "pricing_plan_ids": {"type": "array", "items": {"type": "string"}}}, "required": ["vehicle_type_id", "propulsion_type", "form_factor", "max_range_meters"]}}}, "required": ["vehicle_types"]}}, "required": ["last_updated", "ttl", "version", "data"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/dott/vehicle-type\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# List all vehicle types and their specifications\nfor vtype in data['data']['vehicle_types']:\n    range_km = vtype['max_range_meters'] / 1000\n    print(f\"{vtype['vehicle_type_id']} ({vtype['form_factor']}): {vtype['propulsion_type']}, range {range_km:.0f} km\")"}]}}, "/pony/vehicle-position": {"get": {"summary": "Vehicle position", "tags": ["PONY"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Pony vehicles in Brussels, until Pony left the city.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>No longer updated \u2014 Pony has ceased operations in Brussels; historical data only</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:39</td></tr><tr><td>End date</td><td>2025-09-15 15:47:23</td></tr><tr><td>Count</td><td>92866</td></tr></table>", "x-refresh": "No longer updated \u2014 Pony has ceased operations in Brussels; historical data only", "x-description": "Positions of Pony vehicles in Brussels, until Pony left the city.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_fuel_percent": {"type": "number"}, "current_range_meters": {"type": "number"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "last_reported": {"type": "integer"}, "pricing_plan_id": {"type": "string"}, "rental_uris.android": {"type": "string"}, "rental_uris.ios": {"type": "string"}, "system_id": {"type": "string"}, "vehicle_type_id": {"type": "string"}}, "required": ["bike_id", "current_fuel_percent", "current_range_meters", "is_disabled", "is_reserved", "last_reported", "pricing_plan_id", "rental_uris.android", "rental_uris.ios", "system_id", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/pony/vehicle-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Pony vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), color=\"#2efffe\", markersize=5)"}]}}, "/pony/geofences": {"get": {"summary": "Geofences", "tags": ["PONY"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The geofences of Pony in Brussels<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>No longer updated \u2014 Pony has ceased operations in Brussels; historical data only</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 04:45:01</td></tr><tr><td>End date</td><td>2025-09-15 04:45:01</td></tr><tr><td>Count</td><td>289</td></tr></table>", "x-refresh": "No longer updated \u2014 Pony has ceased operations in Brussels; historical data only", "x-description": "The geofences of Pony in Brussels", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"items": {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, "type": "array"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "properties": {"properties": {"name": {"type": "string", "description": "Zone name. Optional in GBFS 2.3."}, "rules": {"items": {"properties": {"maximum_speed_kph": {"type": "integer"}, "ride_allowed": {"type": "boolean"}, "ride_through_allowed": {"type": "boolean"}, "station_parking": {"type": "boolean"}, "vehicle_type_id": {"items": {"type": "string"}, "type": "array"}, "ride_start_allowed": {"type": "boolean"}, "ride_end_allowed": {"type": "boolean"}, "vehicle_type_ids": {"type": "array", "items": {"type": "string"}}}, "required": ["ride_allowed", "ride_through_allowed", "vehicle_type_id"], "type": "object"}, "type": "array"}}, "required": ["rules"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/pony/geofences\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show restricted zones and speed limits\nfor _, zone in gdf.iterrows():\n    rules = zone.get('rules', [])\n    for rule in rules:\n        speed = rule.get('maximum_speed_kph', 'N/A')\n        print(f\"{zone['name']}: max {speed} km/h, ride_allowed={rule.get('ride_allowed')}\")\n\n# Plot geofence boundaries\ngdf.plot(figsize=(10, 8), alpha=0.3, edgecolor='cyan')"}]}}, "/bolt/vehicle-position": {"get": {"summary": "Vehicle position", "tags": ["BOLT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of Bolt vehicles in Brussels.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:39</td></tr><tr><td>End date</td><td>2026-11-20 21:45:13</td></tr><tr><td>Count</td><td>210987</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Positions of Bolt vehicles in Brussels.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"bike_id": {"type": "string"}, "current_range_meters": {"type": "integer"}, "is_disabled": {"type": "boolean"}, "is_reserved": {"type": "boolean"}, "pricing_plan_id": {"type": "string"}, "rental_uris.android": {"type": "string"}, "rental_uris.ios": {"type": "string"}, "vehicle_type_id": {"type": "string"}, "current_fuel_percent": {"type": ["number", "null"], "description": "Battery level as a fraction from 0 to 1 (GBFS), not a percentage."}}, "required": ["bike_id", "current_range_meters", "is_disabled", "is_reserved", "pricing_plan_id", "rental_uris.android", "rental_uris.ios", "vehicle_type_id"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/bolt/vehicle-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show available vehicles with battery range\navailable = gdf[~gdf['is_disabled'] & ~gdf['is_reserved']]\nprint(f\"Available Bolt vehicles: {len(available)} / {len(gdf)}\")\nprint(f\"Average range: {available['current_range_meters'].mean() / 1000:.1f} km\")\n\n# Plot vehicle positions\navailable.plot(figsize=(10, 8), column='current_range_meters', legend=True, markersize=5)"}]}}, "/bolt/geofences": {"get": {"summary": "Geofences", "tags": ["BOLT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The geofences of Bolt in Brussels<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 04:00:01</td></tr><tr><td>End date</td><td>2026-11-20 03:00:01</td></tr><tr><td>Count</td><td>712</td></tr></table>", "x-refresh": "Daily", "x-description": "The geofences of Bolt in Brussels", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"items": {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, "type": "array"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "properties": {"properties": {"name": {"type": "string", "description": "Zone name. Optional in GBFS 2.3."}, "rules": {"items": {"properties": {"maximum_speed_kph": {"type": "integer"}, "ride_allowed": {"type": "boolean"}, "ride_through_allowed": {"type": "boolean"}, "vehicle_type_id": {"items": {"type": "string"}, "type": "array"}}, "required": ["ride_allowed", "ride_through_allowed", "vehicle_type_id"], "type": "object"}, "type": "array"}}, "required": ["rules"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/bolt/geofences\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show restricted zones and speed limits\nfor _, zone in gdf.iterrows():\n    rules = zone.get('rules', [])\n    for rule in rules:\n        speed = rule.get('maximum_speed_kph', 'N/A')\n        print(f\"{zone['name']}: max {speed} km/h, ride_allowed={rule.get('ride_allowed')}\")\n\n# Plot geofence boundaries\ngdf.plot(figsize=(10, 8), alpha=0.3, edgecolor='red')"}]}}, "/bolt/vehicle-type": {"get": {"summary": "Vehicle type", "tags": ["BOLT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Vehicle type definitions (scooters, bikes) and specifications for Bolt in Brussels (GBFS format).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 05:00:01</td></tr><tr><td>End date</td><td>2026-11-20 04:00:00</td></tr><tr><td>Count</td><td>709</td></tr></table>", "x-refresh": "Daily", "x-description": "Vehicle type definitions (scooters, bikes) and specifications for Bolt in Brussels (GBFS format).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"last_updated": {"type": "integer"}, "ttl": {"type": "integer"}, "version": {"type": "string"}, "data": {"type": "object", "properties": {"vehicle_types": {"type": "array", "items": {"type": "object", "properties": {"vehicle_type_id": {"type": "string"}, "propulsion_type": {"type": "string"}, "form_factor": {"type": "string"}, "max_range_meters": {"type": "integer", "description": "Maximum range in metres with a full charge. Required by GBFS when propulsion_type is not human; absent for human-powered vehicles."}, "name": {"type": "string"}, "return_constraint": {"type": "string"}, "default_reserve_time": {"type": "integer"}}, "required": ["vehicle_type_id", "propulsion_type", "form_factor", "name"]}}}, "required": ["vehicle_types"]}}, "required": ["last_updated", "ttl", "version", "data"]}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/bolt/vehicle-type\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# List all vehicle types and their specifications\nfor vtype in data['data']['vehicle_types']:\n    # max_range_meters is only given for motorised vehicles, and not for all of them\n    range_km = f\"{vtype['max_range_meters'] / 1000:.0f} km\" if vtype.get('max_range_meters') else \"n/a\"\n    print(f\"{vtype['name']} ({vtype['form_factor']}): {vtype['propulsion_type']}, range {range_km}\")"}]}}, "/traffic/telraam": {"get": {"summary": "Telraam", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The Telraam counts of the Brussels segments, one feature per segment: <code>date</code> is the start of the last completed UTC hour, published about 15 minutes after that hour ends. A segment that sent no report for that hour has <code>date</code> \"NaT\" and empty counts.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:39</td></tr><tr><td>End date</td><td>2026-11-20 21:41:58</td></tr><tr><td>Count</td><td>211023</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "The Telraam counts of the Brussels segments, one feature per segment: <code>date</code> is the start of the last completed UTC hour, published about 15 minutes after that hour ends. A segment that sent no report for that hour has <code>date</code> \"NaT\" and empty counts.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "properties": {"properties": {"bike": {"type": ["number", "string"]}, "car": {"type": ["number", "string"]}, "date": {"type": "string"}, "heavy": {"type": ["number", "string"]}, "last_data_package": {"type": "string"}, "pedestrian": {"type": ["number", "string"]}, "period": {"type": "string"}, "segment_id": {"type": "integer"}, "timezone": {"type": "string"}, "uptime": {"type": ["number", "string"]}, "v85": {"type": ["number", "string"]}}, "required": ["bike", "car", "date", "heavy", "last_data_package", "pedestrian", "period", "segment_id", "timezone", "uptime", "v85"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "properties", "type"], "type": "object"}, "type": "array"}, "message": {"type": "string"}, "status_code": {"type": "integer"}, "type": {"type": "string"}}, "required": ["features", "message", "status_code", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/telraam\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n# Segments without a report for the hour have empty counts (and date \"NaT\")\nfor column in ['car', 'heavy', 'bike', 'pedestrian', 'v85']:\n    gdf[column] = pd.to_numeric(gdf[column], errors='coerce')\n\n# Analyze traffic composition per segment\nfor _, seg in gdf.dropna(subset=['car', 'v85']).head(5).iterrows():\n    print(f\"Segment {seg['segment_id']}: {seg['car']:.0f} cars, {seg['bike']:.0f} bikes, \"\n          f\"{seg['heavy']:.0f} heavy, v85={seg['v85']:.0f} km/h\")\n\n# Plot segments colored by speed\ngdf.plot(figsize=(12, 10), column='v85', legend=True, linewidth=2, cmap='RdYlGn')"}]}}, "/traffic/tunnels": {"get": {"summary": "Tunnels", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Live vehicle counts, speed and occupancy from the detectors in the Brussels tunnels, keyed by detector. Only the 1-minute bins are filled. For positions, join with <b>tunnel-devices</b> on <code>traverse_name</code>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every minute</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:55:38</td></tr><tr><td>End date</td><td>2026-11-20 21:45:32</td></tr><tr><td>Count</td><td>1080111</td></tr></table>", "x-refresh": "Every minute", "x-description": "Live vehicle counts, speed and occupancy from the detectors in the Brussels tunnels, keyed by detector. Only the 1-minute bins are filled. For positions, join with <b>tunnel-devices</b> on <code>traverse_name</code>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"data": {"properties": {"{DEVICE_ID_STRING}": {"properties": {"results": {"properties": {"15m": {"properties": {"t1": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}, "t2": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}}, "required": ["t1", "t2"], "type": "object"}, "1m": {"properties": {"t1": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}, "t2": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}}, "required": ["t1", "t2"], "type": "object"}, "5m": {"properties": {"t1": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}, "t2": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}}, "required": ["t1", "t2"], "type": "object"}, "60m": {"properties": {"t1": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}, "t2": {"properties": {"count": {"type": "integer"}, "end_time": {"type": "string"}, "occupancy": {"type": "number"}, "speed": {"type": "number"}, "start_time": {"type": "string"}}, "required": ["count", "end_time", "occupancy", "speed", "start_time"], "type": "object"}}, "required": ["t1", "t2"], "type": "object"}}, "required": ["15m", "1m", "5m", "60m"], "type": "object"}}, "required": ["results"], "type": "object"}}, "required": ["ARL_103", "ARL_203", "BAI_TD1", "BAI_TD2", "BEL_TD4", "BEL_TD5", "BET_TD2_12", "BET_TD2_6", "BET_TD3", "BE_TD1", "BOT_TD2", "CIN_TD1", "CIN_TD2", "DEL_103", "HAL_191", "HAL_292", "LEO_110", "LEO_112", "LEO_116", "LEO_117", "LEO_124", "LEO_128", "LEO_129", "LEO_131", "LEO_135", "LEO_138", "LEO_204", "LEO_207_12", "LEO_207_5", "LEO_210", "LEO_211", "LEO_219", "LEO_230", "LEO_235", "LOI_103", "LOI_109", "LOU_110", "LOU_TD1", "LOU_TD2", "MAD_103", "MAD_203", "MON_TD1", "MON_TD2", "NATO_104", "NATO_204", "PNA_103", "PNA_203", "RCE_TD1", "RME_TD1", "RME_TD2", "RMO_TD1", "RMO_TD2", "ROG_TD1", "ROG_TD2", "SB020_BAout", "SB020_BBin", "SB020_BCin", "SB020_BDout", "SB0236_BCout", "SB0236_BHout", "SB0246_BAout", "SB0246_BXout", "SB1201_BAout", "SB121_BBin", "SB125_BBout", "SGN02_BAout", "SGN02_BBout", "STE_TD1", "STE_TD2", "STE_TD3", "SUL62_BA1out", "SUL62_BDin", "SUL62_BDout", "SUL62_BGin", "SUL62_BGout", "SUL62_BHin", "SUL62_BHout", "SWB22_VL_XA2", "SWB22_VL_XB2", "TER_TD1", "TER_TD2", "TEST_ARLON", "TRO_203", "TRO_TD1", "TRO_TD2", "VLE_103", "VLE_203", "VP_103", "VP_203"], "type": "object"}, "requestDate": {"type": "string"}}, "required": ["data", "requestDate"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/tunnels\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Show real-time traffic per tunnel device\nfor device_id, device_data in data['data'].items():\n    results = device_data['results']\n    # Get 15-minute aggregate\n    r = results['15m']\n    for lane, stats in r.items():\n        if stats['speed'] is None:          # no measurement for this lane in the period\n            continue\n        print(f\"{device_id} ({lane}): {stats['count']} vehicles, \"\n              f\"speed={stats['speed']:.0f} km/h, occupancy={stats['occupancy']:.1f}%\")"}]}}, "/traffic/tunnel-devices": {"get": {"summary": "Tunnel devices", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The positions of the traffic detectors in the Brussels tunnels. Their readings are in <b>tunnels</b>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 06:00:01</td></tr><tr><td>End date</td><td>2026-11-20 05:00:00</td></tr><tr><td>Count</td><td>701</td></tr></table>", "x-refresh": "Daily", "x-description": "The positions of the traffic detectors in the Brussels tunnels. Their readings are in <b>tunnels</b>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": ["null", "number"]}, "type": "array"}, "geometry_name": {"type": "string"}, "type": {"type": "string"}}, "required": ["coordinates", "geometry_name", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"descr_en": {"type": "string"}, "descr_fr": {"type": "string"}, "descr_nl": {"type": "string"}, "detectors": {"items": {"type": "string"}, "type": "array"}, "number_of_lanes": {"type": "integer"}, "orientation": {"type": ["integer", "null"]}, "traverse_name": {"type": "string"}}, "required": ["descr_en", "descr_fr", "descr_nl", "detectors", "number_of_lanes", "orientation", "traverse_name"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "requestDate": {"type": "string"}, "totalFeatures": {"type": "integer"}, "type": {"type": "string"}}, "required": ["features", "requestDate", "totalFeatures", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/tunnel-devices\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# List all tunnel monitoring devices\nfor _, device in gdf.iterrows():\n    print(f\"{device['traverse_name']}: {device['descr_fr']}\")\n\n# Plot device locations on a map\ngdf.plot(figsize=(10, 8), color=\"orange\", markersize=20)"}]}}, "/traffic/bike-count": {"get": {"summary": "Bike count", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Live counts from the Brussels bike counters, keyed by counter id. Their positions are in <b>bike-counters</b>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every minute</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:55:38</td></tr><tr><td>End date</td><td>2026-11-20 21:45:24</td></tr><tr><td>Count</td><td>1080419</td></tr></table>", "x-refresh": "Every minute", "x-description": "Live counts from the Brussels bike counters, keyed by counter id. Their positions are in <b>bike-counters</b>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"data": {"additionalProperties": {"properties": {"cnt_time": {"type": "string"}, "day_cnt": {"type": "integer"}, "hour_cnt": {"type": "integer"}, "year_cnt": {"type": "integer"}}, "required": ["cnt_time", "day_cnt", "hour_cnt", "year_cnt"], "type": "object"}, "description": "Counts keyed by counter id (device_name in bike-counters); only counters that are reporting are listed.", "type": "object"}, "requestDate": {"type": "string"}}, "required": ["data", "requestDate"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/bike-count\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Show bike counts per counter (hourly, daily, yearly)\nfor counter_id, counter_data in data['data'].items():\n    hourly = counter_data.get('hour_cnt', 0)\n    daily = counter_data.get('day_cnt', 0)\n    yearly = counter_data.get('year_cnt', 0)\n    print(f\"{counter_id}: {hourly} this hour, {daily} today, {yearly} this year\")"}]}}, "/traffic/bike-counters": {"get": {"summary": "Bike counters", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The positions of the Brussels bike counters. Their counts are in <b>bike-count</b>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-22 06:00:00</td></tr><tr><td>End date</td><td>2026-11-20 05:00:00</td></tr><tr><td>Count</td><td>701</td></tr></table>", "x-refresh": "Daily", "x-description": "The positions of the Brussels bike counters. Their counts are in <b>bike-count</b>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "geometry_name": {"type": "string"}, "type": {"type": "string"}}, "required": ["coordinates", "geometry_name", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"active": {"type": "boolean"}, "basic_schema": {"type": "string"}, "descr_en": {"type": "string"}, "descr_fr": {"type": "string"}, "descr_nl": {"type": "string"}, "detailed_schema": {"type": "string"}, "device_name": {"type": "string"}, "lane_schema": {"type": "string"}, "picture_1": {"type": "string"}, "picture_2": {"type": "string"}, "road_en": {"type": "string"}, "road_fr": {"type": "string"}, "road_nl": {"type": "string"}}, "required": ["active", "basic_schema", "descr_en", "descr_fr", "descr_nl", "detailed_schema", "device_name", "lane_schema", "picture_1", "picture_2", "road_en", "road_fr", "road_nl"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "requestDate": {"type": "string"}, "totalFeatures": {"type": "integer"}, "type": {"type": "string"}}, "required": ["features", "requestDate", "totalFeatures", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/bike-counters\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# List all active bike counters with their location\nactive = gdf[gdf['active'] == True]\nfor _, counter in active.iterrows():\n    print(f\"{counter['device_name']}: {counter.get('road_fr', 'N/A')}\")\n\n# Plot counter locations\nactive.plot(figsize=(10, 8), color=\"green\", markersize=30)"}]}}, "/traffic/message-signs": {"get": {"summary": "Message signs", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>What the variable message signs on the Brussels motorways, ring and tunnels currently display, one\nentry per sign: up to four lines in French (<code>fr_l1</code>\u2013<code>fr_l4</code>) and Dutch (<code>nl_l1</code>\u2013<code>nl_l4</code>),\nan optional pictogram URL (<code>picto</code>), and a <code>status</code> (\"OK\" or \"Non OK\" when the sign is not\nreporting). <code>last_update</code> is in Brussels local time. There are no positions here: join on\n<code>id_mobigis</code> with the <code>message-sign-locations</code> endpoint.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every minute</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-10-22 14:19:37</td></tr><tr><td>End date</td><td>2026-11-20 21:45:42</td></tr><tr><td>Count</td><td>31245</td></tr></table>", "x-refresh": "Every minute", "x-description": "What the variable message signs on the Brussels motorways, ring and tunnels currently display, one\nentry per sign: up to four lines in French (<code>fr_l1</code>\u2013<code>fr_l4</code>) and Dutch (<code>nl_l1</code>\u2013<code>nl_l4</code>),\nan optional pictogram URL (<code>picto</code>), and a <code>status</code> (\"OK\" or \"Non OK\" when the sign is not\nreporting). <code>last_update</code> is in Brussels local time. There are no positions here: join on\n<code>id_mobigis</code> with the <code>message-sign-locations</code> endpoint.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"type": "null"}, "id": {"type": "string"}, "links": {"items": {"properties": {"href": {"type": "string"}, "rel": {"type": "string"}, "title": {"type": "string"}, "type": {"type": "string"}}, "required": ["href", "rel", "title", "type"], "type": "object"}, "type": "array"}, "properties": {"properties": {"fid": {"type": "integer"}, "fr_l1": {"type": "string"}, "fr_l2": {"type": "string"}, "fr_l3": {"type": "string"}, "fr_l4": {"type": "string"}, "id_mobigis": {"type": "string"}, "last_update": {"type": "string"}, "localisation": {"type": "string"}, "nl_l1": {"type": "string"}, "nl_l2": {"type": "string"}, "nl_l3": {"type": "string"}, "nl_l4": {"type": "string"}, "picto": {"type": "string"}, "sens": {"type": "string"}, "status": {"type": "string"}}, "required": ["fid", "fr_l1", "fr_l2", "fr_l3", "fr_l4", "id_mobigis", "last_update", "localisation", "nl_l1", "nl_l2", "nl_l3", "nl_l4", "picto", "sens", "status"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "links", "properties", "type"], "type": "object"}, "type": "array"}, "links": {"items": {"properties": {"href": {"type": "string"}, "rel": {"type": "string"}, "title": {"type": "string"}, "type": {"type": "string"}}, "required": ["href", "rel", "title", "type"], "type": "object"}, "type": "array"}, "numberMatched": {"type": "integer"}, "numberReturned": {"type": "integer"}, "timeStamp": {"type": "string"}, "type": {"type": "string"}}, "required": ["features", "links", "numberMatched", "numberReturned", "timeStamp", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\n\nurl = \"https://api.mobilitytwin.brussels/traffic/message-signs\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}).json()\n\n# Print what each working sign displays, in French\nfor feature in data[\"features\"]:\n    sign = feature[\"properties\"]\n    lines = [sign[f\"fr_l{i}\"] for i in range(1, 5) if sign[f\"fr_l{i}\"]]\n    if sign[\"status\"] == \"OK\" and lines:\n        print(f\"{sign['id_mobigis']} ({sign['localisation']}): {' / '.join(lines)}\")\n"}]}}, "/traffic/message-sign-locations": {"get": {"summary": "Message sign locations", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The positions of the variable message signs in Brussels, with the road (<code>localisation</code>), direction\n(<code>sens</code>) and road type (<code>typemg</code>). <code>id_mobigis</code> links each sign to what it displays in\nthe <code>message-signs</code> endpoint.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-10-22 14:19:33</td></tr><tr><td>End date</td><td>2026-11-20 05:20:00</td></tr><tr><td>Count</td><td>29</td></tr></table>", "x-refresh": "Daily", "x-description": "The positions of the variable message signs in Brussels, with the road (<code>localisation</code>), direction\n(<code>sens</code>) and road type (<code>typemg</code>). <code>id_mobigis</code> links each sign to what it displays in\nthe <code>message-signs</code> endpoint.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"bbox": {"items": {"type": "number"}, "type": "array"}, "crs": {"properties": {"properties": {"properties": {"name": {"type": "string"}}, "required": ["name"], "type": "object"}, "type": {"type": "string"}}, "required": ["properties", "type"], "type": "object"}, "features": {"items": {"properties": {"bbox": {"items": {"type": "number"}, "type": "array"}, "geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "geometry_name": {"type": "string"}, "id": {"type": "string"}, "properties": {"properties": {"distance": {"type": "number"}, "fid": {"type": "integer"}, "id_mobigis": {"type": "string"}, "index": {"type": "integer"}, "live_display": {"type": "string"}, "localisation": {"type": ["null", "string"]}, "quadrant": {"type": "string"}, "segment": {"type": "integer"}, "sens": {"type": ["null", "string"]}, "type": {"type": "string"}, "typemg": {"type": ["null", "string"]}}, "required": ["distance", "fid", "id_mobigis", "index", "live_display", "localisation", "quadrant", "segment", "sens", "type", "typemg"], "type": "object"}, "type": {"type": "string"}}, "required": ["bbox", "geometry", "geometry_name", "id", "properties", "type"], "type": "object"}, "type": "array"}, "numberReturned": {"type": "integer"}, "timeStamp": {"type": "string"}, "totalFeatures": {"type": "string"}, "type": {"type": "string"}}, "required": ["bbox", "crs", "features", "numberReturned", "timeStamp", "totalFeatures", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\nimport geopandas as gpd\n\nheaders = {'Authorization': 'Bearer [MY_API_KEY]'}\n\nlocations = requests.get(\n    \"https://api.mobilitytwin.brussels/traffic/message-sign-locations\", headers=headers\n).json()\ndisplays = requests.get(\n    \"https://api.mobilitytwin.brussels/traffic/message-signs\", headers=headers\n).json()\n\ngdf = gpd.GeoDataFrame.from_features(locations[\"features\"])\nshown = pd.DataFrame([f[\"properties\"] for f in displays[\"features\"]])\n\n# Put each sign's current text on the map\ngdf = gdf.merge(shown[[\"id_mobigis\", \"status\", \"fr_l1\", \"fr_l2\"]], on=\"id_mobigis\", how=\"left\")\ngdf.plot(figsize=(10, 8), column=\"status\", legend=True, markersize=20)\n"}]}}, "/traffic/car-parks": {"get": {"summary": "Car parks", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The public car parks of Brussels, as published by Brussels Mobility: name, address, operator, contact,\n<code>capacity</code> and <code>disabledcapacity</code>, number of floors and maximum height (-999 when unknown). There is no\noccupancy.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-10-22 14:19:34</td></tr><tr><td>End date</td><td>2026-11-20 05:10:00</td></tr><tr><td>Count</td><td>29</td></tr></table>", "x-refresh": "Daily", "x-description": "The public car parks of Brussels, as published by Brussels Mobility: name, address, operator, contact,\n<code>capacity</code> and <code>disabledcapacity</code>, number of floors and maximum height (-999 when unknown). There is no\noccupancy.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"bbox": {"items": {"type": "number"}, "type": "array"}, "crs": {"properties": {"properties": {"properties": {"name": {"type": "string"}}, "required": ["name"], "type": "object"}, "type": {"type": "string"}}, "required": ["properties", "type"], "type": "object"}, "features": {"items": {"properties": {"bbox": {"items": {"type": "number"}, "type": "array"}, "geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "geometry_name": {"type": "string"}, "id": {"type": "string"}, "properties": {"properties": {"active": {"type": "boolean"}, "capacity": {"type": "integer"}, "contact_mail": {"type": "string"}, "contact_phone": {"type": ["null", "string"]}, "datexid": {"type": "string"}, "disabledcapacity": {"type": "integer"}, "extref": {"type": "string"}, "floors": {"type": "integer"}, "gid": {"type": "integer"}, "housenr": {"type": ["null", "string"]}, "lastmodified": {"type": "string"}, "maxheight": {"type": "number"}, "maxwidth": {"type": "number"}, "mu_fr": {"type": "string"}, "mu_nl": {"type": "string"}, "name_fr": {"type": "string"}, "name_nl": {"type": "string"}, "operator_fr": {"type": "string"}, "operator_id": {"type": "integer"}, "operator_nl": {"type": "string"}, "parkingid": {"type": "integer"}, "pccp": {"type": "string"}, "road_fr": {"type": "string"}, "road_nl": {"type": "string"}}, "required": ["active", "capacity", "contact_mail", "contact_phone", "datexid", "disabledcapacity", "extref", "floors", "gid", "housenr", "lastmodified", "maxheight", "maxwidth", "mu_fr", "mu_nl", "name_fr", "name_nl", "operator_fr", "operator_id", "operator_nl", "parkingid", "pccp", "road_fr", "road_nl"], "type": "object"}, "type": {"type": "string"}}, "required": ["bbox", "geometry", "geometry_name", "id", "properties", "type"], "type": "object"}, "type": "array"}, "numberReturned": {"type": "integer"}, "timeStamp": {"type": "string"}, "totalFeatures": {"type": "string"}, "type": {"type": "string"}}, "required": ["bbox", "crs", "features", "numberReturned", "timeStamp", "totalFeatures", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nurl = \"https://api.mobilitytwin.brussels/traffic/car-parks\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# The ten largest public car parks\nfor _, park in gdf.nlargest(10, \"capacity\").iterrows():\n    print(f\"{park['name_fr']} ({park['operator_fr']}): {park['capacity']} places\")\n\ngdf.plot(figsize=(10, 8), markersize=gdf[\"capacity\"] / 20, color=\"#1B2A4A\")\n"}]}}, "/traffic/bus-speed": {"get": {"summary": "Bus speed", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>The same data as <b>stib/speed</b>: how fast STIB/MIVB vehicles moved on their last move, per line, stop and direction.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 20 seconds (computed from STIB vehicle-distance)</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 02:00:04</td></tr><tr><td>End date</td><td>2026-11-20 21:45:31</td></tr><tr><td>Count</td><td>3373379</td></tr></table>", "x-refresh": "Every 20 seconds (computed from STIB vehicle-distance)", "x-description": "The same data as <b>stib/speed</b>: how fast STIB/MIVB vehicles moved on their last move, per line, stop and direction.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"items": {"properties": {"directionId": {"type": "string"}, "lineId": {"type": "string"}, "pointId": {"type": "string"}, "speed": {"type": "number"}}, "required": ["directionId", "lineId", "pointId", "speed"], "type": "object"}, "type": "array"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/bus-speed\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ndf = pd.DataFrame(data)\n\n# Average bus speed per line\nspeed_per_line = df.groupby('lineId')['speed'].mean().sort_values()\nprint(\"Average bus speed per line (km/h):\")\nprint(speed_per_line)\n\n# Find the slowest segments\nslowest = df.nsmallest(5, 'speed')[['lineId', 'pointId', 'speed']]\nprint(\"\\nSlowest bus segments:\")\nprint(slowest)"}]}}, "/traffic/events": {"get": {"summary": "Events", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Real-time traffic events in the Brussels-Capital Region (roadworks, accidents, congestion, etc.).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:05:24</td></tr><tr><td>End date</td><td>2026-11-20 21:45:40</td></tr><tr><td>Count</td><td>60094</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Real-time traffic events in the Brussels-Capital Region (roadworks, accidents, congestion, etc.).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"type": {"type": "string"}, "id": {"type": "integer"}, "geometry": {"type": "object", "properties": {"type": {"type": "string"}, "coordinates": {"type": "array", "items": {"type": "number"}}}}, "properties": {"type": "object", "properties": {"fid": {"type": "integer"}, "datex_codes": {"type": "string"}, "type_fr": {"type": "string"}, "type_nl": {"type": "string"}, "location_fr": {"type": "string"}, "location_nl": {"type": "string"}, "direction_fr": {"type": "string"}, "direction_nl": {"type": "string"}, "road_type_fr": {"type": "string"}, "road_type_nl": {"type": "string"}, "importance": {"type": "string"}, "consequences_fr": {"type": "string"}, "consequences_nl": {"type": "string"}, "impacted_lanes": {"type": ["string", "null"]}, "start_time": {"type": "string"}, "end_time": {"type": "string"}, "last_update": {"type": "string"}, "is_active": {"type": "boolean"}, "zone_fr": {"type": ["string", "null"]}, "zone_nl": {"type": ["string", "null"]}, "orientation": {"type": "string"}}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/events\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show active traffic events\nactive = gdf[gdf['is_active'] == True]\nfor _, event in active.head(10).iterrows():\n    print(f\"[{event['type_fr']}] {event['location_fr']} \u2014 {event['consequences_fr']}\")\n\n# Plot active events on a map\nactive.plot(figsize=(10, 8), color=\"red\", markersize=15)"}]}}, "/traffic/tmc-event-codes": {"get": {"summary": "TMC event codes", "tags": ["TRAFFIC"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>TMC (Traffic Message Channel) event codes reference data used for classifying traffic events in Brussels.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Weekly</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-04-29 11:31:02</td></tr><tr><td>End date</td><td>2026-11-16 20:20:59</td></tr><tr><td>Count</td><td>10</td></tr></table>", "x-refresh": "Weekly", "x-description": "TMC (Traffic Message Channel) event codes reference data used for classifying traffic events in Brussels.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"type": {"type": "string"}, "id": {"type": "string"}, "geometry": {"type": "null"}, "properties": {"type": "object", "properties": {"datex_code": {"type": "string"}, "descr_fr": {"type": "string"}, "descr_nl": {"type": "string"}, "descr_en": {"type": "string"}, "datex1_uri": {"type": "string"}, "datex2_class": {"type": "string"}, "datex2_enum_value": {"type": "string"}}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/traffic/tmc-event-codes\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Build a lookup table of TMC event codes\ncodes = pd.DataFrame([f['properties'] for f in data['features']])\nprint(\"TMC Event Codes:\")\nprint(codes[['datex_code', 'descr_en', 'datex2_class']].to_string(index=False))"}]}}, "/airplane/opensky-position": {"get": {"summary": "Opensky position", "tags": ["AIRPLANE"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Positions of aircraft over Belgium as reported by the OpenSky Network.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-02-25 16:01:32</td></tr><tr><td>End date</td><td>2026-11-20 21:41:38</td></tr><tr><td>Count</td><td>68707</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Positions of aircraft over Belgium as reported by the OpenSky Network.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"type": "string"}, "properties": {"type": "object", "properties": {"icao24": {"type": "string"}, "callsign": {"type": "string"}, "origin_country": {"type": ["string", "null"]}, "time_position": {"type": ["number", "null"]}, "last_contact": {"type": "integer"}, "baro_altitude": {"type": ["number", "null"]}, "on_ground": {"type": "boolean"}, "velocity": {"type": ["number", "null"]}, "true_track": {"type": ["number", "null"]}, "vertical_rate": {"type": ["number", "null"]}, "sensors": {"type": "null"}, "geo_altitude": {"type": ["number", "null"]}, "squawk": {"type": ["string", "null"]}, "spi": {"type": "boolean"}, "position_source": {"type": "string"}, "category": {"type": ["string", "null"]}}}, "geometry": {"type": "object", "properties": {"type": {"type": "string"}, "coordinates": {"type": "array", "items": {"type": "number"}}}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/airplane/opensky-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show aircraft currently over Belgium\nfor _, plane in gdf.head(10).iterrows():\n    alt = plane.get('baro_altitude', 0) or 0\n    speed = plane.get('velocity', 0) or 0\n    print(f\"{plane['callsign']} ({plane['origin_country']}): \"\n          f\"alt={alt:.0f}m, speed={speed:.0f} m/s\")\n\n# Plot aircraft positions\ngdf.plot(figsize=(10, 8), color=\"#e67e22\", markersize=10)"}]}}, "/airplane/adsb-lol-position": {"get": {"summary": "Adsb lol position", "tags": ["AIRPLANE"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Real-time positions of aircraft over Belgium, as reported by the\n<a href=\"https://adsb.lol\" target=\"_blank\">adsb.lol</a> community ADS-B network. Output schema mirrors the OpenSky\nendpoint so the two feeds are interchangeable; additional fields include <code>registration</code>,\n<code>aircraft_type</code> and <code>source_feed</code>. Data from adsb.lol, available under the\n<a href=\"https://opendatacommons.org/licenses/odbl/\" target=\"_blank\">Open Database License (ODbL)</a>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 4 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-10-04 15:34:08</td></tr><tr><td>End date</td><td>2026-11-20 21:44:54</td></tr><tr><td>Count</td><td>29654</td></tr></table>", "x-refresh": "Every 4 minutes", "x-description": "Real-time positions of aircraft over Belgium, as reported by the\n<a href=\"https://adsb.lol\" target=\"_blank\">adsb.lol</a> community ADS-B network. Output schema mirrors the OpenSky\nendpoint so the two feeds are interchangeable; additional fields include <code>registration</code>,\n<code>aircraft_type</code> and <code>source_feed</code>. Data from adsb.lol, available under the\n<a href=\"https://opendatacommons.org/licenses/odbl/\" target=\"_blank\">Open Database License (ODbL)</a>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"type": "string"}, "properties": {"type": "object", "properties": {"icao24": {"type": "string"}, "callsign": {"type": "string"}, "origin_country": {"type": "null"}, "time_position": {"type": ["number", "null"]}, "last_contact": {"type": "number"}, "baro_altitude": {"type": ["number", "null"]}, "on_ground": {"type": "boolean"}, "velocity": {"type": ["number", "null"]}, "true_track": {"type": ["number", "null"]}, "vertical_rate": {"type": ["number", "null"]}, "sensors": {"type": "null"}, "geo_altitude": {"type": ["number", "null"]}, "squawk": {"type": ["string", "null"]}, "spi": {"type": "boolean"}, "position_source": {"type": "string"}, "category": {"type": ["string", "null"]}, "registration": {"type": ["string", "null"]}, "aircraft_type": {"type": ["string", "null"]}, "source_feed": {"type": "string"}}}, "geometry": {"type": "object", "properties": {"type": {"type": "string"}, "coordinates": {"type": "array", "items": {"type": "number"}}}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/airplane/adsb-lol-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Schema mirrors opensky-position so the two feeds can be swapped freely.\nprint(f\"{len(gdf)} aircraft tracked right now\")\n\n# Show the lowest/loudest movers \u2014 useful for noise impact analysis.\nmoving = gdf[(gdf[\"velocity\"].fillna(0) > 5) & (~gdf[\"on_ground\"].fillna(False))]\nlowest = moving.nsmallest(10, \"baro_altitude\")[\n    [\"callsign\", \"registration\", \"aircraft_type\", \"baro_altitude\", \"velocity\"]\n]\nprint(lowest)\n\n# Plot\ngdf.plot(figsize=(10, 8), color=\"#27ae60\", markersize=10)\n"}]}}, "/airplane/unified-position": {"get": {"summary": "Unified position", "tags": ["AIRPLANE"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Unified real-time positions of aircraft, merging the OpenSky Network feed and adsb.lol.\nAircraft are deduplicated by <code>icao24</code> (with a callsign fallback). When both feeds see the same plane,\nthe adsb.lol position is preferred (more recent) but OpenSky-only attributes such as\n<code>origin_country</code> are kept. Each feature includes a <code>sources</code> array listing which feeds\nreported it (<code>\"opensky\"</code>, <code>\"adsb.lol\"</code>, or both). adsb.lol data is available under the\n<a href=\"https://opendatacommons.org/licenses/odbl/\" target=\"_blank\">Open Database License (ODbL)</a>.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-05-07 12:09:09</td></tr><tr><td>End date</td><td>2026-11-20 21:41:38</td></tr><tr><td>Count</td><td>47796</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Unified real-time positions of aircraft, merging the OpenSky Network feed and adsb.lol.\nAircraft are deduplicated by <code>icao24</code> (with a callsign fallback). When both feeds see the same plane,\nthe adsb.lol position is preferred (more recent) but OpenSky-only attributes such as\n<code>origin_country</code> are kept. Each feature includes a <code>sources</code> array listing which feeds\nreported it (<code>\"opensky\"</code>, <code>\"adsb.lol\"</code>, or both). adsb.lol data is available under the\n<a href=\"https://opendatacommons.org/licenses/odbl/\" target=\"_blank\">Open Database License (ODbL)</a>.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"type": "string"}, "properties": {"type": "object", "properties": {"icao24": {"type": "string"}, "callsign": {"type": "string"}, "origin_country": {"type": ["string", "null"]}, "time_position": {"type": ["number", "null"]}, "last_contact": {"type": "number"}, "baro_altitude": {"type": ["number", "null"]}, "on_ground": {"type": "boolean"}, "velocity": {"type": ["number", "null"]}, "true_track": {"type": ["number", "null"]}, "vertical_rate": {"type": ["number", "null"]}, "sensors": {"type": "null"}, "geo_altitude": {"type": ["number", "null"]}, "squawk": {"type": ["string", "null"]}, "spi": {"type": "boolean"}, "position_source": {"type": "string"}, "category": {"type": ["string", "null"]}, "registration": {"type": ["string", "null"]}, "aircraft_type": {"type": ["string", "null"]}, "source_feed": {"type": "string"}, "sources": {"type": "array", "items": {"type": "string", "enum": ["opensky", "adsb.lol"]}}}}, "geometry": {"type": "object", "properties": {"type": {"type": "string"}, "coordinates": {"type": "array", "items": {"type": "number"}}}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/airplane/unified-position\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Each feature carries a `sources` array indicating which feeds saw the plane.\nboth = gdf[gdf[\"sources\"].apply(lambda s: len(s) > 1)]\nonly_adsb_lol = gdf[gdf[\"sources\"].apply(lambda s: s == [\"adsb.lol\"])]\nonly_opensky = gdf[gdf[\"sources\"].apply(lambda s: s == [\"opensky\"])]\n\nprint(f\"total:          {len(gdf)} aircraft\")\nprint(f\"both feeds:     {len(both)}\")\nprint(f\"adsb.lol:       {len(only_adsb_lol)} (only)\")\nprint(f\"opensky:        {len(only_opensky)} (only)\")\n\n# Filter to airborne planes inside a Belgium bounding box.\nimport shapely.geometry as sg\nbelgium = sg.box(2.5, 49.4, 6.55, 51.55)\nin_belgium = gdf[gdf.geometry.within(belgium) & (~gdf[\"on_ground\"].fillna(False))]\nprint(f\"airborne over Belgium: {len(in_belgium)}\")\n\n# Plot, coloured by feed coverage.\ndef feed_color(sources):\n    if \"adsb.lol\" in sources and \"opensky\" in sources:\n        return \"#9b59b6\"\n    if \"adsb.lol\" in sources:\n        return \"#27ae60\"\n    return \"#e67e22\"\n\ngdf.plot(figsize=(10, 8), color=gdf[\"sources\"].map(feed_color), markersize=12)\n"}]}}, "/fixmystreet/incidents": {"get": {"summary": "Incidents", "tags": ["FIX MY STREET"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Geolocated incidents reported by citizens on the Fix My Street platform in the Brussels-Capital Region. Updated daily.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Daily</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-02-25 16:02:48</td></tr><tr><td>End date</td><td>2026-11-20 05:00:20</td></tr><tr><td>Count</td><td>235</td></tr></table>", "x-refresh": "Daily", "x-description": "Geolocated incidents reported by citizens on the Fix My Street platform in the Brussels-Capital Region. Updated daily.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"type": "string"}, "properties": {"type": "object", "properties": {"id": {"type": "integer"}, "creationDate": {"type": "string"}, "updatedDate": {"type": "string"}, "status": {"type": "string"}, "location.address.streetNumber": {"type": "string"}, "location.address.streetNameFr": {"type": "string"}, "location.address.streetNameNl": {"type": "string"}, "location.address.postalCode": {"type": "string"}, "location.address.addressType": {"type": "string"}, "responsibleOrganisation.id": {"type": "integer"}, "responsibleOrganisation.nameFr": {"type": "string"}, "responsibleOrganisation.nameNl": {"type": "string"}, "responsibleOrganisation.nameEn": {"type": "string"}, "responsibleOrganisation.type": {"type": "string"}, "category.nameFr": {"type": "string"}, "category.nameNl": {"type": "string"}, "category.nameEn": {"type": "string"}, "category.public": {"type": "boolean"}, "category.id": {"type": "integer"}, "category.parentId": {"type": "integer"}, "responsibleDepartment.id": {"type": "integer"}, "responsibleDepartment.nameFr": {"type": "string"}, "responsibleDepartment.nameNl": {"type": "string"}, "responsibleDepartment.nameEn": {"type": "string"}, "closedDate": {"type": ["string", "null"], "description": "When the incident was closed; null while it is open"}}}, "geometry": {"type": "object", "properties": {"type": {"type": "string"}, "coordinates": {"type": "array", "items": {"type": "number"}}}}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/fixmystreet/incidents\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Count incidents by category\ncategories = gdf['category.nameEn'].value_counts()\nprint(\"Incidents by category:\")\nprint(categories.head(10))\n\n# Count incidents by status\nstatuses = gdf['status'].value_counts()\nprint(f\"\\nBy status: {dict(statuses)}\")\n\n# Plot incidents on a map\ngdf.plot(figsize=(10, 8), column='status', legend=True, markersize=3)"}]}}, "/environment/weather": {"get": {"summary": "Weather", "tags": ["ENVIRONMENT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>JSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Current weather in Brussels from OpenWeather.<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:38</td></tr><tr><td>End date</td><td>2026-11-20 21:42:41</td></tr><tr><td>Count</td><td>212421</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Current weather in Brussels from OpenWeather.", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"base": {"type": "string"}, "clouds": {"properties": {"all": {"type": "integer"}}, "required": ["all"], "type": "object"}, "cod": {"type": "integer"}, "coord": {"properties": {"lat": {"type": "number"}, "lon": {"type": "number"}}, "required": ["lat", "lon"], "type": "object"}, "dt": {"type": "integer"}, "id": {"type": "integer"}, "main": {"properties": {"feels_like": {"type": "number"}, "humidity": {"type": "integer"}, "pressure": {"type": "integer"}, "temp": {"type": "number"}, "temp_max": {"type": "number"}, "temp_min": {"type": "number"}}, "required": ["feels_like", "humidity", "pressure", "temp", "temp_max", "temp_min"], "type": "object"}, "name": {"type": "string"}, "sys": {"properties": {"country": {"type": "string"}, "id": {"type": "integer"}, "sunrise": {"type": "integer"}, "sunset": {"type": "integer"}, "type": {"type": "integer"}}, "required": ["country", "id", "sunrise", "sunset", "type"], "type": "object"}, "timezone": {"type": "integer"}, "visibility": {"type": "integer"}, "weather": {"items": {"properties": {"description": {"type": "string"}, "icon": {"type": "string"}, "id": {"type": "integer"}, "main": {"type": "string"}}, "required": ["description", "icon", "id", "main"], "type": "object"}, "type": "array"}, "wind": {"properties": {"deg": {"type": "integer"}, "speed": {"type": "number"}}, "required": ["deg", "speed"], "type": "object"}}, "required": ["base", "clouds", "cod", "coord", "dt", "id", "main", "name", "sys", "timezone", "visibility", "weather", "wind"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/environment/weather\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\n# Display current weather in Brussels\ntemp_c = data['main']['temp'] - 273.15\nfeels_like_c = data['main']['feels_like'] - 273.15\nweather = data['weather'][0]['description']\nprint(f\"Brussels: {weather}\")\nprint(f\"Temperature: {temp_c:.1f}C (feels like {feels_like_c:.1f}C)\")\nprint(f\"Humidity: {data['main']['humidity']}%, Wind: {data['wind']['speed']} m/s\")\nprint(f\"Visibility: {data['visibility'] / 1000:.1f} km\")"}]}}, "/environment/air-quality": {"get": {"summary": "Air quality", "tags": ["ENVIRONMENT"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Air quality measurements in Brussels from Irceline (SOS).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2024-08-21 14:59:43</td></tr><tr><td>End date</td><td>2026-11-20 21:45:21</td></tr><tr><td>Count</td><td>207005</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Air quality measurements in Brussels from Irceline (SOS).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"properties": {"features": {"items": {"properties": {"geometry": {"properties": {"coordinates": {"items": {"type": "number"}, "type": "array"}, "type": {"type": "string"}}, "required": ["coordinates", "type"], "type": "object"}, "id": {"type": "string"}, "properties": {"properties": {"firstValue.timestamp": {"type": "integer"}, "firstValue.value": {"type": ["null", "number"]}, "id": {"type": "string"}, "label": {"type": "string"}, "lastValue.timestamp": {"type": "integer"}, "lastValue.value": {"type": ["null", "number"]}, "parameters.category.id": {"type": "string"}, "parameters.category.label": {"type": "string"}, "parameters.feature.id": {"type": "string"}, "parameters.feature.label": {"type": "string"}, "parameters.offering.id": {"type": "string"}, "parameters.offering.label": {"type": "string"}, "parameters.phenomenon.id": {"type": "string"}, "parameters.phenomenon.label": {"type": "string"}, "parameters.procedure.id": {"type": "string"}, "parameters.procedure.label": {"type": "string"}, "station.properties.id": {"type": "integer"}, "station.properties.label": {"type": "string"}, "uom": {"type": "string"}}, "required": ["firstValue.timestamp", "firstValue.value", "id", "label", "lastValue.timestamp", "lastValue.value", "parameters.category.id", "parameters.category.label", "parameters.feature.id", "parameters.feature.label", "parameters.offering.id", "parameters.offering.label", "parameters.phenomenon.id", "parameters.phenomenon.label", "parameters.procedure.id", "parameters.procedure.label", "station.properties.id", "station.properties.label", "uom"], "type": "object"}, "type": {"type": "string"}}, "required": ["geometry", "id", "properties", "type"], "type": "object"}, "type": "array"}, "type": {"type": "string"}}, "required": ["features", "type"], "type": "object"}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/environment/air-quality\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# One feature per station and pollutant: keep nitrogen dioxide\nno2 = gdf[gdf['parameters.phenomenon.label'] == 'Nitrogen dioxide']\nfor _, series in no2.head(10).iterrows():\n    print(f\"{series['station.properties.label']}: {series['lastValue.value']} {series['uom']}\")\n\n# Plot the monitoring stations by their latest NO2 value\nno2.plot(figsize=(10, 8), column='lastValue.value', legend=True, markersize=20, cmap='RdYlGn_r')"}]}}, "/villo/stations": {"get": {"summary": "Stations", "tags": ["VILLO"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>GEOJSON</div><div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>APPLICATION/JSON</div><br><br>Real-time availability of Villo! bike-sharing stations in Brussels including available bikes and stands per station. The counts are current, but <code>last_update</code>, as published by opendata.brussels.be, lags the real time by the Brussels UTC offset (two hours in summer, one in winter).<br><br><div style='margin: 8px 0; padding: 8px 12px; background-color: #f4f6fb; border-left: 3px solid #1B2A4A; border-radius: 4px; font-size: 13px; color: #333;'><strong>Refresh frequency:</strong> <span class='refresh-frequency'>Every 5 minutes</span></div><h4>Data information</h4><table class='table table-sm table-borderless'><tr><td>Start date</td><td>2026-03-30 11:44:18</td></tr><tr><td>End date</td><td>2026-11-20 21:43:48</td></tr><tr><td>Count</td><td>60865</td></tr></table>", "x-refresh": "Every 5 minutes", "x-description": "Real-time availability of Villo! bike-sharing stations in Brussels including available bikes and stands per station. The counts are current, but <code>last_update</code>, as published by opendata.brussels.be, lags the real time by the Brussels UTC offset (two hours in summer, one in winter).", "parameters": [{"description": "Return the last snapshot at or before this moment, in Unix seconds or ISO 8601 (e.g. <code>2026-05-06T12:00:00Z</code>). Without it, the latest snapshot is returned.", "schema": {"type": "string"}, "in": "query", "name": "timestamp", "required": false}], "responses": {"200": {"description": "Successful response", "headers": {"X-Data-Timestamp": {"description": "When the returned snapshot was collected: ISO 8601 date and time in UTC, without offset (e.g. <code>2026-10-09T16:10:17.123456</code>).", "schema": {"type": "string", "format": "date-time"}}}, "content": {"application/json": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {"type": {"type": "string"}, "features": {"type": "array", "items": {"type": "object", "properties": {"type": {"type": "string"}, "geometry": {"type": "object", "properties": {"type": {"type": "string"}, "coordinates": {"type": "array", "items": {"type": "number"}}}}, "properties": {"type": "object", "properties": {"number": {"type": "string"}, "name_fr": {"type": "string"}, "name_nl": {"type": "string"}, "address_fr": {"type": ["string", "null"]}, "address_nl": {"type": ["string", "null"]}, "municipality_fr": {"type": ["string", "null"]}, "municipality_nl": {"type": ["string", "null"]}, "available_bikes": {"type": "integer"}, "available_bike_stands": {"type": "integer"}, "bike_stands": {"type": "integer"}, "last_update": {"type": "string"}}, "required": ["number", "name_fr", "name_nl", "available_bikes", "available_bike_stands", "bike_stands", "last_update"]}}}}}}}}}, "404": {"description": "No data found for this timestamp", "content": {"application/json": {"schema": {"type": "object", "properties": {"message": {"type": "string"}}}}}}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport geopandas as gpd\n\nfrom datetime import datetime, timedelta, timezone\n\nyesterday_noon = (datetime.now(timezone.utc) - timedelta(days=1)).replace(\n    hour=12, minute=0, second=0, microsecond=0\n)\nparams = {\n    \"timestamp\": yesterday_noon.isoformat(),   # ISO accepted; epoch also works\n}\n\nurl = \"https://api.mobilitytwin.brussels/villo/stations\"\n\ndata = requests.get(url, headers={\n        'Authorization': 'Bearer [MY_API_KEY]'\n}, params=params).json()\n\ngdf = gpd.GeoDataFrame.from_features(data[\"features\"])\n\n# Show stations with most available bikes\ntop = gdf.nlargest(10, 'available_bikes')[['name_fr', 'available_bikes', 'available_bike_stands', 'municipality_fr']]\nprint(\"Stations with most available bikes:\")\nprint(top.to_string(index=False))\n\n# Summary statistics\nprint(f\"\\nTotal stations: {len(gdf)}\")\nprint(f\"Total available bikes: {gdf['available_bikes'].sum()}\")\nprint(f\"Total available stands: {gdf['available_bike_stands'].sum()}\")\n\n# Plot stations colored by availability\ngdf.plot(figsize=(10, 8), column='available_bikes', legend=True, markersize=15, cmap='YlGn')"}]}}, "/stib/vehicle-distance/parquet": {"get": {"summary": "STIB vehicle distance as Parquet files", "tags": ["BULK HISTORY"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>PARQUET</div><br><br>The URLs of the Parquet files holding every snapshot over a time range, oldest first. Each is a plain Parquet file with one row per vehicle and poll: the snapshot's fields plus a <code>date</code> column in UTC. Download it directly from its URL, with no token.<br><br>Files cover one UTC day each, and one hour each for the current day. With <code>keys</code> set to <code>{\"lineId\": \"71\"}</code>, you get one file per week (Monday to Monday, UTC) holding a single line; days not yet grouped into a week come as daily files of all lines. Files can extend past the requested range, so filter on <code>date</code>.", "x-description": "The URLs of the Parquet files holding every snapshot over a time range, oldest first. Each is a plain Parquet file with one row per vehicle and poll: the snapshot's fields plus a <code>date</code> column in UTC. Download it directly from its URL, with no token.\n\nFiles cover one UTC day each, and one hour each for the current day. With <code>keys</code> set to <code>{\"lineId\": \"71\"}</code>, you get one file per week (Monday to Monday, UTC) holding a single line; days not yet grouped into a week come as daily files of all lines. Files can extend past the requested range, so filter on <code>date</code>.", "parameters": [{"name": "start_timestamp", "in": "query", "required": true, "schema": {"type": "string"}, "description": "Start of the range, in Unix seconds or ISO 8601."}, {"name": "end_timestamp", "in": "query", "required": true, "schema": {"type": "string"}, "description": "End of the range (excluded), in Unix seconds or ISO 8601."}, {"name": "keys", "in": "query", "required": false, "schema": {"type": "string"}, "description": "Optional JSON object selecting the weekly per-line files, e.g. <code>{\"lineId\": \"71\"}</code>."}], "responses": {"200": {"description": "The file URLs", "content": {"application/json": {"schema": {"type": "object", "properties": {"results": {"type": "array", "items": {"type": "string", "format": "uri"}, "description": "Download URLs of the Parquet files, oldest first."}}}}}}, "400": {"description": "Missing or malformed parameter"}, "401": {"description": "Missing or invalid token"}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, timedelta, timezone\n\nend = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)\nparams = {\n    \"start_timestamp\": (end - timedelta(days=2)).isoformat(),   # ISO accepted; epoch also works\n    \"end_timestamp\": end.isoformat(),\n}\n\nurls = requests.get(\n    \"https://api.mobilitytwin.brussels/stib/vehicle-distance/parquet\",\n    headers={\"Authorization\": \"Bearer [MY_API_KEY]\"},\n    params=params,\n).json()[\"results\"]\nprint(f\"{len(urls)} files\")   # one per day here\n\n# Each file is a plain Parquet file: read it straight from its URL, no token needed.\ndf = pd.concat([pd.read_parquet(url) for url in urls], ignore_index=True)\ndf = df[(df[\"date\"] >= params[\"start_timestamp\"][:19]) & (df[\"date\"] < params[\"end_timestamp\"][:19])]\n\n# Rows per line over the two days\nprint(df.groupby(\"lineId\").size().sort_values().tail(10))\n"}]}}, "/stib/vehicle-trip/parquet": {"get": {"summary": "STIB vehicle position as Parquet files", "tags": ["BULK HISTORY"], "description": "<div style='display: inline-block; padding: 3px 7px; background-color: #e0e0e0; border-radius: 5px; margin-right: 5px; color: gray; font-size: 12px; '>PARQUET</div><br><br>The URLs of the Parquet files holding every snapshot over a time range, oldest first. Each is a plain Parquet file with one row per vehicle and poll: the snapshot's fields plus a <code>date</code> column in UTC. Download it directly from its URL, with no token.<br><br>Files cover one UTC day each, and one hour each for the current day. With <code>keys</code> set to <code>{\"lineId\": \"71\"}</code>, you get one file per week (Monday to Monday, UTC) holding a single line; days not yet grouped into a week come as daily files of all lines. Files can extend past the requested range, so filter on <code>date</code>.", "x-description": "The URLs of the Parquet files holding every snapshot over a time range, oldest first. Each is a plain Parquet file with one row per vehicle and poll: the snapshot's fields plus a <code>date</code> column in UTC. Download it directly from its URL, with no token.\n\nFiles cover one UTC day each, and one hour each for the current day. With <code>keys</code> set to <code>{\"lineId\": \"71\"}</code>, you get one file per week (Monday to Monday, UTC) holding a single line; days not yet grouped into a week come as daily files of all lines. Files can extend past the requested range, so filter on <code>date</code>.", "parameters": [{"name": "start_timestamp", "in": "query", "required": true, "schema": {"type": "string"}, "description": "Start of the range, in Unix seconds or ISO 8601."}, {"name": "end_timestamp", "in": "query", "required": true, "schema": {"type": "string"}, "description": "End of the range (excluded), in Unix seconds or ISO 8601."}, {"name": "keys", "in": "query", "required": false, "schema": {"type": "string"}, "description": "Optional JSON object selecting the weekly per-line files, e.g. <code>{\"lineId\": \"71\"}</code>."}], "responses": {"200": {"description": "The file URLs", "content": {"application/json": {"schema": {"type": "object", "properties": {"results": {"type": "array", "items": {"type": "string", "format": "uri"}, "description": "Download URLs of the Parquet files, oldest first."}}}}}}, "400": {"description": "Missing or malformed parameter"}, "401": {"description": "Missing or invalid token"}}, "x-code-samples": [{"lang": "Python", "source": "import requests\nimport pandas as pd\n\nfrom datetime import datetime, timedelta, timezone\n\nend = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)\nparams = {\n    \"start_timestamp\": (end - timedelta(days=2)).isoformat(),   # ISO accepted; epoch also works\n    \"end_timestamp\": end.isoformat(),\n}\n\nurls = requests.get(\n    \"https://api.mobilitytwin.brussels/stib/vehicle-trip/parquet\",\n    headers={\"Authorization\": \"Bearer [MY_API_KEY]\"},\n    params=params,\n).json()[\"results\"]\nprint(f\"{len(urls)} files\")   # one per day here\n\n# Each file is a plain Parquet file: read it straight from its URL, no token needed.\ndf = pd.concat([pd.read_parquet(url) for url in urls], ignore_index=True)\ndf = df[(df[\"date\"] >= params[\"start_timestamp\"][:19]) & (df[\"date\"] < params[\"end_timestamp\"][:19])]\nprint(f\"{len(df):,} vehicle positions, {df['date'].nunique():,} polls\")\n\n# Mean delay per line over the two days, for vehicles with a trip\nprint(df.dropna(subset=[\"delay\"]).groupby(\"lineId\")[\"delay\"].mean().sort_values().tail(10))\n"}]}}}, "tags": [{"name": "SNCB", "description": "Belgian national rail: the timetable (GTFS), live delays, cancellations and alerts (GTFS-RT), estimated train positions and a daily punctuality table. Covers all of Belgium, not only Brussels.<br><br><a target='_blank' href='https://www.belgiantrain.be/fr/3rd-party-services/mobility-service-providers/public-data' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "INFRABEL", "description": "The Belgian rail network as a map (line sections, operational points, every track), plus Infrabel's daily record of planned and actual times for every train.<br><br><a target='_blank' href='https://opendata.infrabel.be' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "STIB", "description": "Brussels metro, tram and bus: the timetable, stops and network geometry, live vehicles with their trip and delay, waiting times and a daily punctuality table. <b>vehicle-trip</b> adds trips and delays to the live positions, and the GTFS-RT endpoints publish the result in the standard format, see <a href=\"/stib-gtfs-realtime/\">STIB GTFS Realtime</a>.<br><br><a target='_blank' href='https://opendata.stib-mivb.be' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "TEC", "description": "Walloon buses, including the lines that enter Brussels: the timetable, live vehicle positions, trip updates, alerts and a daily punctuality table.<br><br><a target='_blank' href='https://opendata.tec-wl.be' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "DE LIJN", "description": "Flemish buses and trams, including the lines that enter Brussels: the timetable, trip updates, alerts and a daily punctuality table.<br><br><a target='_blank' href='https://data.delijn.be/' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "SCOOTER AND BIKE POSITIONS", "description": "Positions of shared scooters and bikes in Brussels, one endpoint per operator, with history. Dott and Bolt are live. Lime and Pony have left Brussels, so only their history remains. Geofences and vehicle types are listed under each operator."}, {"name": "LIME", "description": ""}, {"name": "DOTT", "description": ""}, {"name": "PONY", "description": ""}, {"name": "BOLT", "description": ""}, {"name": "TRAFFIC", "description": "Road and bike traffic in Brussels: Telraam counts per street segment, tunnel detector counts, bike counters, variable message signs, traffic events, public car parks and STIB speeds."}, {"name": "AIRPLANE", "description": "Aircraft over Belgium from two ADS-B networks, OpenSky and adsb.lol. Use <b>unified-position</b> for one record per aircraft across both: together they see about 10% more aircraft than either alone.<br><br><a target='_blank' href='https://opensky-network.org' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "FIX MY STREET", "description": "What citizens report in Brussels public space, such as potholes, broken streetlights and illegal dumping, geolocated and collected daily from api.brussels.<br><br><a target='_blank' href='https://api.brussels' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "ENVIRONMENT", "description": "Brussels weather from OpenWeather and air quality from Irceline, every 5 minutes."}, {"name": "VILLO", "description": "Villo!, the Brussels public bike-share run by JCDecaux: available bikes and free stands at every station, every 5 minutes.<br><br><a target='_blank' href='https://opendata.brussels.be' style='color: gray; font-size: 12px;'>Source</a>"}, {"name": "BULK HISTORY", "description": "Long time ranges of the 20-second STIB feeds as Parquet files, rather than one snapshot per call."}], "components": {"securitySchemes": {"Token Authentication": {"type": "http", "in": "header", "name": "Authorization", "scheme": "bearer", "description": "Your API token in the format **Bearer &lt;token>** inside the Authorization header."}}}, "security": [{"Token Authentication": []}], "theme": {"openapi": {"sidebar": {"backgroundColor": "#ffffff", "width": "260px", "textColor": "#000000"}}}}