ERLI.PL Price Tracker: AI E-Commerce Price Intelligence by Serhii LukashERLI.PL Price Tracker: AI E-Commerce Price Intelligence by Serhii Lukash

ERLI.PL Price Tracker: AI E-Commerce Price Intelligence

Serhii Lukash

Serhii Lukash

The Problem

Online shoppers and resellers tracking prices on Polish e-commerce platforms do it manually — refreshing product pages, screenshot-ing prices, maintaining spreadsheets. Price changes happen silently and opportunities vanish. Existing price tracker tools are either locked to major marketplaces or too generic to handle dynamic, JS-heavy pages that break naive scrapers.
The Cost: Missed flash sales, overpaid purchases, and zero visibility into price trend patterns over time.

What I Built

A fully automated price intelligence service for erli.pl — Poland's growing e-commerce marketplace. The system scrapes product pages on a configurable schedule, parses prices through a smart two-layer pipeline (structured data first, AI fallback second), stores complete price history in PostgreSQL, and fires instant Telegram alerts the moment a price crosses a configurable threshold. A weekly AI-generated trend summary lands in Telegram every Sunday.

Business Impact & ROI

Scraping schedule: Configurable (default every 12 hours)
Alert trigger: Configurable threshold (default ±5%)
AI fallback resilience: Circuit breaker: 3 failures → auto-switch to Anthropic, resets in 60s
Parsing strategy: JSON-LD first (free) → LLM fallback (only when needed)
Supported input: Telegram Bot UI + REST API + CLI scripts
Image size: < 200 MB (multi-stage Docker build)

How It Works (The Value Pipeline)

1. Smart Two-Layer Parsing — Cheap by Default

Every product page is first parsed for Schema.org JSON-LD structured data — instant, free, zero API cost. Only when structured data is absent or malformed does the system escalate to the AI Router: GPT-4o-mini as primary, with automatic failover to Claude 3.5 Sonnet. The circuit breaker trips after 3 consecutive OpenAI failures and self-resets after 60 seconds — parsing never halts.

2. Price History & Threshold Alerting

Every scrape result is written to a price_history table in PostgreSQL. The price monitor compares the new value against the last stored price; if the delta exceeds the configured threshold (default 5%), a Telegram alert fires immediately — not on the next scheduled run, in real time.

3. Telegram Bot UI with FSM Flows

Users manage their tracked products entirely through Telegram: /add triggers an FSM-guided flow to input a product URL, /list returns all tracked products with current prices and inline buttons to delete or view history, and /help surfaces all available commands. No dashboard login required.

4. Weekly AI Insights

Every Sunday, APScheduler triggers a weekly_insights job that feeds the week's price history data to the AI Router and delivers a natural-language trend summary to Telegram — identifying which products dropped, which spiked, and which are worth acting on.

5. REST API + CLI for Power Users

Three REST endpoints cover programmatic access: add/update products, list all with latest prices, and retrieve full price history per product. CLI scripts handle bulk operations: seed_products.py ingests a CSV of URLs, manual_scrape.py triggers a one-off scrape, and export_history.py dumps price data for external analysis.

Technical Foundation

Scraping: Serper.dev Scraping API via httpx async — handles JS-rendered pages and anti-bot protection
Parsing: JSON-LD (Schema.org) primary → GPT-4o-mini → Claude 3.5 Sonnet with circuit breaker pattern
Scheduler: APScheduler AsyncIOScheduler — scrape interval and weekly insights jobs, fully configurable
API Layer: FastAPI + Uvicorn, Pydantic v2 validation, Swagger UI auto-docs at /docs
Bot: aiogram 3.x with FSM state management, inline keyboards, structured command flows
Database: PostgreSQL 16, SQLAlchemy 2.0 async + asyncpg, two tables: products + price_history
Resilience: tenacity exponential backoff on all external calls, circuit breaker on AI Router
Observability: structlog JSON logs searchable by product_id and error type
Infrastructure: Multi-stage Docker build, non-root user, image < 200 MB, health check endpoint

Who Benefits From This System

Smart Shoppers & Deal Hunters: Set it once, get alerted the moment a tracked product hits your target price — no manual refreshing, no missed sales.
Resellers & Dropshippers: Monitor competitor and supplier pricing on erli.pl with full history — make restocking and repricing decisions based on trend data, not gut feel.
E-Commerce SaaS Platforms: Embed as a white-label price intelligence module — the AI parsing pipeline handles any page structure, making it marketplace-agnostic with minimal adaptation.
Like this project

Posted Jun 5, 2026

Automated erli.pl price tracker: two-layer parsing (JSON-LD + dual-LLM fallback), PostgreSQL price history, Telegram alerts, weekly AI trend insights.