dobrovolskiy.com
RU
← all workdata · 2026

bgwatch: air-fare monitor

Time-series price watcher for tour-operator flight fares with change detection and MQTT alerts

A Python service that polls Biblio-Globus (bgoperator.ru) charter and regular-carrier fare endpoints, normalizes two divergent JSON schemas into one model, stores only real price changes in...

A Python service that polls Biblio-Globus (bgoperator.ru) charter and regular-carrier fare endpoints, normalizes two divergent JSON schemas into one model, stores only real price changes in a TimescaleDB hypertable and publishes rate-limited alerts (7-day low, >=5% drop, price floor) over MQTT for a Telegram bot and Grafana.

The auth transport handles the operator's quirks: mandatory gzip, a session cookie that rotates on every response, and 'unauthorized' bodies returned with HTTP 200.

A Playwright cookie harvester and XHR sniffer serve as the no-credentials fallback.

What it does

  • Stateful auth client with Z1 cookie rotation, one-reauth-one-retry on SR001, on-disk cookie jar, credential and cookie-only modes
  • Normalizer that accepts both documented response shapes (list baggage vs string baggage + brand) and fails loudly on drift
  • Change-detection engine: write on change only, vanishing offer treated as inventory event not fare hike
  • Alert rules (7-day low, >=5% drop, floor) with 1/hour per-watch rate limit, published to MQTT
  • Timescale hypertable schema + watch table
  • Playwright harvester that reverse-engineered the public frontend's separate GraphQL-ish API and its client-side hash gate
  • 57 offline pytest cases using a mock transport (no network needed)

Clean separation of auth transport from payload parsing; hard rule of never scraping HTML; careful handling of a hostile third-party API; small (<150 MB RSS) service designed to slot into existing Timescale/EMQX/Grafana infra. Unfinished (no live polling yet).

Want something like this?

I build it live on a Zoom call, you watch the screen, the timer stops when you say stop. First 15 minutes are free.

$50 / hourBook an hour

More projects

FOURLEDS Cloud ControllersCellular lighting controllers for heritage facades: six KiCad boards, ESP-IDF firmware, fleet server, dashboardUltralight IP CAM ViewerUltra-light multi-camera RTSP viewer and recorder: dozens of cameras on one slow PC or serverRYTA: freight & machinery marketplaceOffline-first, over-the-air-updated freight/transport load board for Android, web and the MAX messenger