How to build a price tracker in n8n
Keep a Google Sheet of product URLs, fetch each page daily with the HTTP Request node, pull the price out with a Code node (or the HTML node and a CSS selector), and compare it with the last price stored in the sheet. An IF node sends a Telegram or Slack alert when it changes. Expect some shops to block bots or load prices with JavaScript.
Buy for $15 AI Automation Starter Pack for n8n — 8 ready-to-import workflows · $15
The workflow shape
- Schedule Trigger, once a day is plenty.
- Google Sheets: read the watchlist (url, label, last_price).
- HTTP Request: GET the url, response format Text, with a normal browser User-Agent header.
- Code: find the price and compare it with last_price.
- Google Sheets: write the new price and check date back, matched on url.
- IF changed, then Telegram Send Message (or Slack).
Finding the price reliably
Many shops publish structured product data for search engines. Reading that first beats guessing from the visible page. A Code node like this tries JSON-LD, then the itemprop attribute, then the og price meta tag.
const html = $json.data || '';
const tries = [
/"price"\s*:\s*"?([\d.,]+)/,
/itemprop="price"[^>]*content="([\d.,]+)"/,
/product:price:amount"\s+content="([\d.,]+)"/,
];
let price = null;
for (const re of tries) {
const m = html.match(re);
if (m) { price = parseFloat(m[1].replace(/,/g, '')); break; }
}
return { json: { ...$json, price } };
Honest limits
- Some sites block automated requests or show a captcha; those rows return no price.
- Prices drawn by JavaScript after the page loads are not in the HTML the HTTP Request node gets.
- Prices can vary by country, currency or login, so your number may differ from what a customer sees.
- European formats like 1.234,50 need their own parsing.
- Check each site's terms of use, keep the schedule modest, and don't hammer one shop with hundreds of URLs.
Other ways to track prices
| Option | Good for | Trade-off |
|---|---|---|
| Price tracker apps and browser extensions | A few items you want to buy | Limited to supported shops |
| Shop APIs or affiliate feeds | Exact data from big retailers | Need approval and keys |
| n8n with HTTP Request | Your own list of competitor pages, alerts your way | Breaks on blocked or JavaScript-only pages |
Ready-made version
Workflow 07 in our starter pack is this tracker: a Watchlist sheet (url, label, price_regex, last_price, last_checked, last_changed, check_status), the price search order above plus a last-resort currency match, a per-row price_regex for awkward pages, a minimum change percentage, and Telegram alerts. Failed rows show price not found instead of breaking the run. It uses no AI.
It ran end to end on n8n 2.49.9 with local test copies of Google Sheets and Telegram. How well it reads a given shop depends on that shop, so test your own URLs.
The product
Questions
Can n8n read prices from JavaScript-heavy sites?
Not with HTTP Request alone. You need a headless browser service or a page-rendering API in front of it.
How often should it check?
Daily is usually enough for competitor pricing and keeps you polite to the sites you watch.
Why did it pick the wrong number?
The fallback match found another amount on the page. Add a regex with one capture group for that site.
Related
Updated 2026-12-01