# Ozon Travel Train Tickets Scraper · Ж/д билеты Ozon Travel (`theshark/ozon-trains-scraper`) Actor

Ozon Travel train tickets for your route and date: every train with times, stations, car types, free seats, price per seat, stops, price calendar. Ж/д билеты Ozon Travel по маршруту и дате: поезда, вокзалы, типы вагонов, свободные места, цена за место, остановки.

- **URL**: https://apify.com/theshark/ozon-trains-scraper.md
- **Developed by:** [TheShark](https://apify.com/theshark) (community)
- **Categories:** Travel, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 trains

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Ozon Travel Train Tickets Scraper · Ж/д билеты Ozon Travel

Scrape **train tickets from Ozon Travel** (ozon.ru, Russian Railways and others): give a **route** — city or station
names in Russian («Москва — Санкт-Петербург»), «Express» station codes (`2000000-2004000`) or a train search link from
the site — a **date** (one way or a round trip) and **passengers** — get every train Ozon finds with departure and
arrival, stations, travel time, **car types with free seats and the price per seat**, badges (fast, branded, the
cheapest). No Ozon account needed.

*Описание на русском — ниже, в разделе «По-русски».*

### Why this Actor

- **Free seats by car type** — seated, platzkart, coupe, SV, lux — with the cheapest seat of each.
- **Lower and upper berths** — with **Cars and seats**, every car of a train with its class and free berths.
- **The cheapest day for free** — a price calendar a week before and after your date in a free summary row.
- **Round trips done right** — there and back are two searches, as tickets are bought for each direction.
- **Dates relative to the run day** — schedule «departure in 14 days» for daily monitoring.
- **Proxies included** — nothing to set up.

### What you can use it for

- **Seat watch** — a daily (or hourly) run tells when coupe seats or lower berths appear on your train.
- **Fare monitoring** — the price per seat by car type, day after day.
- **Rail market research** — trains, travel times and prices on a route.

### How to use

1. Enter **routes**, one per line: «Москва — Санкт-Петербург», station codes `2000000-2004000` or a search link.
2. Set **Departure date** (and **Return date** for a round trip) — or **Departure days from run day**.
3. Set passengers and, if you like, **Only these car types**, **Cars and seats**, **Train route**.
4. Run it — a summary row per search and a row per train appear in the dataset.

### Input example

```json
{
  "trains": ["Москва — Санкт-Петербург"],
  "departure_days_ahead": 14,
  "train_car_types": ["compartment"],
  "train_cars": true,
  "max_results": 10
}
```

### Output example

A train and its search summary from a real run (trimmed):

```json
{
  "type": "train",
  "route": "2000000-2004000",
  "origin_name": "Москва",
  "destination_name": "Санкт-Петербург",
  "departure_date": "2026-11-19",
  "direction": "there",
  "position": 1,
  "name": "030У",
  "departure": "2026-11-19T00:01",
  "arrival": "2026-11-19T09:32",
  "duration": "9ч 31м",
  "origin_station": "Восточный вокзал",
  "destination_station": "Московский вокзал",
  "price": 2287,
  "price_without_card": 2329,
  "currency": "RUB",
  "seats": 416,
  "car_types": [
    {"name": "Сидячий", "seats": 87, "price": 2287, "price_without_card": 2329},
    {"name": "Купе", "seats": 329, "price": 4715, "price_without_card": 4799}
  ],
  "badges": ["Скорый", "Фирменный"],
  "services": ["Постельное белье", "Вагон-ресторан или купе-буфет"]
}
```

```json
{
  "type": "train_search",
  "origin": "2000000",
  "destination": "2004000",
  "departure_date": "2026-11-19",
  "direction": "there",
  "status": "ok",
  "total": 41,
  "min_price": 1201,
  "car_prices": {"Сидячий": 1201, "Плацкарт": 1816, "Купе": 3145, "СВ": 9842, "Люкс": 44067},
  "seats": 9632,
  "price_calendar": {"2026-11-12": 1025, "2026-11-13": 1525, "2026-11-14": 1420}
}
```

### What you get

A free summary row per search (`type = train_search`): `origin`, `destination` (codes and names), `departure_date`,
`direction` (`there` / `back` — a round trip is two searches: train tickets are bought for each direction), passengers,
`total` — how many trains Ozon found, `min_price` — the cheapest seat among all trains, the `cheapest` train,
`car_prices` — the cheapest seat by car type («Плацкарт», «Купе», «СВ», «Сидячий», «Люкс»), `seats` — free seats in all
trains, and `price_calendar` — the cheapest «from» price for every day a week before and after your date.

A row per train (`type = train`): `route`, `position`, `name` («Арктика, 016А»), `numbers`, `brands`, `departure` and
`arrival` (local time; the arrival date when it is another day), `duration`, `origin_station` and
`destination_station`, `price` (per seat, with Ozon Bank) and `price_without_card`, `seats`, `car_types` — every type
with free seats and the price «from», `badges`, `services` («Питание», «Вагон-ресторан»), `miles`; trips with a
transfer — `transfers` and `transfer_text` («Пересадка со сменой вокзала 3ч 31м»).

**Cars and seats** — opens the «Choose a car and seats» window of every train: every car with its number, class
(«3Б», «2К»…), free seats, **lower and upper berths**, price with and without Ozon Bank, services (+2 requests per train).

**Train route** — stops with arrival and departure times and stop duration, the carrier and e-registration (+1 request
per train).

**Only these car types** — only trains with coupe (or SV, platzkart…), and the cheapest seat among them.

### Pricing

| Event | Price | What it is |
|---|---|---|
| `train` | $1.99 / 1,000 | a train row |
| Actor start | $0.01 | once per run; Apify counts one start per GB of memory — $0.02 at the default 2 GB |

For example, a round trip with 10 trains each way costs $0.04 + $0.02 for the start. Summary rows (and searches whose
station wasn't found or that didn't open) are free. The **Pricing** tab always has the up-to-date prices.

### Good to know

- Ozon Travel is on ozon.ru only; prices are in RUB **per seat** (the same for every passenger).
- Ozon doesn't list trains with no free seats — a train that disappears from the results is sold out.
- Up to 4 passengers with a seat; children under 5 without a seat — no more than adults.
- **Cars and seats** and **Train route** — for up to 20 trains per search; cars are not shown for trips with a
  transfer.
- At night (around 03:30–04:00 Moscow time) Ozon's train search sometimes fails — such a search gets the status
  `error` and costs nothing; run it again later.

***

### По-русски

Собирает **ж/д билеты Ozon Travel** (ozon.ru; поезда РЖД и других перевозчиков). Укажите **маршрут** — названия
городов или станций по-русски («Москва — Санкт-Петербург»), коды станций «Экспресс» (`2000000-2004000`) или ссылку на
поиск поездов с сайта, — **дату** (в одну сторону или туда-обратно) и **пассажиров**. В ответ — все поезда, которые
находит Озон: отправление и прибытие, вокзалы, время в пути, **типы вагонов со свободными местами и ценой за место**,
отметки (скорый, фирменный, самый дешёвый). Аккаунт на Озоне не нужен.

#### Зачем этот актор

- **Свободные места по типам вагонов** — сидячий, плацкарт, купе, СВ, люкс — и самое дешёвое место в каждом.
- **Нижние и верхние места** — с **Вагоны и места** видно каждый вагон поезда: его класс и свободные места.
- **Самый дешёвый день — бесплатно** — календарь цен на неделю до и после вашей даты, в бесплатной строке-сводке.
- **Туда-обратно — как положено** — это два поиска: билеты на поезд покупают на каждое направление отдельно.
- **Даты от дня запуска** — поставьте в расписание «отправление через 14 дней» и следите каждый день.
- **Прокси включены** — настраивать ничего не нужно.

#### Для чего подходит

- **Отслеживание мест** — запуск раз в день (или раз в час) покажет, когда на вашем поезде появились места в купе или
  нижние места.
- **Отслеживание цен** — цена за место по типам вагонов, день за днём.
- **Изучение ж/д рынка** — какие поезда ходят по маршруту, сколько едут и сколько стоят.

#### Как запустить

1. Впишите **Маршруты**, по одному в строке: «Москва — Санкт-Петербург», коды станций `2000000-2004000` или ссылку на
   поиск.
2. Заполните **Дата отправления** (для поездки туда-обратно — ещё **Дата обратно**) или **Отправление через дней от
   запуска**.
3. Укажите пассажиров и, если нужно, — **Только эти типы вагонов**, **Вагоны и места**, **Маршрут поезда (остановки)**.
4. Запустите — в датасете появятся строка-сводка на каждый поиск и строка на каждый поезд.

#### Пример входа

```json
{
  "trains": ["Москва — Санкт-Петербург"],
  "departure_days_ahead": 14,
  "train_car_types": ["compartment"],
  "train_cars": true,
  "max_results": 10
}
```

#### Пример результата

Поезд и сводка по его поиску из настоящего запуска (сокращено):

```json
{
  "type": "train",
  "route": "2000000-2004000",
  "origin_name": "Москва",
  "destination_name": "Санкт-Петербург",
  "departure_date": "2026-11-19",
  "direction": "there",
  "position": 1,
  "name": "030У",
  "departure": "2026-11-19T00:01",
  "arrival": "2026-11-19T09:32",
  "duration": "9ч 31м",
  "origin_station": "Восточный вокзал",
  "destination_station": "Московский вокзал",
  "price": 2287,
  "price_without_card": 2329,
  "currency": "RUB",
  "seats": 416,
  "car_types": [
    {"name": "Сидячий", "seats": 87, "price": 2287, "price_without_card": 2329},
    {"name": "Купе", "seats": 329, "price": 4715, "price_without_card": 4799}
  ],
  "badges": ["Скорый", "Фирменный"],
  "services": ["Постельное белье", "Вагон-ресторан или купе-буфет"]
}
```

```json
{
  "type": "train_search",
  "origin": "2000000",
  "destination": "2004000",
  "departure_date": "2026-11-19",
  "direction": "there",
  "status": "ok",
  "total": 41,
  "min_price": 1201,
  "car_prices": {"Сидячий": 1201, "Плацкарт": 1816, "Купе": 3145, "СВ": 9842, "Люкс": 44067},
  "seats": 9632,
  "price_calendar": {"2026-11-12": 1025, "2026-11-13": 1525, "2026-11-14": 1420}
}
```

#### Что вы получите

Бесплатная строка-сводка на каждый поиск (`type = train_search`): `origin`, `destination` (коды и названия),
`departure_date`, `direction` (`there` / `back` — туда-обратно — это два поиска: ж/д билеты покупают на каждое
направление отдельно), пассажиры, `total` — сколько поездов нашёл Озон, `min_price` — самое дешёвое место среди всех
поездов, `cheapest` — самый дешёвый поезд, `car_prices` — самое дешёвое место по типам вагонов («Плацкарт», «Купе»,
«СВ», «Сидячий», «Люкс»), `seats` — свободные места во всех поездах и `price_calendar` — самая низкая цена «от» на
каждый день за неделю до и неделю после вашей даты.

Строка на каждый поезд (`type = train`): `route`, `position`, `name` («Арктика, 016А»), `numbers`, `brands`,
`departure` и `arrival` (местное время; если поезд приходит на другой день — с датой прибытия), `duration`,
`origin_station` и `destination_station`, `price` (за место, с Ozon Банком) и `price_without_card`, `seats`,
`car_types` — каждый тип вагонов со свободными местами и ценой «от», `badges`, `services` («Питание», «Вагон-ресторан»),
`miles`; у поездок с пересадкой — ещё `transfers` и `transfer_text` («Пересадка со сменой вокзала 3ч 31м»).

**Вагоны и места** — открывает окно «Выбор вагона и мест» каждого поезда: каждый вагон с номером, классом («3Б»,
«2К»…), свободными местами, **нижними и верхними местами**, ценой с Ozon Банком и без, услугами (+2 запроса на поезд).

**Маршрут поезда (остановки)** — остановки со временем прибытия и отправления и стоянкой, перевозчик и электронная
регистрация (+1 запрос на поезд).

**Только эти типы вагонов** — только поезда с купе (или СВ, плацкартом…), и самое дешёвое место — среди них.

#### Цены

| Событие | Цена | Что это |
|---|---|---|
| `train` | $1,99 / 1000 | строка поезда |
| Запуск актора | $0,01 | один раз за запуск; Apify считает по запуску на каждый ГБ памяти — $0,02 при памяти по умолчанию 2 ГБ |

Например, туда-обратно по 10 поездов в каждую сторону — $0,04 и ещё $0,02 за запуск. Строки-сводки (и поиски, где
станция не нашлась или поиск не открылся) — бесплатно. Актуальные цены — всегда на вкладке **Pricing**.

#### Полезно знать

- Ozon Travel есть только на ozon.ru; цены — в рублях (RUB) и **за место** (для каждого пассажира одинаковые).
- Поезда без свободных мест Озон не показывает: если поезд пропал из выдачи — места на нём закончились.
- С местом — до 4 пассажиров; детей до 5 лет без места — не больше, чем взрослых.
- **Вагоны и места** и **Маршрут поезда (остановки)** — до 20 поездов на поиск; у поездок с пересадкой вагоны не
  показываются.
- Ночью (примерно в 03:30–04:00 по Москве) поиск поездов на Озоне иногда не работает — такой поиск получает статус
  `error` и ничего не стоит; запустите его ещё раз позже.

# Actor input Schema

## `trains` (type: `array`):

One route per line: city or station names in Russian («Москва — Санкт-Петербург»: the site finds the station codes), «Express» station codes (2000000-2004000) or a train search link from ozon.ru/travel/railway (it keeps its own date and passengers). A return date — one more search back.<br><br>По маршруту в строке: названия городов или станций по-русски («Москва — Санкт-Петербург»: коды станций найдёт сайт), коды станций «Экспресс» (2000000-2004000) или ссылка на поиск поездов с ozon.ru/travel/railway (в ней своя дата и пассажиры). Дата обратно — ещё один поиск, обратно.

## `departure_date` (type: `string`):

YYYY-MM-DD. Needed for routes of flights and trains (links have their own dates).<br><br>ГГГГ-ММ-ДД. Нужна для маршрутов авиабилетов и поездов (у ссылок свои даты).

## `return_date` (type: `string`):

YYYY-MM-DD, a round trip (trains: a second search back); empty — one way.<br><br>ГГГГ-ММ-ДД, туда-обратно (поезда: второй поиск, обратно); пусто — в одну сторону.

## `departure_days_ahead` (type: `integer`):

Instead of fixed dates — for scheduled runs: departure this many days after the run day (each run looks at «a week ahead»). 0 — the departure date above; if the departure date is set, it wins.<br><br>Вместо точных дат — для запусков по расписанию: отправление через столько дней после дня запуска (каждый запуск смотрит «через неделю»). 0 — дата отправления выше; если она задана, главная — она.

## `return_after_days` (type: `integer`):

With «Departure days from run day»: return this many days after departure (0 — one way).<br><br>С «Отправление через дней от запуска»: обратно через столько дней после отправления (0 — в одну сторону).

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

Adults and children 10 and older. Prices are per seat; up to 4 passengers with a seat.<br><br>Взрослые и дети от 10 лет. Цены — за место; до 4 пассажиров с местом.

## `children` (type: `integer`):

Adults and children with a seat — up to 4.<br><br>Взрослых и детей с местом — до 4.

## `infants` (type: `integer`):

Not more than adults.<br><br>Не больше, чем взрослых.

## `train_car_types` (type: `array`):

Only trains with these cars, and the cheapest seat — among them. Empty — any cars.<br><br>Только поезда с такими вагонами, и самое дешёвое место — среди них. Пусто — любые вагоны.

## `train_sorting` (type: `string`):

Which trains come first (and are taken when «Products per query or link» limits them). All trains come at once — the cheapest seat of a search is always among all of them.<br><br>Какие поезда идут первыми (и берутся, когда их ограничивает «Товаров на запрос или ссылку»). Все поезда приходят сразу — самое дешёвое место поиска всегда среди всех.

## `max_results` (type: `integer`):

0 — all trains Ozon found (they come at once). Also limited by your max total charge. The cheapest seat — among all trains.<br><br>0 — все поезда, что нашёл Озон (они приходят сразу). Ограничивает и максимальная сумма списаний запуска. Самое дешёвое место — среди всех поездов.

## `train_cars` (type: `boolean`):

Opens the «Choose a car and seats» window of every train: each car with its number, class («3Б», «2К»…), free seats, lower and upper berths, price with and without Ozon Bank, services. +2 requests per train, so up to 20 trains per search; not for trips with a transfer.<br><br>Открывает окно «Выбор вагона и мест» каждого поезда: каждый вагон с номером, классом («3Б», «2К»…), свободными местами, нижними и верхними, ценой с Ozon Банком и без, услугами. +2 запроса на поезд, поэтому до 20 поездов на поиск; не для поездок с пересадкой.

## `train_routes` (type: `boolean`):

Opens the «Train route» window of every train: stops with arrival and departure times, stop duration, carrier, e-registration. +1 request per train, so up to 20 trains per search.<br><br>Открывает окно «Маршрут поезда» каждого поезда: остановки со временем прибытия и отправления, стоянка, перевозчик, электронная регистрация. +1 запрос на поезд, поэтому до 20 поездов на поиск.

## `output_language` (type: `string`):

Language of the Excel workbook, CSV, change details, run status and log. Ozon's own data (product names, characteristics, reviews) comes in the site language (the Language field).<br><br>Язык книги Excel, CSV, подробностей изменений, статуса запуска и лога. Данные самого Озона (названия товаров, характеристики, отзывы) — на языке сайта (поле «Язык сайта»).

## `sessions` (type: `integer`):

Anonymous Ozon buyers working at the same time on each storefront, each with its own proxy session: 2 — about twice as fast as 1. Sessions are kept in the history store, so a browser opens for a new one only once.<br><br>Анонимные покупатели Озона, которые работают одновременно на каждой витрине, у каждого — своя сессия прокси: 2 — примерно вдвое быстрее, чем 1. Сессии хранятся в хранилище истории, поэтому браузер для новой открывается только один раз.

## `browsers` (type: `integer`):

A browser (~320 MB) opens only to get a new Ozon session (they are kept in the history store, so mostly on the first run). Several at once — the first run starts faster. Capped by run memory: 1 GB — 1, 2 GB — 3, 4 GB — 7.<br><br>Браузер (~320 МБ) открывается, только чтобы получить новую сессию Озона (они хранятся в хранилище истории — значит, в основном при первом запуске). Несколько сразу — первый запуск начинается быстрее. Ограничено памятью запуска: 1 ГБ — 1, 2 ГБ — 3, 4 ГБ — 7.

## `history_store` (type: `string`):

Name of the key-value store in your account that keeps price history between runs. Different names — separate histories. Runs with the same store don't overlap: a second one waits up to 10 minutes for the first to finish.<br><br>Имя key-value store в вашем аккаунте, где хранится история цен между запусками. Разные имена — отдельные истории. Запуски с одним хранилищем не пересекаются: второй ждёт до 10 минут, пока закончит первый.

## `proxy_ru` (type: `string`):

user:pass@host:port, residential, Russia — one per line: every Ozon session gets its own (one line — all sessions share it). Empty — the actor's built-in proxies of this country (included in the price).<br><br>user:pass@host:port, резидентные, Россия — по одному в строке: каждой сессии Озона — свой (одна строка — общий на все сессии). Пусто — встроенные прокси актора этой страны (входят в цену).

## Actor input object example

```json
{
  "trains": [
    "Москва — Санкт-Петербург"
  ],
  "departure_days_ahead": 14,
  "return_after_days": 0,
  "passengers": 1,
  "children": 0,
  "infants": 0,
  "train_car_types": [],
  "train_sorting": "departure",
  "max_results": 10,
  "train_cars": false,
  "train_routes": false,
  "output_language": "en",
  "sessions": 8,
  "browsers": 3,
  "history_store": "ozon-trains-history"
}
```

# Actor output Schema

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

Dataset rows. Строки датасета.

## `summary` (type: `string`):

OUTPUT record: how many rows were delivered and every change since the previous run. Запись OUTPUT: сколько строк отдано и все изменения с прошлого запуска.

# 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 = {
    "trains": [
        "Москва — Санкт-Петербург"
    ],
    "departure_days_ahead": 14,
    "max_results": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("theshark/ozon-trains-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 = {
    "trains": ["Москва — Санкт-Петербург"],
    "departure_days_ahead": 14,
    "max_results": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("theshark/ozon-trains-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 '{
  "trains": [
    "Москва — Санкт-Петербург"
  ],
  "departure_days_ahead": 14,
  "max_results": 10
}' |
apify call theshark/ozon-trains-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,theshark/ozon-trains-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/CyGDbbQd8T3aa8vsj/builds/pkcU8gjD2ORov5l19/openapi.json
