# Ryanair Scraper (`epctex/ryanair-scraper`) Actor

Scrape flights from Ryanair. Crawl and extract flights, prices, availability, and more. Creates a Ryanair API to let you scrape based on round trip, one-way trip, and passenger management (adults, teens, children, infants) options.

- **URL**: https://apify.com/epctex/ryanair-scraper.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Categories:** Travel, News
- **Features:** Limited permissions
- **Stats:** 253 total users, 6 monthly users, 100.0% runs succeeded, 16 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.80 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Actor - Ryanair Scraper

### Ryanair scraper

Since Ryanair doesn't provide a good API, this actor should help you to retrieve data from it.

The Ryanair data scraper supports the following features:

- Scrape round trip - you can scrape a complete round trip with departure and return dates.
- Scrape one-way trip - you can scrape a one way trip by just providing the departure date
- Scrape with multiple people options - You can scrape Ryanair with Adults, Teens, Children, and Infants options

### Bugs, fixes, updates, and changelog

This scraper is under active development. If you have any feature requests you can create an issue from [here](https://github.com/epctex-support/ryanair-scraper/issues).

### Input Parameters

The input of this scraper should be JSON-containing. Possible fields are:

- `mode`: (Required) (String) Mode for the actor. It can be either `ROUND` for Round trip or `ONEWAY` for One-way trips.

- `origin`: (Required) (String) 3-letter destination airport code. Ex: VIE.

- `destination`: (Required) (String) Mode for the actor. It can be either `ROUND` for Round trip or `ONEWAY` for One-way trips.

- `departureDate`: (Required) (String) Date for departure. Should be in the format of `YYYY-MM-DD`. Ex: 2021-02-21.

- `returnDate`: (Optional) (String) Date for return. It is required for Round trips. Should be in the format of `YYYY-MM-DD`. Ex: 2021-02-21.

- `adults`: (Required) (Number) Number of adults that will be included on the flight. The minimum number is 1.

- `teens`: (Optional) (Number) Number of teens (12-15 years old) that will be included on the flight.

- `children`: (Optional) (Number) Number of children (2-11 years old) that will be included on the flight.

- `infants`: (Optional) (Number) Number of teens (Under 2 years old) that will be included on the flight.

- `maxItems`: (Optional) (Number) You can limit scraped items. This should be useful when you search through the big lists or search results.

- `proxy`: (Required) (Proxy Object) Proxy configuration.

This solution requires the use of **Proxy servers**, either your own proxy servers or you can use <a href="https://www.apify.com/docs/proxy">Apify Proxy</a>.

#### Compute Unit Consumption

The actor is optimized to run in a very fast manner and scrape the flights in the most performant way. Therefore, it forefronts all flight result requests. If the actor doesn't block very often it'll scrape 10 flights in 3 seconds with ~0.005-0.01 compute units.

#### Ryanair Scraper Input example

```json
{
    "type": "ROUND",
    "origin": "VIE",
    "destination": "BCN",
    "departureTime": "2021-11-02",
    "returnTime": "2021-11-09",
    "adults": 4,
    "children": 3,
    "infants": 2,
    "teens": 1,
    "requestExtension": {
        "timeoutSecs": 100
    }
}
```

### During the Run

During the run, the actor will output messages letting you know what is going on.
When items are loaded from the page, you should see a message about this event with a loaded item count.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

### Ryanair Export

During the run, the actor stores results into a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or <a href="https://www.apify.com/docs/api" target="blank">our API reference</a> to learn more about getting results from this Ryanair actor.

### Scraped Ryanair Flights

The structure of each item in Ryanair flights looks like this:

```json
[
    {
        "Origin": "VIE",
        "Destination": "BCN",
        "Flight duration": "02:20",
        "Flight number": "FR 7350",
        "Price": 19.79,
        "Time departure": "2021-05-02T16:55:00.000",
        "Time arrival": "2021-05-02T19:15:00.000",
        "key": "FR~7350~ ~~VIE~05/02/2021 16:55~BCN~05/02/2021 19:15~~",
        "scrapedAt": "2021-03-16T14:56:12.589Z",
        "regularFare": {
            "fareKey": "M4QWIFT5CMI6W554NIEL57IV6W6IKYDXA4HYK5TOZ3XDXKE5ZIEA2SAQMZI2ZHAVJRZE6PNUMMZ7KMWOLDIQQQ2HHNXOWJLJHJDQHLHLCGLC7XXCR37MU4LSLJKSBC3IISWCP5UWXAKWP2URYKOW6SL6RD5PP5C6G2LVCIRMU52U5OPUZ566RWCNU6MZGWKZO3STLR4N5MEEY",
            "fareClass": "W",
            "fares": [
                {
                    "type": "ADT",
                    "amount": 19.79,
                    "count": 1,
                    "hasDiscount": true,
                    "publishedFare": 19.92,
                    "discountInPercent": 10,
                    "hasPromoDiscount": false,
                    "discountAmount": 0.13,
                    "hasBogof": false
                }
            ]
        },
        "operatedBy": "Buzz"
    },
    {
        "Origin": "BCN",
        "Destination": "VIE",
        "Flight duration": "02:20",
        "Flight number": "FR 7351",
        "Price": 14.44,
        "Time departure": "2021-05-07T19:25:00.000",
        "Time arrival": "2021-05-07T21:45:00.000",
        "key": "FR~7351~ ~~BCN~05/07/2021 19:25~VIE~05/07/2021 21:45~~",
        "scrapedAt": "2021-03-16T14:56:12.589Z",
        "regularFare": {
            "fareKey": "PAZI5RTI7Q6XPJWZ7NWTM2L6ST4EGT5VMEUFJ6XELKMBYO6E32W5J5N7O4Q5CLXR5CGRECNSKTZTI4RKRXUINENX2PFLTWHHXJLAH7T6GXNF4TXMHSLS4XQPUMFFXA2R4HAIMVIEEALOODFNPIWICPXWWWM4NH3WFFECKOB6BG3EM5EO2FZRAG5I74AY26PWUQSTRWRZSY3TS",
            "fareClass": "T",
            "fares": [
                {
                    "type": "ADT",
                    "amount": 14.44,
                    "count": 1,
                    "hasDiscount": true,
                    "publishedFare": 14.63,
                    "discountInPercent": 15,
                    "hasPromoDiscount": false,
                    "discountAmount": 0.19,
                    "hasBogof": false
                }
            ]
        },
        "operatedBy": "Lauda Europe"
    },
    {
        "Origin": "BCN",
        "Destination": "VIE",
        "Flight duration": "02:20",
        "Flight number": "FR 7351",
        "Price": 25.19,
        "Time departure": "2021-05-09T19:50:00.000",
        "Time arrival": "2021-05-09T22:10:00.000",
        "key": "FR~7351~ ~~BCN~05/09/2021 19:50~VIE~05/09/2021 22:10~~",
        "scrapedAt": "2021-03-16T14:56:12.589Z",
        "regularFare": {
            "fareKey": "5DK4JGBZGI3LGJEY7PIPEHFS6AQV5IRPZTGV23N5AMBWJS4ZR22QAPTVTCGN24WMRSPLJGWCHJGIFLZQRXINUUEMCZX4Z5UPWN3RSKZ3R24BNFBGZIKWCFZWXI7IFPO3QDXJPS65E5E4I73IQHMLKGVT7PQ76AJUUPEK33SNLF5NNIMK3M5QCPFUJN3XP6KYFPJX3SC5IYATO",
            "fareClass": "A",
            "fares": [
                {
                    "type": "ADT",
                    "amount": 25.19,
                    "count": 1,
                    "hasDiscount": true,
                    "publishedFare": 25.32,
                    "discountInPercent": 10,
                    "hasPromoDiscount": false,
                    "discountAmount": 0.13,
                    "hasBogof": false
                }
            ]
        },
        "operatedBy": "Buzz"
    }
]
```

### Contact

Please visit us through [epctex.com](https://epctex.com) to see all the products that are available for you. If you are looking for any custom integration or so, please reach out to us through the chat box in [epctex.com](https://epctex.com). In need of support? <business@epctex.com> is at your service.

# Actor input Schema

## `mode` (type: `string`):

Select if you want to search for Round trip or One way

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

3 letter airport code for origin. You can check the codes from here: https://www.nationsonline.org/oneworld/IATA_Codes/airport_code_list.htm

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

3 letter airport code for destination. You can check the codes from here: https://www.nationsonline.org/oneworld/IATA_Codes/airport_code_list.htm

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

Departure date. Should be in format of YYYY-MM-DD

## `returnDate` (type: `string`):

Return date. Should be in format of YYYY-MM-DD. It is only being used for Round trips

## `flexDays` (type: `integer`):

Number of dates before and after departure date. It is being used for getting multiple dates.

## `adults` (type: `integer`):

Number of adults that you want to include to search

## `teens` (type: `integer`):

Number of teens that you want to include to search

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

Number of children that you want to include to search

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

Number of infants that you want to include to search

## `maxItems` (type: `integer`):

Maximum number of items that you want as output. Default is all

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "mode": "ROUND",
  "origin": "BER",
  "destination": "BCN",
  "departureDate": "2023-10-10",
  "returnDate": "2023-10-14",
  "flexDays": 2,
  "adults": 1,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "mode": "ROUND",
    "origin": "BER",
    "destination": "BCN",
    "departureDate": "2023-10-10",
    "returnDate": "2023-10-14",
    "flexDays": 2,
    "adults": 1,
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/ryanair-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 = {
    "mode": "ROUND",
    "origin": "BER",
    "destination": "BCN",
    "departureDate": "2023-10-10",
    "returnDate": "2023-10-14",
    "flexDays": 2,
    "adults": 1,
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/ryanair-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 '{
  "mode": "ROUND",
  "origin": "BER",
  "destination": "BCN",
  "departureDate": "2023-10-10",
  "returnDate": "2023-10-14",
  "flexDays": 2,
  "adults": 1,
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call epctex/ryanair-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,epctex/ryanair-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/56ofuc7YBASB1uWGK/builds/IztQHGjYsbB6GsKVI/openapi.json
