# CD Scraper - Czech Train Fares & Schedules (`studio-amba/cd-scraper`) Actor

Scrape train schedules, fares, and availability from Czech Railways (cd.cz). Extract SuperCity, EuroCity, InterCity, and regional train data for any Czech route. No login required.

- **URL**: https://apify.com/studio-amba/cd-scraper.md
- **Developed by:** [Studio Amba](https://apify.com/studio-amba) (community)
- **Categories:** Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 result scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CD Scraper - Czech Railways Train Fares & Schedules

Scrape train schedules, fares, and timetable data from Czech Railways (cd.cz), the national rail operator of the Czech Republic. Extract connections for any route with pricing in CZK. No login or cookies required.

### How to scrape Czech Railways data

This actor navigates to the CD.cz connection search page, fills in your origin and destination, selects the travel date, and extracts all available train connections with schedules and fares.

1. Set the **origin** station (e.g., Praha, Brno, Ostrava, Plzen)
2. Set the **destination** station (e.g., Brno, Praha, Olomouc, Cesky Krumlov)
3. Optionally set a **departure date** (defaults to 14 days from today)
4. Run the actor and download structured train data

The actor handles the full search flow automatically, including cookie consent dialogs, autocomplete station selection, and date picker navigation.

### Why use this actor?

Czech Railways (CD) operates over 7,000 trains daily across the Czech Republic and international routes. This actor gives you structured access to:

- **Travel agencies** comparing rail fares across European carriers
- **Researchers** studying Czech transport pricing and scheduling patterns
- **Businesses** monitoring competitor fares on Czech domestic and international routes
- **Travellers** planning trips who want to compare options programmatically

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `origin` | String | No | Departure station or city (default: `Praha`) |
| `destination` | String | No | Arrival station or city (default: `Brno`) |
| `departureDate` | String | No | Travel date in YYYY-MM-DD format (default: 14 days from today) |
| `passengers` | Integer | No | Number of adult passengers (default: 1) |
| `maxResults` | Integer | No | Maximum results to return (default: 50) |
| `proxyConfiguration` | Object | No | Proxy settings (CZ residential recommended) |

#### Example input

```json
{
    "origin": "Praha",
    "destination": "Brno",
    "departureDate": "2026-07-15",
    "passengers": 1,
    "maxResults": 20
}
```

### Output

Each result contains:

| Field | Type | Example |
|-------|------|---------|
| `trainNumber` | String | `"SC 510"` |
| `trainType` | String | `"SC"` |
| `departureStation` | String | `"Praha hl.n."` |
| `arrivalStation` | String | `"Brno hl.n."` |
| `departureTime` | String | `"06:33"` |
| `arrivalTime` | String | `"09:06"` |
| `duration` | String | `"2h 33min"` |
| `price` | Number | `299` |
| `currency` | String | `"CZK"` |
| `travelClass` | String | `"2nd"` |
| `transfers` | Integer | `0` |
| `carrier` | String | `"CD"` |
| `url` | String | Search results page URL |
| `scrapedAt` | String | ISO 8601 timestamp |

### Example output

```json
{
    "trainNumber": "SC 510",
    "trainType": "SC",
    "departureStation": "Praha",
    "arrivalStation": "Brno",
    "departureTime": "06:33",
    "arrivalTime": "09:06",
    "duration": "2h 33min",
    "price": 299,
    "currency": "CZK",
    "travelClass": "2nd",
    "transfers": 0,
    "carrier": "CD",
    "url": "https://www.cd.cz/en/spojeni-a-jizdenka/",
    "scrapedAt": "2026-06-09T10:30:00.000Z"
}
```

### Train types on Czech Railways

| Code | Name | Description |
|------|------|-------------|
| SC | SuperCity Pendolino | Premium tilting train, Praha-Ostrava |
| RJ | railjet | High-speed international trains |
| EC | EuroCity | International express trains |
| IC | InterCity | Domestic long-distance express |
| Ex | Expres | Fast domestic trains |
| R | Rychlik | Regional express trains |
| Sp | Spesny | Semi-fast regional trains |
| Os | Osobni | Local stopping trains |

Other carriers on the Czech network include **RegioJet** (private operator, yellow trains) and **LEO Express** (private operator, premium service).

### Popular routes

- **Praha - Brno** (2h 30min, SC Pendolino or EC)
- **Praha - Ostrava** (3h 15min, SC Pendolino)
- **Praha - Plzen** (1h 30min, Ex or R)
- **Praha - Olomouc** (2h 15min, EC or R)
- **Praha - Ceske Budejovice** (2h 30min, R or Ex)
- **Brno - Ostrava** (1h 30min, EC or R)
- **Praha - Karlovy Vary** (3h, R)
- **Praha - Vienna** (4h, RJ railjet)
- **Praha - Berlin** (4h 30min, EC)
- **Praha - Budapest** (6h 45min, EC)

### Cost estimate

It costs $0.02 per run plus $0.002 per result — a search returning 20 train connections costs about $0.06. The Playwright browser session used to clear the site's anti-bot layer doesn't add to that price; it's absorbed into the per-result rate.

### Limitations

- Fares shown are standard adult prices; discount cards and special offers may not be reflected
- The actor scrapes the public website and results depend on CD.cz availability
- Station names should match what CD.cz accepts (Czech names work best, e.g., "Praha" not "Prague")
- Date must be within the CD booking window (typically up to 60 days ahead)
- Data is scraped from the public website and may change without notice

# Actor input Schema

## `origin` (type: `string`):

Departure station or city name (e.g., Praha, Brno, Ostrava, Plzen, Olomouc).

## `destination` (type: `string`):

Arrival station or city name (e.g., Brno, Praha, Ostrava, Cesky Krumlov, Karlovy Vary).

## `departureDate` (type: `string`):

Travel date in YYYY-MM-DD format. Defaults to 14 days from today if not set.

## `passengers` (type: `integer`):

Number of adult passengers.

## `maxResults` (type: `integer`):

Maximum number of train results to return.

## `proxyConfiguration` (type: `object`):

Proxy settings for better reliability. Residential proxies recommended for consistent results.

## Actor input object example

```json
{
  "origin": "Praha",
  "destination": "Brno",
  "passengers": 1,
  "maxResults": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CZ"
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "origin": "Praha",
    "destination": "Brno",
    "maxResults": 5,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "CZ"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/cd-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "origin": "Praha",
    "destination": "Brno",
    "maxResults": 5,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "CZ",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/cd-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "origin": "Praha",
  "destination": "Brno",
  "maxResults": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CZ"
  }
}' |
apify call studio-amba/cd-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,studio-amba/cd-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jn3fKcBMsbfS9U1Ba/builds/LM1x6vBs4jcN6zn8H/openapi.json
