SYSTEM all green source bahn.de queue 14,892 routes p99 latency 218ms dataflirt.com · scraper/bahn-de
RUN · 41 active pipelines · bahn.de live

Deutsche Bahn data,
at warehouse scale.

We extract ICE/IC schedules, Sparpreis fares, real-time delay metrics, and station intelligence from bahn.de. Delivered as clean JSON, CSV, or Parquet to S3, BigQuery, or Postgres on your cadence.

Routes tracked
14,892 /day
Fare updates
842K /24h
Delay events
12,405 /run
Active pipelines
41
Uptime
99.98%
Data Dictionary

Every field we extract from bahn.de

Structured, schema-consistent data across all major object types — delivered clean, typed, and ready to query.

Complete list of extractable fields for Train Schedules objects from bahn.de. All fields typed and schema-versioned.

train_numbertrain_typeorigindestinationdeparture_timearrival_timeduration_minutestransfersdateoperator
train_schedules
● 200 OK
"train_number": "ICE 74",
"train_type": "ICE",
"origin": "Berlin Hbf",
"destination": "Frankfurt(Main)Hbf",
"departure_time": "2026-10-12T08:30:00Z",
"arrival_time": "2026-10-12T12:45:00Z",
"duration_minutes": 255,
"transfers": 0
# train_numbertrain_typeorigindestinationdeparture_timearrival_time
1
2
3

Complete list of extractable fields for Pricing & Fares objects from bahn.de. All fields typed and schema-versioned.

train_numberfare_classfare_namepricecurrencybahncard_25_pricebahncard_50_pricecancellation_feecity_ticket_includedscraped_at
pricing_& fares
● 200 OK
"train_number": "ICE 74",
"fare_class": "2nd Class",
"fare_name": "Super Sparpreis",
"price": 29.9,
"currency": "EUR",
"bahncard_25_price": 22.4,
"city_ticket_included": false,
"scraped_at": "2026-05-12T09:14:00Z"
# train_numberfare_classfare_namepricecurrencybahncard_25_price
1
2
3

Complete list of extractable fields for Real-Time Status objects from bahn.de. All fields typed and schema-versioned.

train_numberdatescheduled_departureactual_departuredelay_minutesplatform_changeoriginal_platformnew_platformdisruption_msgstatus
real-time_status
● 200 OK
"train_number": "ICE 74",
"date": "2026-10-12",
"scheduled_departure": "08:30:00",
"actual_departure": "08:42:00",
"delay_minutes": 12,
"platform_change": true,
"original_platform": "4",
"new_platform": "2",
"status": "DELAYED"
# train_numberdatescheduled_departureactual_departuredelay_minutesplatform_change
1
2
3

Complete list of extractable fields for Route & Stops objects from bahn.de. All fields typed and schema-versioned.

train_numberstop_sequencestation_namescheduled_arrivalactual_arrivalscheduled_departureactual_departuredistance_kmstop_duration_minutes
route_& stops
● 200 OK
"train_number": "ICE 74",
"stop_sequence": 3,
"station_name": "Halle(Saale)Hbf",
"scheduled_arrival": "09:45:00",
"actual_arrival": "09:47:00",
"scheduled_departure": "09:48:00",
"actual_departure": "09:50:00",
"stop_duration_minutes": 3
# train_numberstop_sequencestation_namescheduled_arrivalactual_arrivalscheduled_departure
1
2
3

Complete list of extractable fields for Station Data objects from bahn.de. All fields typed and schema-versioned.

station_idstation_namecategorydb_loungelockerswifistep_free_accessparking_spacestransit_connections
station_data
● 200 OK
"station_id": "8011160",
"station_name": "Berlin Hbf",
"category": 1,
"db_lounge": true,
"lockers": true,
"wifi": true,
"step_free_access": true,
"parking_spaces": 800
# station_idstation_namecategorydb_loungelockerswifi
1
2
3

Capabilities

Everything you need from bahn.de — nothing you don't

Our bahn.de scraper handles every layer of the platform: schedule generation, dynamic fare extraction, real-time delay tracking, and station facility mapping — with strict session management and IP rotation built in.

Full Schedule Extraction

Capture ICE, IC, RE, and S-Bahn schedules including origin, destination, transfers, and total duration across any date range.

Dynamic Fare Tracking

Extract Super Sparpreis, Sparpreis, and Flexpreis tiers in real time. Track price volatility leading up to departure dates.

Real-Time Delay Monitoring

Monitor live delays, platform changes, and disruption messages across the entire DB network.

BahnCard Discount Mapping

Capture adjusted pricing for BahnCard 25 and BahnCard 50 holders across 1st and 2nd class fares.

Cross-Border Route Data

Extract international connections operated in partnership with ÖBB, SBB, and SNCF directly from the bahn.de interface.

Station & Platform Intelligence

Map station facilities, DB Lounge availability, locker access, and local transit connections.

Seat Availability Signals

Detect high-occupancy warnings and mandatory reservation flags for specific high-speed routes.

Multi-Currency Support

Extract pricing natively in EUR, CHF, or GBP based on selected point of sale parameters.

Scheduled + Streaming Modes

Run one-off bulk route exports or configure continuous pipelines at hourly cadences with change-detection diffing.

// engagement pipeline

From route list to warehouse record

Brief in. Clean data out.

Define Scope
d 0

Provide origin-destination pairs, station IDs, or train numbers. We design the extraction schema together.

Pipeline Build
d 2–4

We configure Scrapy / Playwright crawlers, proxy rotation, session management, and HAFAS API parsing for bahn.de.

Validation & QA
d 4–6

Schema validation, null-rate checks, price-outlier detection, and sample schedules before full launch.

Delivery
ongoing

JSON / CSV / Parquet pushed to your S3 bucket, BigQuery dataset, or Postgres database on agreed cadence.

Under the hood

How our bahn.de pipeline handles the hard parts

Deutsche Bahn utilises strict session tokens and rate limits to prevent aggressive polling. Here's how we stay resilient.

pipeline-monitor · bahn.de · live ● active
// fingerprinting
Identity rotation
TLS fingerprintrandomised
User-agentrotated
IP poolresidential
Challenges blocked0
// pagination
Page coverage
48,291 pages queued running
// observability
Pipeline health
99.9%
uptime
142ms
p99 lat
0.3%
null rate
2
alerts
Session management
Navigating strict HAFAS tokens

Bahn.de relies heavily on stateful session tokens for pricing and route generation. Our pipelines manage full cookie jars and token lifecycles, ensuring valid requests without triggering session invalidation errors.

Anti-bot layer
Residential proxy rotation

DB blocks IPs that exhibit aggressive polling behaviour. We route requests through German and European residential ISP proxies, normalising request rates to mimic human search patterns.

API extraction
Direct HAFAS payload parsing

Instead of purely scraping the DOM, we intercept and parse the underlying JSON payloads from the HAFAS routing engine, guaranteeing structured, typed data extraction for complex route topologies.

Change detection
Only re-scrape what's changed

For large route matrices, we maintain a hash index of last-seen prices and delays. Subsequent runs only push diffs, reducing compute cost and downstream processing load.

Monitoring & alerting
24/7 pipeline health

Every run emits structured logs to our observability stack. We alert on null-rate spikes, missing fare tiers, and schema drift, responding before you notice.

Applications

Who uses bahn.de data — and how

Teams across industries use bahn.de data to build competitive products and smarter operations.

01
Travel Aggregation

OTAs and multimodal travel platforms integrate DB schedules and pricing into their consumer booking engines.

02
Price Intelligence

Long-distance bus operators and regional airlines monitor DB pricing to optimise their own dynamic fare models.

03
Corporate Travel Management

Corporate booking tools track ticket prices and delay metrics to enforce travel policies and forecast budgets.

04
Disruption Analytics

Insurtech and compensation platforms model historical delay data to assess risk and automate passenger claims.

05
Supply Chain & Logistics

Logistics providers track passenger rail delays as proxy indicators for broader rail network congestion affecting freight.

06
Carbon Emission Tracking

Sustainability platforms extract route distances and train types to calculate comparative CO2 emissions against air travel.

Why DataFlirt

"bahn.de orchestrates European rail mobility, exposing vast schedule and pricing datasets — but querying it at scale requires navigating complex session tokens and aggressive rate limits."

Extracting reliable data from Deutsche Bahn means managing HAFAS API tokens, bypassing strict IP rate limits, and parsing deeply nested JSON responses for dynamic pricing. DataFlirt manages this infrastructure so your engineering team can focus on integrating the data, not maintaining the scrapers.

Technical Spec

Bahn.de scraper — technical capabilities

Everything supported by our bahn.de scraper — rendered SPA elements, auth walls, rate-limit evasion and beyond.

JavaScript rendering
Full Playwright sessions required for initial token generation and state management
Supported
CAPTCHA bypass
Automated 2Captcha + CapSolver integration for high-frequency search blocks
Supported
Residential proxy rotation
ISP-grade residential IPs from DE/EU pools — rotated to prevent blocks
Supported
Multi-language extraction
Extract station names and disruption messages in DE or EN
Supported
HAFAS endpoint mapping
Direct extraction from underlying routing API payloads
Supported
Real-time delay feeds
Sub-minute latency for status updates on monitored train numbers
Supported
Change detection (diffs)
Hash-based diff: only emit records with changed prices or delays since last run
Supported
Webhook delivery
HTTP POST per record or batch — useful for real-time delay alerting
Supported
Personal BahnCard points
BahnBonus point balances require authenticated user access
Partial
User booking history
Past ticket purchases and invoices are gated behind user login
Partial
Infrastructure

Infrastructure powering the bahn.de pipeline

Open-source tooling on proven cloud infra — no vendor lock-in, full observability.

ScrapyPlaywrightPython 3.12RedisPostgreSQLApache AirflowAWS LambdaS3CloudWatch2CaptchaCapSolverResidential ProxiesDockerKubernetesGrafanaPrometheus
Scrapy + Playwright Stack

Scrapy handles crawl orchestration and HAFAS API parsing. Playwright handles initial session generation and cookie management. Combined via scrapy-playwright middleware.

Residential Proxy Infrastructure

We maintain pools of residential ISP proxies across DE regions. Rotation happens carefully to maintain session stickiness where required by bahn.de.

Cloud-Native Orchestration

Pipelines run on AWS Lambda (burst) and ECS (sustained). Airflow handles scheduling and dependency management. All state stored in managed Postgres.

Output & Delivery

Your data, your destination

Data delivered to where your team already works — no new tooling required.

JSON
Newline-delimited or nested — schema versioned per run
CSV
Flat file with typed columns — Excel/Sheets compatible
XLS
Legacy spreadsheet format for business analysts
Parquet
Columnar format for BigQuery, Snowflake, Athena
AWS S3
Direct bucket delivery — compatible with any data lake
Webhook
HTTP POST per record for real-time downstream processing
API
REST endpoint to query your extracted datasets
Postgres
Upsert into your existing schema with conflict resolution
S3
Direct bucket delivery — compatible with any data lake
// faq

Common questions.

About bahn.de scraping, legality, and pipeline operations.

Ask us directly →
Is scraping bahn.de legal?

Scraping publicly available schedule, pricing, and delay information is generally permissible. DataFlirt targets only public, non-authenticated data. We do not extract personal user data or circumvent authentication walls. Clients should review DB's terms of service and consult legal counsel for specific commercial use cases.

How do you handle bahn.de session tokens?

DB relies on strict session state for pricing queries. We use Playwright to initialise valid sessions, extract necessary cookies and tokens, and pass them to our HTTP clients. Sessions are rotated automatically before expiration.

Can you track real-time train delays?

Yes. We can configure high-frequency polling on specific train numbers or stations to capture delays, platform changes, and disruption messages with sub-minute latency.

Do you extract BahnCard pricing?

Yes. We pass the necessary parameters to extract standard fares alongside BahnCard 25 and BahnCard 50 discounted rates for both 1st and 2nd class.

Can you extract cross-border routes?

Yes. Any route visible on bahn.de, including those operated by partner networks like ÖBB, SBB, or SNCF, can be extracted using our pipeline.

What is the minimum viable engagement?

Our smallest packages start at a defined list of origin-destination pairs or station IDs with daily delivery. For high-frequency real-time monitoring, we price based on request volume and compute requirements.

$ dataflirt scope --new-project --source=bahn.de ready

Tell us what
to extract.
We do the rest.

20-minute scoping call. Pilot dataset within the week. Production within two. Whether you need a daily snapshot of Sparpreis fares or real-time delay feeds across the ICE network — we scope, build, and operate the pipeline. Tell us what you need.

hello@dataflirt.com · Bengaluru · IST · typical reply < 4h
Related Scrapers

More in travel flights hotels buses

Services

Data Extraction for Every Industry

View All Services →