Deutsche Bahn Timetable Scraper - Schedules & Real-Time Delays avatar

Deutsche Bahn Timetable Scraper - Schedules & Real-Time Delays

Pricing

from $1.00 / 1,000 record scrapeds

Go to Apify Store
Deutsche Bahn Timetable Scraper - Schedules & Real-Time Delays

Deutsche Bahn Timetable Scraper - Schedules & Real-Time Delays

Scrape Deutsche Bahn (bahn.de) journey plans, train schedules, platforms, transfers, real-time delays, and occupancy forecasts. Supports ICE, IC/EC, RE, RB, S-Bahn across Germany plus international DB routes (AT, CH, FR, NL, BE, PL, DK).

Pricing

from $1.00 / 1,000 record scrapeds

Rating

0.0

(0)

Developer

BowTiedRaccoon

BowTiedRaccoon

Maintained by Community

Actor stats

0

Bookmarked

10

Total users

0

Monthly active users

5 hours ago

Last modified

Share

Deutsche Bahn Scraper — Train Schedules & Delays

This is the first and only Deutsche Bahn timetable actor on Apify. It queries the DB Navigator HAFAS API — the same backend powering the official Deutsche Bahn app — to return point-to-point journey results with real-time delay data, occupancy forecasts, platform information, and full segment breakdowns. Commercial HAFAS licences start at thousands of euros per year; this actor gives you the same data at $0.001 per journey result.

What does the Deutsche Bahn Scraper do?

  • Queries DB Navigator for train journeys between any two German stations
  • Returns scheduled and real-time departure/arrival times, delay minutes, and cancellation status
  • Breaks each journey into segments with train type, train number, carrier, and platform
  • Includes first and second class occupancy forecasts per journey
  • Returns ris_notizen — DB service alerts (disruptions, substitutions, platform changes)
  • One Apify run = one timetable query; schedule repeating runs to build historical delay datasets

What data does it extract?

FieldDescription
journey_idUnique journey identifier
origin_stationOrigin station name
origin_idDB station ID (EVA number)
destination_stationDestination station name
destination_idDB station ID (EVA number)
departure_timeScheduled departure (ISO 8601)
departure_time_realtimeReal-time departure if available
arrival_timeScheduled arrival (ISO 8601)
arrival_time_realtimeReal-time arrival if available
duration_minutesTotal journey duration in minutes
transfersNumber of transfers
train_segmentsArray of individual legs with train type, number, carrier, departure, arrival, platform
platform_departureDeparture platform at origin
platform_arrivalArrival platform at destination
train_typePrimary train type (ICE, IC, RE, S-Bahn, etc.)
train_numberTrain service number
train_nameTrain name where applicable
carrierOperating carrier
delay_minutesDelay in minutes (negative = early)
cancelledWhether the journey was cancelled
occupancy_class_1First class occupancy forecast (LOW/MEDIUM/HIGH)
occupancy_class_2Second class occupancy forecast (LOW/MEDIUM/HIGH)
ris_notizenArray of DB service notices and disruption alerts
bahn_de_urlCanonical bahn.de link for this journey

How to use it

Enter the origin and destination station names in plain German (e.g. Berlin Hbf, München Hbf, Frankfurt(Main)Hbf). Leave date and time empty to query tomorrow's departures at 08:00 — the defaults shown in the table below. Set maxItems to limit results if you only need the first few journeys.

FieldTypeDefaultDescription
originstringBerlin HbfOrigin station name in German
destinationstringMünchen HbfDestination station name in German
datestringtomorrowDate in YYYY-MM-DD format. Empty = tomorrow's date.
timestring08:00Departure time in HH:MM format. Empty = 08:00.
fareClassinteger21 = First class, 2 = Second class
includeLocalTrainsbooleantrueInclude regional trains (RE, RB, S-Bahn) alongside long-distance services
maxItemsinteger50Maximum journey results to return

Use cases

  • Delay monitoring and alerting — Run the actor on a fixed route daily or hourly and compare departure_time vs departure_time_realtime to build a delay histogram; trigger alerts when delay_minutes exceeds a threshold.
  • Commuter analytics — Track occupancy forecasts (occupancy_class_1, occupancy_class_2) across departure times to identify low-occupancy windows for regular business travel.
  • Journalism and research — Build a historical timetable dataset across the DB network to analyze punctuality trends, route disruptions, and seasonal patterns using ris_notizen disruption data.
  • Travel app integration — Embed live DB timetable data in your own application without licensing the HAFAS API directly — commercial HAFAS contracts start at thousands of euros per year.
  • Transport planning — Compare duration_minutes and transfers across routes to model effective travel times between German cities for logistics or workforce planning purposes.

FAQ

How much does this cost compared to a HAFAS licence? Commercial HAFAS API licences — the same data source powering this actor — start at thousands of euros per year. This actor costs $0.001 per journey result plus $0.10 per run. A daily query across 10 routes for a month costs under $1.

How do I build a delay history dataset? Schedule the actor to run at the same time each day with a fixed origin, destination, and date set to tomorrow. Each run writes its results to a fresh Apify dataset. Export and merge datasets weekly to build a longitudinal delay dataset. The journey_id field can be used to match the same scheduled service across runs.

Are real-time delays always available? departure_time_realtime and arrival_time_realtime are populated only when DB's RIS (Reise-Informations-System) has live data for that service. For future dates, only scheduled times are available.

Results are available for export in JSON, CSV, and Excel formats from the Apify dataset tab.