← All Projects
E-Commerce
Pricing
Scraping

Competitor Price Comparator.

An automated tool that scrapes competitor product prices on a schedule, maps them to the store's own catalogue by EAN/name, and surfaces a clear view of where the store's pricing stands in the market — enabling data-driven pricing decisions.

Duration

2 Months

Complexity

Medium-High

The Challenge

Pricing Blind in a Competitive Market.

Setting competitive prices required manually checking several competitor websites product by product. With hundreds of SKUs, this was impossible to do consistently — leading to either margin loss or missed sales from being overpriced.

Manual Research
Pricing
Competitor Intel
The Stack

Next.js 16 (App Router)

TypeScript

Playwright (scraping)

PostgreSQL (price history)

Shopify Admin API

MUI v7

node-cron (scheduling)

Scheduled Scrape → Match → Compare

Playwright headless browser sessions scrape competitor product pages on a nightly schedule. Products are matched to the store catalogue by EAN barcode or normalised product name. Results are stored as time-series data, enabling price trend analysis and immediate alerts when a competitor undercuts a key product.

// lib/scraper/runner.ts
export async function scrapeCompetitor(
  competitor: Competitor
): Promise<PriceResult[]> {
  const browser = await chromium.launch({ headless: true })
  const page = await browser.newPage()
  const results: PriceResult[] = []

  for (const url of competitor.productUrls) {
    await page.goto(url, { waitUntil: 'networkidle' })
    const price = await page.$eval(
      competitor.priceSelector,
      el => parseFloat(el.textContent?.replace(',', '.') ?? '0')
    )
    results.push({ url, price, scrapedAt: new Date() })
  }

  await browser.close()
  return results
}
Architecture Diagram

Data-Driven Pricing, Every Day.

Automated Nightly Scraping

Playwright headless sessions run every night, collecting prices across 5+ competitor sites for 300+ matched products — fully automated, zero manual effort.

Price History & Trend Alerts

Every price is stored as a time-series data point. The dashboard highlights products where competitors recently dropped below the store's current price, enabling reactive repricing.

300+

Products Monitored Daily

5+

Competitors

300+

Products

Nightly

Schedule
Playwright ScrapingNightly Price Intelligence