A Python script that:
- Reads a list of destination cities (and optional adults/children counts) from a Google Sheet
- Looks up IATA codes and retrieves round-trip flight-offer data via the Amadeus API
- Finds the cheapest offer and writes its details back to the sheet
- Sends you an email alert when the price meets your target
- Automatic IATA lookup for any city
- Configurable origin airport (changeable in the Google Sheet)
- Currency selection (default: GBP, easily changeable)
- Google Sheets integration via Sheety (GET + PUT)
- Email alerts when cheapest price ≤ your target
main.py
Orchestrates the workflow: fetch sheet data → ensure IATA codes → get cheapest flight → update sheet → send emailflight_search.py
FlightSearchclass: handles Amadeus token, IATA lookups, and flight-offer requestsdata_manager.py
DataManagerclass: GETs and PUTs rows in your Google Sheet via Sheetynotification_manager.py
NotificationManagerclass: formats and sends UTF-8 email alerts
-
Clone this repo
git clone https://github.com/your-user/flight-price-checker.git cd flight-price-checker -
Create & activate a virtual environment
python3 -m venv venv source venv/bin/activate -
Install dependencies
pip install requests pandas python-dotenv
-
Configure environment variables
Create a file named.envin the project root with these entries:# Amadeus API credentials AMADEUS_CLIENT_ID=your_amadeus_api_key AMADEUS_CLIENT_SECRET=your_amadeus_api_secret # Sheety endpoints SHEETY_GET_URL=https://api.sheety.co/…/flightPrices/prices SHEETY_PUT_URL=https://api.sheety.co/…/flightPrices/prices # Email (used for alerts) MY_EMAIL=you@example.com EMAIL_PASSWORD=your_email_password
-
Set your default origin IATA
Inflight_search.py, by default we call:self.default_airpot = self.get_iataCode("Tel Aviv")
Change
"Tel Aviv"to your home-airport city (or directly to its IATA code). -
Set your currency
Inflight_search.pyinside theget_pricemethod, add:"currencyCode": "YOUR DESIRED CURRENCY",
Change
"GBP"(the default) to your desired 3-letter currency code (e.g."ILS","USD", etc.).
-
Populate your Google Sheet
- Columns:
id,city,iataCode(can be blank),adults,children,targetPrice - Fill
cityandtargetPrice—the script will fill in IATA codes and pricing info.
- Columns:
-
Run the script
python main.py
- It will update each row with the cheapest offer details (minPrice, departureDate, arrival, etc.).
- If the price ≤
targetPrice, you’ll receive an email alert.
-
Sheet columns
If you rename or add columns, adjustDataManager.get_data()andupdate_price_info()to match. -
Notification logic
TweakNotificationManager.price_reach_send_email()to include extra details or send to multiple addresses. -
Automation
To run automatically (e.g. daily), add a cron job or GitHub Action that callspython main.py.
- Python 3.8+
requestspandaspython-dotenv
This project is released under the MIT License.