This project is a reverse-engineering of the Ryanair API that allows collecting daily prices of flights. There are two API Endpoints supported:
- Fare-Finder Ryanair API: where you can query all flights departing or arriving to a specific airport in a range of dates.
- Booking API: where you can query all the flights departing from a specified airport and arriving to another specified airport in a range of dates.
Note that I have found that the prices between the two APIs differ in rare cases. The most trustable source being the Booking API, as it is the one used one booking in the Ryanair website.
The goal of this tool is to collect data to feed machine learning models to forecast Ryanair prices. Please feel free to fork or contribute to this project. Keep in mind this is a personal project, feedback is more than welcome.
Please follow the next steps to call the Fare-Finder API or the Booking API in your system:
- Open a terminal and clone the repository using:
git clone https://github.com/mbalos16/ryanair_timecapsule.git
- Navigate to the cloned folder using the
cd
command. - Create a new python environment using the following command:
python -m venv .venv
- Activate the python environment with
source .venv/bin/activate
- Install the requirements by using
pip install -r requirements.txt
- Install the library by using
pip install -e
python download_fares_data.py \
--depart-iata-code STN \
--depart-date-from 2024-10-08 \
--depart-date-to 2024-11-15 \
--depart-time-from 06:00 \
--depart-time-to 00:00 \
--duration-from 1 \
--duration-to 4 \
--n-passangers 1 \
--market en-gb \
--out-dir <output-directory>
python download_booking.py \
--depart-iata-code STN \
--destination-iata-code VLC \
--depart-date-from 2024-10-25 \
--depart-date-to 2024-11-10 \
--n-adults 1 \
--n-teenagers 0 \
--n-children 0 \
--n-infants 0 \
--out-dir <output-directory>
Pull requests and issues are welcome.
This repository is licensed under CC0. More info in the LICENSE file.
Copyright (c) 2024 Maria Magdalena Balos