# RegioJet Seat Finder (`tomas.nosek/regiojet-seat-finder`) Actor

Check whether your desired connection by the RegioJet transportation company has any free seats.

- **URL**: https://apify.com/tomas.nosek/regiojet-seat-finder.md
- **Developed by:** [Tomas Nosek](https://apify.com/tomas.nosek) (community)
- **Categories:** Travel, Automation
- **Stats:** 21 total users, 0 monthly users, 100.0% runs succeeded, 1 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/actors/running/actors-in-store.md#pay-per-usage

## 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

### RegioJet Seat Finder

> Check whether your desired connection by the RegioJet transportation company has any free seats.

This [Actor](https://help.apify.com/en/articles/4865788-what-is-an-actor) for [Apify](https://apify.com/) checks RegioJet's website for free seats in your desired connection.

### Input

The Actor's input for RegioJet Seat Finder works based on the URL of RegioJet's search engine. For example:
`https://regiojet.com/?departureDate=2024-06-17&tariffs=REGULAR&fromLocationId=10202003&fromLocationType=CITY&toLocationId=10202002&toLocationType=CITY`

In this URL, there are several parameters to be filled in so that it can check the seats in your desired connection. These mirror the required input 1:1 with one exception.

#### Date of travel

The date of travel is noted as YYYY-MM-DD in the URL. Either select a date using the date picker or type the desired date yourself in the required format. In case of one-digit months or days, always keep the two-digit format. For example, for June 6, 2025, always use "2025-06-06", never "2025-6-6".

#### Destination from and destination to

Before you use this Actor, conduct the search on RegioJet's website on your own to get the right IDs for the destination from and destionation to.

In the above example, the destination from is the number after `fromLocationId=`, i.e., `10202003`, which corresponds to Prague, Czech Republic. The destination to is the number after `toLocationId=`, i.e., `10202002`, which corresponds to Brno, Czech Republic.

Note: The Actor currently only works with cities. If you use an ID of a specific station, it will not work.

#### Departure time

This is not needed for the construction of the URL but it's needed to select, which connection you're after to match the desired time in the connection listing.

Always use the 24h time with 0 for one-digit hours. For example, "08:00" and "23:55" are valid times. "8:00" or "11:55 PM" are invalid.

#### Send email to

When a free spot is found at your desired departure time, the Actor will send you an email with the found spots. This input is optional and if you don't want to get emails (or you want to integrate it differently), leave the field blank.

Note that the Actor integrates the [Send Email](https://apify.com/apify/send-mail) Actor, so the configuration is limited from the Actor. This means that if you're using a free plan, you can only send an email to an adress which you use to run this Actor in Apify.

### Other types of notifications

If you want to send emails to other email addresses on the free plan or use different types of notifications, use the Integrations tab and use some of the options. For example, you can use the [Gmail integration and send emails via Gmail](https://help.apify.com/en/articles/6877852-how-to-integrate-apify-actors-with-gmail) or [send messages to Slack](https://help.apify.com/en/articles/6454058-apify-integration-for-slack).

However, this will by default send email after every check so you might want to ensure your own logic to send emails only when a new free spot is found.

### Fair use policy

Do not use the seat finder in a harmful way. By using this Actor, you agree to:

- Use 15-minute and higher intervals for scheduling
- Turn off the Actor without delay once you book a seat to the desired connection

### Future improvements

Known initiatives for the future:

- Picker of destinations instead of IDs
- Extend the possible destinations with individual stations
- Stopping the Actor automatically once a free seat is found
- Booking the seat directly

# Actor input Schema

## `travelDate` (type: `string`):

The date when you want to travel in the format yyyy-mm-dd.

## `destinationFrom` (type: `string`):

Type the location ID based on the RegioJet listing query string.

## `destinationTo` (type: `string`):

Type the location ID based on the RegioJet listing query string.

## `departureTime` (type: `string`):

Your desired departure time in the format hh:mm. Use the 24-hour time with 0 for one-digit hours, such as 08:00.

## `emailTo` (type: `string`):

Where the email about the finding should be sent. Keep empty if no emails should be sent. Free plans can only send emails to your email address.

## Actor input object example

```json
{
  "travelDate": "2024-08-08",
  "destinationFrom": "10202002",
  "destinationTo": "10202003",
  "departureTime": "17:00",
  "emailTo": "david.hasselhoff@example.com"
}
```

# 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 = {
    "travelDate": "2024-08-08",
    "destinationFrom": "10202002",
    "destinationTo": "10202003",
    "departureTime": "17:00",
    "emailTo": "david.hasselhoff@example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tomas.nosek/regiojet-seat-finder").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 = {
    "travelDate": "2024-08-08",
    "destinationFrom": "10202002",
    "destinationTo": "10202003",
    "departureTime": "17:00",
    "emailTo": "david.hasselhoff@example.com",
}

# Run the Actor and wait for it to finish
run = client.actor("tomas.nosek/regiojet-seat-finder").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 '{
  "travelDate": "2024-08-08",
  "destinationFrom": "10202002",
  "destinationTo": "10202003",
  "departureTime": "17:00",
  "emailTo": "david.hasselhoff@example.com"
}' |
apify call tomas.nosek/regiojet-seat-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tomas.nosek/regiojet-seat-finder"
        }
    }
}
```

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/K9GgUOSzuJvPzm0XS/builds/HfiUArEeaXXSsdMQE/openapi.json
