Skip to main content

Ryanair Python

Testing status Coverage Status

This module allows you to retrieve the cheapest flights, with or without return flights, within a fixed set of dates.

This is done directly through Ryanair's API, and does not require an API key.

Disclaimer

DISCLAIMER: This library is not affiliated, endorsed, or sponsored by Ryanair or any of its affiliates.
All trademarks related to Ryanair and its affiliates are owned by the relevant companies.
The author(s) of this library assume no responsibility for any consequences resulting from the use of this library.
The author(s) of this library also assume no liability for any damages, losses, or expenses that may arise from the use of this library.
Any use of this library is entirely at the user's own risk.
It is solely the user's responsibility to ensure compliance with Ryanair's terms of use and any applicable laws and regulations.
The library is an independent project aimed at providing a convenient way to interact with the Ryanair API, allowing individuals to find flights for personal use, and then ultimately purchase them via Ryanair's website. While the author(s) will make efforts to ensure the library's functionality, they do not guarantee the accuracy, completeness, or timeliness of the information provided.
The author(s) do not guarantee the availability or continuity of the library, and updates may not be guaranteed.
Support for this library may be provided at the author(s)'s discretion, but it is not guaranteed.
Users are encouraged to report any issues or feedback to the author(s) via appropriate channels.
By using this library, users acknowledge that they have read, understood, and agreed to the terms of this disclaimer.

Installation

Run the following command in the terminal:

pip install ryanair-py

Usage

To create an instance:

from ryanair import Ryanair

# You can set a currency at the API instance level, so could also be GBP etc. also.
# Note that this may not *always* be respected by the API, so always check the currency returned matches
# your expectation.
api = Ryanair("EUR")

Get the cheapest one-way flights

Get the cheapest flights from a given origin airport (returns at most 1 flight to each destination).

from datetime import datetime, timedelta
from ryanair import Ryanair
from ryanair.types import Flight

api = Ryanair(currency="EUR")  # Euro currency, so could also be GBP etc. also
tomorrow = datetime.today().date() + timedelta(days=1)

flights = api.get_cheapest_flights("DUB", tomorrow, tomorrow + timedelta(days=1))

# Returns a list of Flight namedtuples
flight: Flight = flights[0]
print(flight)  # Flight(departureTime=datetime.datetime(2023, 3, 12, 17, 0), flightNumber='FR9717', price=31.99, currency='EUR' origin='DUB', originFull='Dublin, Ireland', destination='GOA', destinationFull='Genoa, Italy')
print(flight.price)  # 9.78

Get the cheapest return trips (outbound and inbound)

from datetime import datetime, timedelta
from ryanair import Ryanair

api = Ryanair(currency="EUR")  # Euro currency, so could also be GBP etc. also
tomorrow = datetime.today().date() + timedelta(days=1)
tomorrow_1 = tomorrow + timedelta(days=1)

trips = api.get_cheapest_return_flights("DUB", tomorrow, tomorrow, tomorrow_1, tomorrow_1)
print(trips[0])  # Trip(totalPrice=85.31, outbound=Flight(departureTime=datetime.datetime(2023, 3, 12, 7, 30), flightNumber='FR5437', price=49.84, currency='EUR', origin='DUB', originFull='Dublin, Ireland', destination='EMA', destinationFull='East Midlands, United Kingdom'), inbound=Flight(departureTime=datetime.datetime(2023, 3, 13, 7, 45), flightNumber='FR5438', price=35.47, origin='EMA', originFull='East Midlands, United Kingdom', destination='DUB', destinationFull='Dublin, Ireland'))

Release files for ryanair-py 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ryanair-py 3.0.0
File Size Uploaded
ryanair-py-3.0.0.tar.gz 3.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ryanair-py 3.0.0
File Interpreter ABI Platform
ryanair_py-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 MB

Release files / ryanair-py-3.0.0.tar.gz

Download URL ryanair-py-3.0.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
4e43ef083fc54c554cd2071066d3a0c3c7435c75e827ecdcde2411e05e774d98
BLAKE2b-256 checksum
How to use checksums
a54e4a87630a72e17dc12b209e55fa1552b9ada8bae63466cec63c2524e7d34e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / ryanair_py-3.0.0-py3-none-any.whl

Download URL ryanair_py-3.0.0-py3-none-any.whl
Size 3.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
399fc50833bd2b509bbed64e60bfe06fc8e19d4f10c125bc726f0962bc36eaf1
BLAKE2b-256 checksum
How to use checksums
09948cc503d57284788bcdf19a81928ffc43818088d12f832759345d886a93c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.0.6

1 release file

0.0.5

2 release files

0.0.4

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page