# Deutsche Bahn Train Delay and Cancellation Data

## Facts

- Provider: Deutsche Bahn (source data); collected by piebro
- License: CC-BY-4.0 (https://developers.deutschebahn.com/db-api-marketplace/apis/product/timetables)
- Size: 2,127 files
- Format: Parquet (in sampled files)
- Stored at: Hugging Face, https://huggingface.co/datasets/piebro/deutsche-bahn-data
- Access: public, readable without an account
- Category: Machine Learning & AI
- Source: https://github.com/piebro/deutsche-bahn-data
- Page: https://scigantic.com/archive/35d20f67-b38a-5947-a08c-fef3d9975152
- Keywords: Machine Learning & AI, time series, Parquet, Hugging Face

## About

Historical train schedules, delays and cancellations for stations across Germany, collected continuously from the Deutsche Bahn Timetables API, the public interface behind departure boards. Monthly processed Parquet files (monthly_processed_data/data-YYYY-MM.parquet, from July 2024 onwards at measurement, about 60 MB per month early on and about 350 MB per month from November 2025) hold one row per train stop with station name and EVA number, train type, train number, line number, final destination, planned and changed arrival and departure times, delay in minutes, arrival and departure cancellation flags and ride identifiers. Separate folders give the planned timetable and change streams, and raw_data/ keeps every API response (XML or JSON) partitioned by year, month and day with request metadata. The repository uses about 134 GB (measured 2026-11-14). Uses include railway punctuality analysis, delay propagation and prediction, network reliability, transport policy evaluation and time series and graph learning on transit networks. Read with pandas, polars or DuckDB; the GitHub project documents the collection. Deutsche Bahn publishes the Timetables API data under CC BY 4.0; attribute Deutsche Bahn AG.

## Load the data

```python
from datasets import load_dataset
ds = load_dataset("piebro/deutsche-bahn-data")
print(ds)
```

## Data structure

File types in sampled files: Parquet

Example file: `monthly_processed_data/data-2024-07.parquet`

## Open it

- In a hosted notebook with the data mounted: https://scigantic.com/archive/35d20f67-b38a-5947-a08c-fef3d9975152
- Full record as JSON (schema card included): https://api.scigantic.com/api/archives/35d20f67-b38a-5947-a08c-fef3d9975152
- Over MCP: `get_schema_card` with id `35d20f67-b38a-5947-a08c-fef3d9975152` at https://api.scigantic.com/mcp

## Related topics

- [Parquet datasets](https://scigantic.com/topics/parquet)
- [Time series datasets](https://scigantic.com/topics/time-series)
- [Machine Learning & AI datasets](https://scigantic.com/topics/machine-learning-and-ai)
