Build BER↔EZE flight price monitor #2

Closed
opened 2026-03-21 23:03:21 +00:00 by murray · 0 comments
Owner

Objective

Build a Python flight price monitor that checks BER→EZE round trip prices daily and alerts when they drop below a threshold.

Specs

Configuration (config.json)

{
  "routes": [
    {
      "origin": "BER",
      "destination": "EZE",
      "trip_type": "round_trip",
      "threshold_eur": 700,
      "duration_weeks": [2, 3, 4],
      "preferred_months": [12, 1, 2, 3],
      "monitor_year_round": true
    }
  ],
  "check_interval": "daily"
}

Design for multiple routes from the start.

Price Source

  • Primary: Kiwi/Tequila API — https://api.tequila.kiwi.com/v2/search
  • API key may not be set yet. Use env var KIWI_API_KEY.
  • Implement a thin adapter pattern: adapters/base.py (abstract) + adapters/kiwi.py (concrete)
  • If KIWI_API_KEY is not set, the adapter should log a clear message and exit gracefully (NOT crash)
  • Make it easy to add other adapters later (Google Flights scraper, Skyscanner, etc.)

Alerting

  • When price < threshold: send alert via OpenClaw
    openclaw system event --text "✈️ BER→EZE €{price} on {dates} ({airline}) — below €{threshold}! {link}" --mode now
    
  • Log ALL checks (hits and misses) to monitor.log with timestamps

Files to Create

monitor.py              # Main entry point (one-shot, cron-friendly)
config.json             # Route configuration
adapters/__init__.py
adapters/base.py        # Abstract base adapter
adapters/kiwi.py        # Kiwi/Tequila implementation
requirements.txt        # Dependencies
README.md               # Setup & usage docs

Constraints

  • Python 3.10+
  • Keep dependencies minimal (requests, python-dotenv at most)
  • No web framework needed — this is a CLI script
  • Must work as a one-shot command: python monitor.py

Git Setup

git clone https://gitea.netcups.al3dev.link/monkey-island/flight-monitor.git
cd flight-monitor
# ... build ...
git add -A && git commit -m "feat: initial flight monitor" && git push

Use remote URL with token: https://otis:<GITEA_TOKEN>@gitea.netcups.al3dev.link/monkey-island/flight-monitor.git

The Gitea token is available in /root/.openclaw/workspace/.gitea-credentials.

Acceptance Criteria

  • All files created and committed
  • python monitor.py runs without error (graceful exit if no API key)
  • Adapter pattern is clean and extensible
  • README explains setup, config, and how to add new adapters
  • Config supports multiple routes

When Done

Run: openclaw system event --text "Done: flight-monitor built and pushed to monkey-island/flight-monitor" --mode now

## Objective Build a Python flight price monitor that checks BER→EZE round trip prices daily and alerts when they drop below a threshold. ## Specs ### Configuration (`config.json`) ```json { "routes": [ { "origin": "BER", "destination": "EZE", "trip_type": "round_trip", "threshold_eur": 700, "duration_weeks": [2, 3, 4], "preferred_months": [12, 1, 2, 3], "monitor_year_round": true } ], "check_interval": "daily" } ``` Design for multiple routes from the start. ### Price Source - **Primary:** Kiwi/Tequila API — `https://api.tequila.kiwi.com/v2/search` - API key may not be set yet. Use env var `KIWI_API_KEY`. - Implement a **thin adapter pattern**: `adapters/base.py` (abstract) + `adapters/kiwi.py` (concrete) - If `KIWI_API_KEY` is not set, the adapter should log a clear message and exit gracefully (NOT crash) - Make it easy to add other adapters later (Google Flights scraper, Skyscanner, etc.) ### Alerting - When price < threshold: send alert via OpenClaw ```bash openclaw system event --text "✈️ BER→EZE €{price} on {dates} ({airline}) — below €{threshold}! {link}" --mode now ``` - Log ALL checks (hits and misses) to `monitor.log` with timestamps ### Files to Create ``` monitor.py # Main entry point (one-shot, cron-friendly) config.json # Route configuration adapters/__init__.py adapters/base.py # Abstract base adapter adapters/kiwi.py # Kiwi/Tequila implementation requirements.txt # Dependencies README.md # Setup & usage docs ``` ### Constraints - Python 3.10+ - Keep dependencies minimal (requests, python-dotenv at most) - No web framework needed — this is a CLI script - Must work as a one-shot command: `python monitor.py` ## Git Setup ```bash git clone https://gitea.netcups.al3dev.link/monkey-island/flight-monitor.git cd flight-monitor # ... build ... git add -A && git commit -m "feat: initial flight monitor" && git push ``` Use remote URL with token: `https://otis:<GITEA_TOKEN>@gitea.netcups.al3dev.link/monkey-island/flight-monitor.git` The Gitea token is available in `/root/.openclaw/workspace/.gitea-credentials`. ## Acceptance Criteria - [ ] All files created and committed - [ ] `python monitor.py` runs without error (graceful exit if no API key) - [ ] Adapter pattern is clean and extensible - [ ] README explains setup, config, and how to add new adapters - [ ] Config supports multiple routes ## When Done Run: `openclaw system event --text "Done: flight-monitor built and pushed to monkey-island/flight-monitor" --mode now`
murray added the
P1-high
feature
otis
labels 2026-03-21 23:03:21 +00:00
murray reopened this issue 2026-03-21 23:07:43 +00:00
otis referenced this issue from a commit 2026-03-21 23:10:28 +00:00
otis closed this issue 2026-03-21 23:10:32 +00:00
Sign in to join this conversation.
No description provided.