Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flight Price Tracker

A local flight price tracking application with a web UI. Tracks prices daily and alerts you when prices drop below your target.

Features

  • Search flights using Amadeus API
  • Track multiple routes with daily price checks
  • Set target prices for alerts
  • View price history and trends
  • Simple web UI for easy management

Quick Start

1. Get Amadeus API Keys (Free)

  1. Go to developers.amadeus.com
  2. Create a free account
  3. Create a new app in the dashboard
  4. Copy your API Key and API Secret

2. Configure

cd flight-tracker
cp .env.example .env

Edit .env and add your Amadeus credentials:

AMADEUS_API_KEY=your_api_key
AMADEUS_API_SECRET=your_api_secret

3. Run

./run.sh

Open http://localhost:8000 in your browser.

Usage

Web UI

  1. Search Flights: Enter origin/destination (IATA codes like SFO, JFK), dates, and click "Search Only"
  2. Track Route: Fill in the form and click "Track Route" to start monitoring
  3. Set Target Price: Enter a target price to get notified when prices drop below it
  4. Manual Check: Click "Check" on any route to refresh prices immediately
  5. View History: Click "Details" to see price history and trends

Scheduler

The app automatically checks prices daily at 9:00 AM (configurable in the UI or via environment variables).

API Endpoints

Endpoint Method Description
/api/routes GET List all tracked routes
/api/routes POST Add a new tracked route
/api/routes/{id} GET Get route details with history
/api/routes/{id} PUT Update a route
/api/routes/{id} DELETE Delete a route
/api/routes/{id}/check POST Trigger price check
/api/search POST One-time flight search
/api/scheduler GET Get scheduler status

Full API docs at http://localhost:8000/docs

Configuration

Environment variables (in .env):

Variable Default Description
AMADEUS_API_KEY - Amadeus API key (required)
AMADEUS_API_SECRET - Amadeus API secret (required)
ENABLE_SCHEDULER true Enable automatic daily checks
SCHEDULE_HOUR 9 Hour to run daily check (0-23)
SCHEDULE_MINUTE 0 Minute to run daily check (0-59)
DATABASE_PATH ./data/flights.db SQLite database path

Running on Startup (macOS)

Create a launchd plist to run the tracker automatically:

# Create the plist
cat > ~/Library/LaunchAgents/com.flight-tracker.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.flight-tracker</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/arijroy/personal/flight-tracker/run.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>WorkingDirectory</key>
    <string>/Users/arijroy/personal/flight-tracker</string>
</dict>
</plist>
EOF

# Load it
launchctl load ~/Library/LaunchAgents/com.flight-tracker.plist

IATA Airport Codes

Indian Airports:

  • DEL - Delhi (Indira Gandhi International)
  • BOM - Mumbai (Chhatrapati Shivaji Maharaj)
  • BLR - Bengaluru (Kempegowda International)
  • MAA - Chennai (Chennai International)
  • CCU - Kolkata (Netaji Subhas Chandra Bose)
  • HYD - Hyderabad (Rajiv Gandhi International)
  • GOI - Goa (Manohar International)
  • COK - Kochi (Cochin International)
  • AMD - Ahmedabad (Sardar Vallabhbhai Patel)
  • PNQ - Pune (Pune International)

International:

  • DXB - Dubai
  • SIN - Singapore
  • BKK - Bangkok
  • LHR - London Heathrow
  • JFK - New York JFK

Find more at iata.org

Tech Stack

  • Backend: Python, FastAPI, SQLite
  • Frontend: Vanilla HTML/CSS/JS
  • Flight Data: Amadeus Flight Offers API
  • Scheduler: APScheduler

License

MIT

About

Local flight price tracker with web UI - supports Amadeus & Skyscanner APIs, daily price monitoring, Indian market optimized

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages