STIB vehicle distance as Parquet files

Bulk history: months of brussels vehicle data as parquet files

Format
Parquet
Updates
Daily files, and hourly files for the current day
curl -H "Authorization: Bearer $MOBILITYTWIN_TOKEN" "https://api.mobilitytwin.brussels/stib/vehicle-distance/parquet?start_timestamp=2026-05-06&end_timestamp=2026-05-07"

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 date column in UTC. Download it directly from its URL, with no token.

Files cover one UTC day each, and one hour each for the current day. With keys set to {"lineId": "71"}, 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 date.

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

These files hold the same data as STIB vehicle distance, where you can check which days have data.

Parameters

NameMeaning
start_timestamp requiredStart of the range, in Unix seconds or ISO 8601.
end_timestamp requiredEnd of the range (excluded), in Unix seconds or ISO 8601.
keysOptional JSON object selecting the weekly per-line files, e.g. {"lineId": "71"}.

Response fields

FieldTypeMeaning
resultsarrayDownload URLs of the Parquet files, oldest first.

Python example

import requests
import pandas as pd

from datetime import datetime, timedelta, timezone

end = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)
params = {
    "start_timestamp": (end - timedelta(days=2)).isoformat(),   # ISO accepted; epoch also works
    "end_timestamp": end.isoformat(),
}

urls = requests.get(
    "https://api.mobilitytwin.brussels/stib/vehicle-distance/parquet",
    headers={"Authorization": "Bearer [MY_API_KEY]"},
    params=params,
).json()["results"]
print(f"{len(urls)} files")   # one per day here

# Each file is a plain Parquet file: read it straight from its URL, no token needed.
df = pd.concat([pd.read_parquet(url) for url in urls], ignore_index=True)
df = df[(df["date"] >= params["start_timestamp"][:19]) & (df["date"] < params["end_timestamp"][:19])]

# Rows per line over the two days
print(df.groupby("lineId").size().sort_values().tail(10))