PERSONAL · PYTHON · AUTOMATION

Flights Tracker

A personal flight-price watcher that runs entirely on GitHub, for free: it scans my destinations every day, finds the cheapest day to fly, and emails me only the deals that are actually good.

Problem

Flight prices swing by hundreds of euros between neighbouring dates, and "a cheap fare" is meaningless without knowing what the route normally costs. Alert services either spam you with marginal drops or need an account, a server and a subscription. I wanted something that watches my own list of trips, tells me when a price is genuinely low, and costs nothing to run.

Approach

01
Watches
02
Daily scan
03
Bargain score
04
Email alert
05
Edit from the web
Flights Tracker home screen with the top deals of the day, each with a score out of 100
Today: the top deals across all my watches, each with a 0–100 score and its discount against the usual price.

How it works

Everything starts from a watch: one or more departure airports, destinations (a city, an airport or a whole country), a date window (the next N months or between two dates, optionally only certain weekdays), a stay length (a number of nights or a range, a Friday-to-Sunday weekend, or a long weekend), round trip or one way, a stops limit (direct only, at most one stop, any) and an optional target price.

A scheduled GitHub Actions workflow reads config.json, queries the Travelpayouts (Aviasales) price API in parallel for every route and month, and stores the offers and a daily price snapshot in SQLite, which persists between runs in the Actions cache. It then scores every offer, sends the alert if there is one, writes the data as JSON and publishes the static site to GitHub Pages. There is no server, no login and no always-on machine.

The web app is plain HTML, CSS and JavaScript with no libraries and hand-drawn SVG charts. It has four tabs, Today, Search, Watches and Configure, and works on a laptop and on a phone, where the tabs become a bottom bar.

One watch with its summary numbers and a twelve-month price calendar coloured from cheap to expensive
A watch: best price, usual price, number of options and a 12-month calendar coloured from cheap to expensive.
Search tab with filters on the left and a price calendar on the right
Search: free exploration of every date on the routes I watch, with filters for airports, stay, dates and stops.

Each watch also charts the daily price evolution, the cheapest price by month, destination, number of nights, weekday and departure airport, and the distribution of prices. Tapping any price opens the flight with its score, the same route on other dates for the same stay, and links to Google Flights, Skyscanner and Aviasales to check and book.

Flight detail with the score, dates, stops, duration, airline, the same route on other dates and booking links
A flight: why it scored 100, the same stay on neighbouring dates, and where to check it.

What counts as a bargain

Each offer gets a score from 0 to 100: 55% for how much cheaper it is than the watch's usual price (the median of the last 30 daily snapshots), and 45% for where it ranks among all the dates and combinations. A "top deal" must clear both a minimum score and a minimum discount, and also be cheap against the dates within three weeks of it, so ordinary low season isn't mistaken for a deal. The defaults are 80/100 and 25% below usual, and both are adjustable. A price under the watch's target, or a new all-time low for that watch, also qualifies.

To keep the email useful, a watch sends at most three deals, one per destination, and doesn't alert again for 14 days unless something at least 10% cheaper appears. The alert is a GitHub issue that mentions me, so GitHub's own notifications deliver the email, with no mail server or credentials to run. If I prefer it from my own Gmail, an app password in two secrets switches that on, and a button in the workflow sends a test alert.

Editing without a backend

The Configure tab edits the watches as a form. "Save to GitHub" opens a pre-filled issue; a second workflow validates and cleans the settings, writes config.json, commits it, triggers a fresh scan and closes the issue. It only accepts issues created by the repository owner, so there are no users or passwords: the repository is the database and the admin panel.

Configure tab with one watch edited as a form
Configure: each watch is a form, saved back to the repository.
Flights Tracker on a phone with the bottom tab bar
The same app on a phone.

Technical decisions

  • Everything on GitHub. Actions for scheduling and compute, Pages for hosting, an issue for the email, and the cache for state. Zero cost and nothing to keep running.
  • A schedule that survives the clock change. GitHub cron runs in UTC, so the workflow fires at two UTC times and a first step lets through only the run that falls at 7:40 in Madrid, in summer and in winter.
  • Settings without a backend. The web app can't write to the repository, so it hands the change to a workflow through an issue. The workflow validates and cleans the settings before they are saved.
  • Pluggable price providers. A real provider (Travelpayouts) and a demo provider with simulated prices share one interface, so the app and tests run without an API key, and the demo mode is clearly labelled in the UI.
  • A catalogue of countries and their airports, so a watch can target a whole country.
  • Tested core logic. The filters, scoring, deal detection, anti-spam rules, config handling and an end-to-end run are covered by automated tests that run in CI on every push.

Honest limits

Fares come from a cache of recent Aviasales searches rather than live airline systems, so they are a strong signal rather than a guarantee: always check the price before booking. This version doesn't estimate baggage or resident discounts, and the interface is in Spanish. The screenshots here use the app's simulated demo mode, not real fares.

GET IN TOUCH

Let's build something interesting.

Data, AI, travel, wildlife — or some combination of all four.