How whatscompare works
Electronics-first catalog: we stack price snapshots over time across retailers surfaced by Google Shopping, then compute deal scores and charts—value compounds as the cron runs.
Data model
- Product — curated SKU (title, category, brand, tier, shopping query). The immersive
page_tokenis stored after the first successful discovery. - ProductStoreListing — latest price, regular price, rating, link per store (Amazon, Best Buy, etc.).
- PriceSnapshot — append-only row per store on every refresh. Metrics and charts read from this history.
SerpApi (paid) — how we stay efficient
We use engine=google_shopping to discover a product’s immersive token, then engine=google_immersive_product for multi-store prices. Identical parameters can hit SerpApi’s 1h cache (cached searches are free and do not count the same way as fresh fetches—see SerpApi pricing docs).
No API calls on page views. Only GET /api/cron/sync-catalog (Vercel Cron) runs ingest, capped by SERPAPI_MAX_CALLS_PER_RUN (default 8). Tier 1 / 2 / 3 controls how often a product is eligible for refresh (3h / 24h / 72h since last run); the cap spreads load across the month.
Computed metrics (after each refresh)
- Deal score — % below ~90d average of daily minimum prices.
- Trend — coarse rising / dropping / stable from recent daily mins.
- Cheapest store — which retailer most often had the low price across snapshots.
- Volatility — standard deviation of daily mins (higher = more swingy).
- Deal confidence — heuristic from how rare the current low is vs history.
Product page
Horizontal bar chart (current prices), multi-line history chart (daily low per store), sorted buy links. Wrap URLs with your affiliate IDs where your programs allow.