Build an Amazon Price Tracker: Python + Apify (2026)
Build a free Amazon price tracker with Python and Apify in 2026: ASIN watchlist script, drop alerts, daily scheduling, plus honest per-1,000-product cost math.
14 min read
As an Apify affiliate, we may earn a commission from qualifying purchases made through our links, at no extra cost to you. We only recommend tools we believe in.
Build an Amazon Price Tracker: Python + Apify (Free Template)
Amazon prices never sit still. The same product can change price several times in a week as sellers reprice against each other, fight over the Buy Box, or clear inventory — and if you sell on Amazon, source from it, or run an affiliate site, finding out late means losing margin or linking to a stale price. Manual checking does not scale past a handful of products, and Amazon blocks naive scripts aggressively, so the practical answer is a small automated tracker: a watchlist of ASINs, a managed scraper that handles the anti-bot work, and an alert rule that pings you only when something actually changed.
This tutorial builds exactly that. You get a free, runnable Python template that reads a list of ASINs with target prices, calls the Amazon Product Scraper through the official Apify client, compares live prices against your thresholds, and appends every run to a price-history CSV. Then you will learn how to schedule it daily, what it really costs per 1,000 products, and how to extend the same pattern to Walmart. No scraping infrastructure to maintain, no proxy pool to babysit — just one script and one scheduled actor.
How It Works: Scheduler → Actor → Dataset → Alert
Every price tracker, from a weekend script to an enterprise repricer, is the same four-stage pipeline. Understanding the stages matters because each one has exactly one job, and when something looks wrong in your data you will know which stage to inspect.
Stage 1: Scheduler. Something has to kick off the run on a rhythm. For this template that is either the actor’s built-in Schedules tab (the run configuration is saved once and fires daily) or a cron job on your own machine that executes the Python script. The scheduler answers only one question: when do we check prices? Daily is the default this guide recommends, and the scheduling section below shows both options.
Stage 2: Actor. The Amazon Product Scraper does the actual extraction on Apify’s cloud. You hand it your ASIN list and it returns structured records — title, brand, current price with currency, original price, rating, review count, availability, Buy Box winner, and Best Sellers Rank — while its stealth browser configuration and proxy network absorb the CAPTCHAs and rate limits that would kill a script running from your laptop. This is the whole reason to build on a managed actor instead of raw requests: Amazon is one of the most aggressively defended sites on the web, and outsourcing that battle is the cheapest engineering decision in this project.
Stage 3: Dataset. Each finished run lands in an Apify dataset: one JSON record per product, timestamped and immutable. The script downloads the dataset items, normalizes the price field (which arrives as a small object with value and currency), and appends one row per ASIN per day to a local price_history.csv. Over weeks this file becomes the actual asset — a time series you can chart, join with sales data, or feed into a repricing rule. Always append, never overwrite: a tracker that keeps only the latest price is just an expensive way to look at Amazon.
Stage 4: Alert. Raw history is useless if nobody reads it, so the script finishes by evaluating two rules per product: did the live price drop to or below your target price, and did it move since yesterday’s run? Breaches print as ALERT lines and get appended to price_alerts.log, which is deliberately boring infrastructure — stdout and a log file plug into anything later (email, Slack, a webhook) without changing the core. Start with noisy alerts on a tiny watchlist, then tighten thresholds once you trust the data.
Data flows in one direction — scheduler fires, actor scrapes, dataset accumulates, alerts fire — and each stage is independently testable. You can run the actor by hand in the Apify console to check stage 2, inspect the dataset in the Storage tab to check stage 3, and feed the script a saved JSON file to check stage 4 without spending a cent on a run.
The Full Python Script: ASIN List + Threshold Alerts
Here is the complete template. It uses only the apify-client Python package and three real input fields of the Amazon Product Scraper — asins, maxItems, and proxyConfiguration — exactly as documented in the actor’s input schema, plus the output fields (asin, title, price.value, price.currency, availability) from its sample output. Install the dependency, export your token, replace the placeholder watchlist with your own ASINs, and run it:
pip install apify-client
export APIFY_TOKEN="your-apify-api-token"
python price_tracker.py
import csv
import os
from datetime import date
from apify_client import ApifyClient
APIFY_TOKEN = os.environ["APIFY_TOKEN"]
ACTOR_ID = "junglee/amazon-crawler" # Amazon Product Scraper
# Your watchlist: ASINs you own or compete against, each with a target price.
# Replace the placeholder ASIN below with real ones from your catalog.
PRODUCTS = [
{"asin": "B0C1J2K3L4", "label": "Example headphones", "target_price": 349.00},
]
HISTORY_CSV = "price_history.csv"
ALERTS_LOG = "price_alerts.log"
def extract_price(item):
"""Return (value, currency) handling the actor's price object shape."""
price = item.get("price", {})
if isinstance(price, dict):
return price.get("value"), price.get("currency", "USD")
return price, item.get("currency", "USD")
def load_last_prices():
"""Map ASIN -> most recent recorded price from the history CSV."""
last = {}
if not os.path.exists(HISTORY_CSV):
return last
with open(HISTORY_CSV, newline="", encoding="utf-8") as f:
for row in csv.DictReader(f):
try:
last[row["asin"]] = float(row["price"])
except (ValueError, TypeError, KeyError):
continue
return last
def main():
targets = {p["asin"]: p for p in PRODUCTS}
client = ApifyClient(APIFY_TOKEN)
run_input = {
"asins": [p["asin"] for p in PRODUCTS],
"maxItems": len(PRODUCTS),
"proxyConfiguration": {"useApifyProxy": True},
}
run = client.actor(ACTOR_ID).call(run_input)
items = client.dataset(run["defaultDatasetId"]).list_items().items
last_prices = load_last_prices()
today = date.today().isoformat()
alerts = []
with open(HISTORY_CSV, "a", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(
f,
fieldnames=["date", "asin", "label", "title", "price", "currency", "availability", "url"],
)
if f.tell() == 0:
writer.writeheader()
for item in items:
asin = item.get("asin", "")
value, currency = extract_price(item)
if value is None:
continue
writer.writerow({
"date": today,
"asin": asin,
"label": targets.get(asin, {}).get("label", ""),
"title": item.get("title", ""),
"price": value,
"currency": currency,
"availability": item.get("availability", ""),
"url": item.get("url", ""),
})
target = targets.get(asin, {}).get("target_price")
if target is not None and float(value) <= float(target):
alerts.append(
f"ALERT {today} {asin} hit target: {value} {currency} "
f"(target {target}) — {item.get('url', '')}"
)
previous = last_prices.get(asin)
if previous is not None and float(value) != float(previous):
alerts.append(
f"MOVED {today} {asin}: {previous} -> {value} {currency}"
)
if alerts:
with open(ALERTS_LOG, "a", encoding="utf-8") as f:
f.write("\n".join(alerts) + "\n")
for line in alerts:
print(line)
print(f"Checked {len(items)} products. History in {HISTORY_CSV}.")
if __name__ == "__main__":
main()
A few notes on adapting it to your own catalog. First, keep the input minimal: asins pins the exact products, maxItems caps the run at your watchlist size so a typo cannot balloon into a giant crawl, and proxyConfiguration with the Apify proxy enabled is strongly recommended for Amazon — residential-grade rotation is what keeps daily runs alive. Second, the extract_price helper exists because the actor returns price as an object ({"value": 348.00, "currency": "USD"}) rather than a bare number; always store value and currency together or multi-marketplace tracking will silently corrupt your history. Third, the script dedupes naturally on (date, asin) since one run writes one row per ASIN — if you ever combine ASIN and search-driven inputs, add an explicit dedupe on that pair before analysis. Finally, treat the alerts log as a seam, not a destination: tailing it into an email sender or a chat webhook later is a ten-line change that never touches the scraping logic.
Before your first scheduled run, execute the script once by hand and check three things: every ASIN in your watchlist produced exactly one row, the prices match what you see on the live product pages, and the currency column is populated. If an ASIN comes back empty, it is usually a wrong or region-mismatched identifier — fix the watchlist, not the code.
Scheduling It Daily
A tracker that runs when you remember to run it is a hobby; a tracker on a schedule is infrastructure. You have two clean options, and both are legitimate — pick based on where you want the cron to live.
Option A: the actor schedule (simplest). Open the Amazon Product Scraper in the Apify console, paste your asins input once, and create a schedule in the Schedules tab that fires it daily — morning in your marketplace’s timezone, so the data is fresh when you plan the day. Then run the Python script’s download-and-compare half (everything after the .call()) against the latest dataset on the same cadence. This splits responsibilities nicely: Apify owns the scrape rhythm, your machine owns the alert logic.
Option B: cron runs the whole script. On Linux or macOS, one crontab line runs the full pipeline every morning at 8:00:
0 8 * * * cd ~/price-tracker && APIFY_TOKEN="your-token" python3 price_tracker.py >> cron.log 2>&1
Either way, three habits keep a daily tracker trustworthy over months. Append to the history CSV forever and back it up — that file is the product. Watch the daily item count: if a 20-ASIN watchlist suddenly returns 14 rows, check the run log for blocks or layout changes before you trust the gaps. And record the input next to the output — which ASINs, which date — because six months from now a strange spike is only explainable if you know exactly what was measured. Daily suits volatile categories like electronics and anything where you contest the Buy Box; for slow-moving catalogs where prices barely move, drop to weekly and spend the savings on a wider watchlist instead.
Cost Math: What 1,000 Products Really Cost
Price trackers live or die on unit economics, so here is the honest math using the actor’s published figures — no estimates invented. The Amazon Product Scraper’s pricing details quote an estimated $5.00 to $10.00 per 1,000 comprehensively extracted products, with Amazon’s defenses meaning premium proxy usage is usually baked into that range. Apify’s $5 free monthly credit covers your first test runs at no cost.
Work it through for realistic watchlists. A starter tracker watching 20 ASINs daily pulls about 600 products a month (20 × 30 days), which lands around $3 to $6 per month — fully inside the free credit, so genuinely free while you validate the setup. A serious seller tracker at 100 ASINs daily pulls roughly 3,000 products a month, or about $15 to $30, minus the $5 credit. Only category-scale monitoring — thousands of ASINs a day — climbs into real budget territory, and at that point the per-run cost is still dwarfed by the margin on a single avoided stockout or a single timely repricing.
Two levers control the bill. The first is watchlist discipline: maxItems set to your list size plus daily (not hourly) cadence keeps volume exactly proportional to decisions you will actually act on. The second is scope: if you also want the voice of the customer behind the prices, the Amazon Reviews Scraper follows a pay-per-result model starting at $3.00 per 1,000 reviews, so adding weekly review pulls for your top 10 ASINs costs a few dollars a month. Start narrow, prove the alerts drive actions, then widen the watchlist with the savings from the first good repricing call.
Extending the Tracker to Walmart
Once the Amazon loop runs untouched for a few weeks, the natural next step is a second shelf price for the same products — and Walmart is the obvious one, since big-box shelf prices anchor customer expectations across categories. The architecture does not change at all: same scheduler, same dataset-plus-alert shape, just a different actor behind stage 2. Point the E-Commerce Scraping Tool at your Walmart product URLs, keep appending to a parallel history file, and join the two series on brand plus product identifiers.
Two practical notes carry over directly. First, keep the field discipline from the Amazon script — canonical URL as the dedupe key, price value stored alongside its currency, availability captured every run — so the Walmart rows line up column-for-column with the Amazon ones and one analysis script reads both. Second, calibrate on the same rhythm: if Amazon runs daily and Walmart runs weekly, annotate the cadence in each file or the joined chart will imply precision that is not there. Our Walmart and eBay templates walkthrough gives you the exact field maps and copy-paste inputs for that side, and the ecommerce scraping guide covers the multi-site joining pattern in depth.
The payoff for the extra actor is a complete pricing picture per product: Amazon shelf price, Walmart shelf price, and — via the reviews scraper — the customer sentiment explaining why the two diverge. That is the dataset repricing decisions, assortment bets, and affiliate content updates all draw from, built from one script you already understand.
Related Resources
Frequently Asked Questions
How much does it cost to track Amazon prices with Apify?
Should I track prices with ASINs or search terms?
How often should an Amazon price tracker run?
Can I track reviews and sentiment alongside prices?
🛠️ Recommended Tools
Amazon Reviews Scraper
Extract product reviews, ratings, and customer feedback from Amazon. Essential for competitor analysis and sentiment tracking.
Amazon Product Scraper
Extract Amazon product details, prices, reviews, and seller information worldwide. Monitor competitors and export to Excel, CSV, or JSON.
Tags
ParseFlow
Web Scraping & Automation Studio
Years of hands-on experience building and maintaining web scrapers. We publish real, actively-used tools on the Apify Store under the Website Harvester brand — including our Articles Extractor actor — alongside curating and reviewing the broader Apify ecosystem here on ParseFlow.
Related Articles
Amazon Price Monitoring: Complete Guide to Competitor Analysis
Learn how to track Amazon prices, monitor competitor products, and automate price intelligence. Build a competitive edge with real-time product data extraction.
Apify MCP Server: Give Your AI Agent Access to 70,000+ Web Scrapers
How to connect Claude, GPT-4, and other AI agents to Apify's MCP server and give them access to 70,000+ real-time web scrapers — in under 10 minutes.
Building RAG Pipelines with Web Data: Complete 2026 Guide
Learn how to build Retrieval-Augmented Generation (RAG) systems using web-scraped data. From data collection to vector embeddings, create AI applications powered by real-time web intelligence.