# PKP Scraper - Polish Train Fares & Schedules (`studio-amba/pkp-scraper`) Actor

Scrape train schedules, fares, and availability from PKP Intercity (ebilet.intercity.pl). Extract EIP, EIC, IC, and TLK routes across Poland. No login required.

- **URL**: https://apify.com/studio-amba/pkp-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

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### How to scrape PKP data

**PKP Scraper** extracts train schedules, ticket fares, and availability from [PKP Intercity](https://www.intercity.pl) — Poland's national railway operator for long-distance and intercity services. PKP Intercity operates Express InterCity Premium (EIP), Express InterCity (EIC), InterCity (IC), and TLK trains connecting all major Polish cities and select international destinations.

This Actor uses Playwright to navigate PKP Intercity's booking platform (ebilet.intercity.pl), search for connections, and return structured data including train numbers, types, schedules, and fares in PLN. Falls back to rozklad-pkp.pl timetable data when the booking site is unavailable. **No login or cookies required.**

### Why use PKP Scraper?

- **Fare monitoring** -- Track ticket prices across routes and dates to find cheap Super Promo fares or monitor pricing trends.
- **Timetable research** -- Compare routes, durations, and train types (EIP, EIC, IC, TLK) for any Polish destination.
- **Market intelligence** -- Collect structured pricing data for competitive analysis in the Polish travel market.
- **Availability tracking** -- Monitor seat availability for popular routes like Warszawa-Krakow or Warszawa-Gdansk.
- **API access** -- Get PKP train data via Apify API, webhooks, or scheduled runs. Integrate with Zapier, Make, Google Sheets, or your own applications.

### What data can you extract from PKP Intercity?

| Field | Description |
|---|---|
| trainNumber | Train service number (e.g., EIP 3500) |
| trainType | Service type (EIP, EIC, IC, TLK, EC) |
| departureStation | Departure station or city |
| arrivalStation | Arrival station or city |
| departureTime | Departure time (HH:mm) |
| arrivalTime | Arrival time (HH:mm) |
| duration | Total travel time (e.g., 2h 30min) |
| price | Ticket price in PLN |
| currency | Currency code (PLN) |
| travelClass | Seat class (1st, 2nd) |
| changes | Number of transfers |
| carrier | Operating company (PKP Intercity, Polregio) |
| url | Source URL |
| scrapedAt | Timestamp of extraction |

### How to use PKP Scraper

1. Go to the PKP Scraper [input page](https://console.apify.com/actors/pkp-scraper/input).
2. Enter your **origin** station (e.g., Warszawa) and **destination** station (e.g., Krakow).
3. Optionally set a **departure date** in YYYY-MM-DD format. If left empty, defaults to 14 days from today.
4. Set the number of **passengers** (default: 1).
5. Configure **max results** to limit the number of connections returned.
6. Click **Start** and wait for the run to complete.
7. Download your data from the **Dataset** tab in JSON, CSV, Excel, or HTML format.

### Input parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| origin | string | Warszawa | Departure station name (Polish) |
| destination | string | Krakow | Arrival station name (Polish) |
| departureDate | string | 14 days from today | Travel date (YYYY-MM-DD) |
| passengers | integer | 1 | Number of adult passengers (1-9) |
| maxResults | integer | 50 | Maximum results to return |
| proxyConfiguration | object | Residential PL | Proxy settings (residential recommended) |

#### Example input

```json
{
    "origin": "Warszawa",
    "destination": "Gdansk",
    "departureDate": "2026-07-15",
    "passengers": 1,
    "maxResults": 30
}
````

### Output example

```json
{
    "trainNumber": "EIP 3500",
    "trainType": "EIP",
    "departureStation": "Warszawa",
    "arrivalStation": "Krakow",
    "departureTime": "06:30",
    "arrivalTime": "08:58",
    "duration": "2h 28min",
    "price": 119.0,
    "currency": "PLN",
    "travelClass": "2nd",
    "changes": 0,
    "carrier": "PKP Intercity",
    "url": "https://ebilet.intercity.pl",
    "scrapedAt": "2026-06-09T10:30:00.000Z"
}
```

### How much does it cost to scrape PKP Intercity?

A typical run searching one route returns 10-30 connections and costs approximately **$0.10-0.25** in Apify platform credits, depending on proxy usage and load times. The Actor uses Playwright (browser-based) because PKP's booking site is a React single-page application.

To keep costs down:

- Set `maxResults` to only what you need.
- Use a specific departure date rather than leaving it to default.
- Schedule runs during off-peak hours for faster loading.

### Supported routes

PKP Intercity covers all major Polish intercity routes and select international connections:

- **Express InterCity Premium (EIP)** -- Warszawa-Krakow, Warszawa-Gdansk, Warszawa-Wroclaw, Warszawa-Katowice. Pendolino high-speed trains at up to 200 km/h.
- **Express InterCity (EIC)** -- Long-distance express services connecting major cities with fewer stops.
- **InterCity (IC)** -- Standard intercity connections across Poland.
- **TLK (Twoje Linie Kolejowe)** -- Budget long-distance trains with lower fares and more stops.
- **International** -- Connections to Berlin, Prague, Vienna, Budapest, and other European cities via EuroCity (EC) and EuroNight (EN) services.

#### Popular routes

| Route | Distance | Typical Duration | Train Types |
|---|---|---|---|
| Warszawa - Krakow | 293 km | 2h 20min - 3h 30min | EIP, EIC, IC, TLK |
| Warszawa - Gdansk | 340 km | 2h 40min - 4h 00min | EIP, EIC, IC |
| Warszawa - Wroclaw | 344 km | 3h 30min - 5h 00min | EIC, IC, TLK |
| Warszawa - Poznan | 310 km | 2h 30min - 3h 30min | EIC, IC, TLK |
| Warszawa - Katowice | 300 km | 2h 30min - 3h 45min | EIP, EIC, TLK |
| Krakow - Gdansk | 600 km | 5h 00min - 7h 00min | EIC, IC |
| Wroclaw - Gdansk | 490 km | 4h 30min - 6h 30min | EIC, IC |

### Tips for best results

- **Use Polish station names** -- The Actor works best with Polish names: "Warszawa" (not "Warsaw"), "Gdansk" (not "Gdanks"), "Wroclaw" (not "Breslau"), "Lodz" (not "Lodsch").
- **Use residential proxies** -- PKP Intercity may block non-Polish IP addresses. Residential proxies with PL country code provide the best success rate.
- **Set realistic dates** -- PKP Intercity typically shows results 30 days in advance. Super Promo fares are released exactly 30 days before travel.
- **Station name variants** -- For Warsaw, use "Warszawa" (includes Centralna, Zachodnia, and Wschodnia). For specific stations, use the full name like "Warszawa Centralna".

### Integrations

Connect PKP Scraper to your workflow with:

- **Apify API** -- Call programmatically from any language.
- **Webhooks** -- Get notified when a run completes.
- **Scheduled runs** -- Monitor fares daily or weekly.
- **Zapier / Make** -- No-code integration with 5000+ apps.
- **Google Sheets** -- Export results directly to a spreadsheet.

### FAQ

#### Is it legal to scrape PKP Intercity?

This Actor extracts publicly available train schedule and pricing information that any visitor can see on ebilet.intercity.pl. No login, authentication, or account is required. Always ensure your use case complies with applicable laws and PKP Intercity's terms of service.

#### Why did my run return zero results?

PKP Intercity's booking site (ebilet.intercity.pl) is a React SPA that may block automated requests. Make sure you are using residential proxies with PL country code. Also verify that your station names use Polish spelling and your departure date is in the future and within the 30-day booking window.

#### Can I scrape multiple routes in one run?

Currently the Actor searches one route per run. To scrape multiple routes, trigger separate runs with different origin/destination combinations using the Apify API or scheduler.

#### What is the difference between EIP, EIC, IC, and TLK?

- **EIP (Express InterCity Premium)** -- Fastest trains (Pendolino), seat reservation mandatory, premium pricing.
- **EIC (Express InterCity)** -- Fast long-distance, seat reservation mandatory.
- **IC (InterCity)** -- Standard intercity, seat reservation optional.
- **TLK (Twoje Linie Kolejowe)** -- Budget long-distance, cheapest fares, more stops.

#### How often are PKP prices updated?

PKP Intercity uses dynamic pricing. Super Promo fares (cheapest) are released 30 days before travel and sell out quickly. For price tracking, schedule runs daily at a consistent time.

### Support and feedback

If you encounter issues or have feature requests, please open an issue in the [Issues tab](https://console.apify.com/actors/pkp-scraper/issues). For custom scraping solutions, reach out via the Actor's page on the Apify Store.

# Actor input Schema

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

Departure station or city name in Polish (e.g., Warszawa, Gdansk, Wroclaw, Poznan, Lodz).

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

Arrival station or city name in Polish (e.g., Krakow, Gdansk, Katowice, Szczecin, Lublin).

## `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. Residential proxies with PL country recommended for best results.

## Actor input object example

```json
{
  "origin": "Warszawa",
  "destination": "Krakow",
  "passengers": 1,
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "PL"
  }
}
```

# 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": "Warszawa",
    "destination": "Krakow",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "PL"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/pkp-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": "Warszawa",
    "destination": "Krakow",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "PL",
    },
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "Warszawa",
  "destination": "Krakow",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "PL"
  }
}' |
apify call studio-amba/pkp-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=studio-amba/pkp-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "PKP Scraper - Polish Train Fares & Schedules",
        "description": "Scrape train schedules, fares, and availability from PKP Intercity (ebilet.intercity.pl). Extract EIP, EIC, IC, and TLK routes across Poland. No login required.",
        "version": "0.1",
        "x-build-id": "AKHObS9xKP2kyUgdA"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/studio-amba~pkp-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-studio-amba-pkp-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/studio-amba~pkp-scraper/runs": {
            "post": {
                "operationId": "runs-sync-studio-amba-pkp-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/studio-amba~pkp-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-studio-amba-pkp-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "origin": {
                        "title": "Origin Station",
                        "type": "string",
                        "description": "Departure station or city name in Polish (e.g., Warszawa, Gdansk, Wroclaw, Poznan, Lodz).",
                        "default": "Warszawa"
                    },
                    "destination": {
                        "title": "Destination Station",
                        "type": "string",
                        "description": "Arrival station or city name in Polish (e.g., Krakow, Gdansk, Katowice, Szczecin, Lublin).",
                        "default": "Krakow"
                    },
                    "departureDate": {
                        "title": "Departure Date",
                        "type": "string",
                        "description": "Travel date in YYYY-MM-DD format. Defaults to 14 days from today if not set."
                    },
                    "passengers": {
                        "title": "Passengers",
                        "minimum": 1,
                        "maximum": 9,
                        "type": "integer",
                        "description": "Number of adult passengers.",
                        "default": 1
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of train results to return.",
                        "default": 50
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings. Residential proxies with PL country recommended for best results."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
