Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richarah/aviasales-python
Unofficial Python wrapper for accessing flight ticket prices, routes, and other data via the Aviasales Flight Data API
https://github.com/richarah/aviasales-python
api aviasales aviasales-api cheap-flights flight flights flights-api flights-search python python3 travel trip
Last synced: about 7 hours ago
JSON representation
Unofficial Python wrapper for accessing flight ticket prices, routes, and other data via the Aviasales Flight Data API
- Host: GitHub
- URL: https://github.com/richarah/aviasales-python
- Owner: richarah
- License: mit
- Created: 2025-02-12T09:21:06.000Z (1 day ago)
- Default Branch: master
- Last Pushed: 2025-02-12T10:14:23.000Z (1 day ago)
- Last Synced: 2025-02-12T10:33:05.778Z (1 day ago)
- Topics: api, aviasales, aviasales-api, cheap-flights, flight, flights, flights-api, flights-search, python, python3, travel, trip
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aviasales-python
A Python wrapper for accessing flight ticket prices, routes, and other data via the Aviasales Flight Data API
## Features
* Retrieve the cheapest tickets for specific dates.
* Fetch the latest ticket prices over a period of time.
* Explore flight price trends in a calendar format.
* Get prices for alternative (nearest) directions.
* Access popular routes for specific airlines and cities.
* Retrieve airline logos and currency exchange rates.
* Support for one-way and round-trip flights, non-stop searches, and custom sorting.## Requirements
* Python 3.12
* `requests` library
* `python-dotenv` library for environment variable management## Installation
1. Clone the repository:
git clone https://github.com/richarah/aviasales-python.git2. Navigate into the project folder:
cd aviasales-python3. Install the required dependencies:
pip install -r requirements.txt4. (Optional) If you wish to use the wrapper in different currencies or markets, you can modify the `currency` and `market` parameters in the `AviasalesAPI` class when instantiating it.
## Usage
1. **Import the API Wrapper:**
`from aviasales import AviasalesAPI`2. **Initialize the API Wrapper:**
`api = AviasalesAPI(API_TOKEN)`3. **Usage:**
* Get the latest prices for a period:
`data = api.get_latest_prices("OSL", "ALC", "2025-12-07", "year")`## Methods
The following methods are available in the `AviasalesAPI` class:
* `prices_for_dates`: Get prices for specific dates.
* `get_latest_prices`: Get prices over a specific period.
* `prices_month_matrix`: Get a matrix of prices for a given month.
* `prices_nearest_places_matrix`: Get prices for nearest directions.
* `prices_week_matrix`: Get a weekly calendar of prices.
* `prices_cheap`: Get the cheapest tickets, including options with transfers.
* `grouped_prices`: Get the cheapest tickets grouped by an attribute.
* `prices_direct`: Get the cheapest non-stop tickets.
* `prices_calendar`: Get flight price trends in a calendar format.
* `airline_directions`: Get popular routes for a given airline.
* `city_directions`: Get the most popular destinations from a specified city.
* `popular_directions`: Get the cheapest tickets to popular destinations.
* `special_offers`: Get special flight offers.
* `currency_rates`: Get current exchange rates.
* `airline_logo`: Get the URL of an airline's logo.## License
MIT