České Dráhy Train Ticket & Connection Scraper
Pricing
from $0.40 / 1,000 search results
České Dráhy Train Ticket & Connection Scraper
Scrape train connections from České Dráhy (Czech state railways) with departure dates, prices, train types, and more.
Pricing
from $0.40 / 1,000 search results
Rating
5.0
(2)
Developer
Jindřich Bär
Maintained by CommunityActor stats
0
Bookmarked
3
Total users
0
Monthly active users
12 days ago
Last modified
Categories
Share
České dráhy connection scraper
Search train connections on cd.cz and get back a structured dataset of routes, times, train legs, and prices.
What it does
Given a departure station, a destination, and an optional date/time, the actor finds the next train connections offered by České dráhy and stores them in the dataset. For each connection you get:
- Departure and arrival as ISO timestamps
- Total travel time in minutes
- Number of transfers
- Per-train breakdown: name, carrier, end station, departure / arrival, distance in kilometres, expected occupancy
- Intermediary stations for each train leg — the stops between the leg's origin and destination, with arrival / departure timestamps and the cd.cz station id
- Price in CZK (when ticketing is available)
The actor automatically paginates over the cd.cz timetable and skips gaps in service so you reliably get the requested number of connections — even for routes where direct service runs only on selected days.
Inputs
| Field | Required | Default | Description |
|---|---|---|---|
from | yes | — | Departure station name (Czech diacritics supported) |
to | yes | — | Destination station name (foreign cities should include the country, e.g. "München; Německo") |
date | no | today | Departure date (date picker, ISO YYYY-MM-DD) |
time | no | now + 2 h | Departure time (HH:MM) |
maxChanges | no | 4 | Maximum allowed transfers per connection |
onlyDirectConnections | no | false | Only return connections without transfers |
serviceClass | no | Class2 | Class1, Class2, or ClassBusiness |
maxResults | no | 20 | Maximum number of connections to push to the dataset |
fetchPrices | no | true | Whether to fetch the price for each connection |
includeIntermediaryStations | no | true | List the stops each train leg passes through, with timestamps (one extra request per leg) |
Station names
from and to must match a station in the cd.cz station list. Use the name the station whisper on
cd.cz offers — "Praha hl.n.", "Brno hl.n.",
"Ústí nad Labem hl.n.". Foreign stations carry their local name plus the country, e.g.
"München Hbf; Německo" or "Wien Hbf; Rakousko"; Czech exonyms such as "Mnichov" or
"Vídeň" are not recognised. A city name on its own ("Praha", "Brno") is also accepted and
resolves to the city's main station.
If a name cannot be resolved, the run fails with an error naming the offending station and listing the closest matches cd.cz knows about, so the input can be corrected in one go.
Example input
{"from": "Praha hl.n.","to": "Copenhagen","date": "2026-05-14","time": "00:00","onlyDirectConnections": true,"maxResults": 20,"fetchPrices": true}
Output
Each item in the dataset describes one connection.
Example item
{"id": 80002583,"handle": 27910947,"from": "Praha hl.n.","to": "Koebenhavn H","departure": "2026-05-14T04:31:00.000Z","arrival": "2026-05-14T17:38:00.000Z","timeLengthMinutes": 787,"changesCount": 0,"price": 4280,"trains": [{"name": "rj 384 Berliner","number": "384","carrier": "ČD","endStation": "Hamburg-Altona","from": "Praha hl.n.","to": "Koebenhavn H","departure": "2026-05-14T04:31:00.000Z","arrival": "2026-05-14T17:38:00.000Z","timeLengthMinutes": 787,"distanceKilometres": 1124,"delay": -1,"waitTime": 0,"occupancyLevel": 0,"description": "railjet (Praha hl.n. – Hamburg-Altona)","intermediaryStations": [{"name": "Praha-Holešovice","stationId": 5457041,"arrival": "2026-05-14T04:39:00.000Z","departure": "2026-05-14T04:41:00.000Z"},{"name": "Ústí nad Labem hl.n.","stationId": 5455003,"arrival": "2026-05-14T05:31:00.000Z","departure": "2026-05-14T05:33:00.000Z"}]}]}
price is in CZK; null means the price could not be retrieved (sold out, no ticketing available,
or fetchPrices: false). changesCount is 0 for direct connections.
intermediaryStations lists each leg's stops between its origin and destination (the leg's own
from / to are excluded). arrival / departure are ISO 8601 UTC timestamps, occasionally null
when cd.cz reports only one of the two for a stop. An empty array means the leg has no intermediary
stops. The field is omitted when includeIntermediaryStations is false. GPS coordinates are not
provided — cd.cz does not expose them in the connection data source.
Pricing
The actor uses Apify pay-per-event pricing — one search-result event is charged for every
connection pushed to the dataset.
Agentic use
The actor is built for use by AI agents:
- Structured input schema. Every input has a title, type, description, and validation rules so an agent can fill it in correctly without extra prompting.
- Structured output schema. Each dataset item has a stable, typed shape — agents can read fields
like
departure,price, orchangesCountwithout parsing prose. - ISO timestamps. Departures and arrivals are emitted as ISO 8601 UTC strings (
2026-05-14T04:31:00.000Z), ready to be diffed, sorted, or compared. - Numeric quantities.
timeLengthMinutes,distanceKilometres,changesCount,priceare numbers, not formatted strings — no parsing of "2 hod 48 min" or "213 km" required. - Predictable output. Connections are returned in chronological order; duplicates are removed;
gaps in the cd.cz timetable are skipped automatically up to
maxResults. - Event-level cost control. Pay-per-event billing means an agent that sets a small
maxResultspays only for what it consumes.
Typical agent prompts that map cleanly onto this actor:
- "Find the cheapest train from Praha to Brno tomorrow morning."
- "How long does the direct train from Praha to Berlin take, and when does the next one leave?"
- "List all direct overnight trains from Praha to Copenhagen in the next two weeks."
The agent populates the input, runs the actor, then reads the resulting dataset items directly — no scraping, no HTML, no string parsing.