Amazon Price Scraper: Track Price Changes Automatically

An Amazon price scraper that alerts on real changes: tested watch commands, the no-threshold limit, and a cron recipe for price-below-X alerts.

MMotherlode Lab8 min read
Magpie title card: Amazon Price Scraper: Track Price Changes Automatically

I fetched the same Amazon product page twice, sixty seconds apart. The price was identical in both fetches. Watch mode still reported a change, and the edit spanned more than 2,000 words. That experiment is the whole job of an Amazon price scraper in one sentence: the page never stops moving, so what matters is what counts as a real change. This guide covers the watch commands that work (live-tested 2026-10-16 from a home connection), the price-threshold check Magpie can’t do plus the 18-line cron script that can, and where camelcamelcamel and Keepa still win. Ground rule first: Amazon’s terms bar automated access, robots.txt does not disallow /dp/ pages, and everything here polls public pages at hourly rates. Not legal advice.

What an Amazon price scraper actually watches

Product pages are old-fashioned server-rendered HTML. No login, no JavaScript for the core fields, no API key. Magpie’s amazon_product vertical auto-fires on /dp/{asin} and /gp/product/{asin} URLs and returns a typed record:

$ magpie scrape "https://www.amazon.com/dp/B07G11G2X8" --vertical amazon_product
{
  "record": {
    "asin": "B07G11G2X8",
    "title": "Redragon K580 Wired RGB Mechanical Gaming Keyboard",
    "price":      { "amount": 1775.69 },
    "list_price": { "amount": 2345.36 },
    "rating": 4.6,
    "reviews": 4379,
    "availability": "In Stock"
  }
}

(abridged; the full record also carries features and the URL). Two things in that output will bite you. First, localization: my connection is geolocated to Thailand, so Amazon rendered baht, and the record’s amount field drops the currency. That is 1,775 THB, not $1,775. Check the raw page once per market before you compare any amount to anything. Second, the buy-box price is session-gated. On the same day, some complete product pages rendered zero price blocks until the session had a delivery zip; a 1.4 MB page with nothing to parse. Plan for price being absent on some fetches and your tracker will not silently ship nulls.

For tracking, two surfaces matter, and they answer different questions:

Surface Command Question it answers
Cleaned markdown magpie scrape URL --page-format markdown “Did the page’s words change?” (this is what watch mode diffs)
Typed record magpie scrape URL --vertical amazon_product “What is the price, rating, availability right now?” (what a script should compare)

The extraction half of this job (every field, where it hides in the DOM, the fingerprint flags that fix stripped pages) lives in How to Scrape Amazon Product Data (Titles, Prices, ASINs). This page is the watching half.

Watch a product page for changes

Magpie’s watch mode stores a markdown snapshot of the URL and prints a word-diff whenever the content changes. Zero LLM, no keys:

$ magpie watch "https://www.amazon.com/dp/B07G11G2X8" --every 1h

The first check stores the baseline and exits silently. Every later check compares against it: silence on no-change, and on change it prints the diff and POSTs {url, changed, old_hash, new_hash, diff} to --webhook if you set one. Minimum interval is 30 seconds; for Amazon, use an hour or more anyway. For cron-style setups, --once runs a single check and exits, so your scheduler owns the cadence:

$ magpie watch "https://www.amazon.com/dp/B07G11G2X8" --every 1h --once
$ magpie watch "https://www.amazon.com/dp/B07G11G2X8" --every 1h --once
changed=true old=28ce9a3f84757e69… new=11cee3663e34409a…
(changed — edit spans more than 2000 words, too large to diff)

That output is real, from two checks about a minute apart. Magpie Desktop wraps the same watch engine on its Watch screen if you prefer a UI; the CLI and Desktop share one SQLite store, so snapshots from either show up in both.

Watch mode has no price conditions

Now the limit, stated plainly: Magpie watch has no conditions. It cannot alert when the price drops below X, and it cannot alert on back-in-stock. It compares words. Amazon product pages are mostly other words: recommendation carousels, “2K+ bought in past month” badges, review-count ticks, coupon strips. Those churn on nearly every load. In my test, three vertical reads over ten minutes returned an unchanged 1775.69, 4,379 reviews, and “In Stock” every time, while the watch between two of those reads fired on a diff too large to print. The page changed everywhere except where it mattered.

Watch also takes no --vertical flag (it tracks the markdown, not the typed record), no region selectors to exclude the carousels, and no --browser/--header-profile flags, so it cannot apply the fingerprint fix that scrape can on pages that serve stripped shells. Treat it as a tripwire for big content shifts: the price line disappearing from the page, the title changing, the availability text flipping. For threshold logic, you add the comparison yourself, which is one small script.

The cron recipe: price-below-X alerts you own

One scrape per tick, one comparison, one notification. Save as amazon-price-check.sh:

#!/usr/bin/env bash
# usage: amazon-price-check.sh URL THRESHOLD  — alert when the buy-box price drops below THRESHOLD
URL="$1"; THRESHOLD="$2"
AMT=$(magpie scrape "$URL" --vertical amazon_product 2>/dev/null \
  | jq -r '.record.price.amount // empty')
if [ -z "$AMT" ]; then
  echo "$(date -Is) no price this run (session-gated page); retry next tick"
  exit 0
fi
BELOW=$(python3 -c "print(1 if float('$AMT') < float('$THRESHOLD') else 0)")
if [ "$BELOW" = "1" ]; then
  curl -s -X POST -H "Content-Type: application/json" \
    -d "{\"text\":\"Price alert: $URL now $AMT (threshold $THRESHOLD)\"}" \
    https://hooks.slack.com/services/YOUR/WEBHOOK/URL
  echo "$(date -Is) ALERT $URL $AMT < $THRESHOLD"
else
  echo "$(date -Is) ok $URL $AMT"
fi

And a crontab line, hourly at a random-ish minute:

17 * * * * ~/.local/bin/amazon-price-check.sh "https://www.amazon.com/dp/B07G11G2X8" 1800 >> ~/price-check.log 2>&1

Four operational notes from running this pattern. Set the threshold in the currency your IP actually receives (mine is THB); the script compares raw amounts, so a dollar threshold against a baht page never fires. On a missing price, the script exits quietly and retries next tick; alerting on absent data trains you to ignore alerts. For a back-in-stock watcher, compare .record.availability against "In Stock" across ticks instead of the amount; the field is in the record, the condition is yours. And if pages start coming back stripped, apply the fingerprint fix at the scrape level (--browser chrome --header-profile chrome), which is exactly what flipped my failures into full records in the extraction guide.

Cost check: the core CLI is a free, local binary (AGPL-3.0-or-later or a commercial licence). The Desktop plan gives 5 free runs per install, then $49/month, and counts a watch as one run; the cron recipe spends one scrape per tick instead of a persistent watch.

Where the hosted Amazon price trackers still win

A DIY watcher owns its alerts; it does not own history. The hosted services chart every price they have ever seen for a product, which no single-machine script replicates honestly.

Tool What it does Price Where it beats a DIY watcher
camelcamelcamel Price history charts per ASIN, drop alerts, wishlist tracking across Amazon/3rd-party/used prices Free Months of history with zero setup; alerts run even when your machine is off
Keepa The deepest Amazon price-history database; browser charts free, plus a data API sellers build on Charts free; API is a paid subscription (keepa.com) Historical depth and API scale; tracks offer counts, Buy Box ownership
Browser extensions (e.g. HARPA) Watch and alert from inside your browser session Freemium They watch from your logged-in, localized browser session, so no extra setup
Generic page monitors (e.g. PageCrawl) Any page, any schedule Free tier + paid plans Managed uptime; PageCrawl’s own docs recommend watching the logged-out price for a stable baseline

Each has a real ceiling. camelcamelcamel and Keepa cover Amazon only, chart delayed or sampled points on some categories, and give you no webhook into your own systems. Extensions die when the browser closes. Generic monitors inherit the any-change problem you just watched me hit, since they diff page text too. If you want charts and zero infrastructure, camelcamelcamel is the honest first stop. If you want thresholds wired into Slack, ntfy, or a database, with a typed record rather than a text diff, the cron recipe above is the version you control. Sellers doing this across hundreds of ASINs for enforcement work should look at MAP monitoring and at pulling many prices at once with a price-extraction pipeline instead of a per-URL watch.

FAQ

Is it legal to track Amazon prices with a scraper? Amazon’s terms bar automated access; robots.txt permits /dp/ pages. Low-volume polling of public pages at hourly rates is the common practice and the common enforcement line is rate-limiting, not lawsuits. Not legal advice; keep volumes small.

Why does my scraper show a different price than my browser? Amazon localizes by IP, delivery zip, and session. My home connection gets baht; a US zip gets dollars; Prime status changes some buy boxes. Scrape the same market you compare against.

Can I get an alert only when the price drops? Not with watch mode; it fires on any text change. Add the comparison yourself (the cron recipe above), or use camelcamelcamel, which does threshold alerts with no code.

Does Magpie keep price history charts? No. Watch reports diffs; the vertical returns one snapshot per call. Log each tick’s record to SQLite or CSV yourself if you want history, or use Keepa for charted history.

How often should I check an Amazon page? Hourly is plenty for personal price tracking; the CLI’s 30-second floor is not an invitation. Competitive categories run automated repricers that move prices several times a day, so a slower poll still catches real moves. The general pacing tactics are in how to scrape websites without getting blocked.

The fastest way to judge all this on your own products: run magpie watch "https://www.amazon.com/dp/YOUR-ASIN" --every 1h --once twice tonight, once an hour apart. If the second run stays silent, the price held and the noise did too, and you will know exactly what your alert budget is buying. More site-specific guides live on the scrapers for popular websites hub, and the same watch mechanics drive competitor website monitoring beyond Amazon.

Stop renting credits.

One flat price, your machine, your keys.

Download free for Windows, macOS and Linux

Windows · macOS · Linux $49/mo flat, cancel anytime