Build a price tracking bot in Python (Amazon + Google Shopping)

Discover products, track ASINs by price, store history in SQLite, and alert on drops. A full price bot with the real credit cost per product, August 2026.

A price tracking bot has four parts: find the products worth watching, check their price on a schedule, store the history, and tell someone when it drops. Here is all four, with the credit math for a realistic bot size.

Start from a category or keyword, not a hand-typed list. The /amazon search endpoint returns organic products with asin, price, extracted_price and rating data for 1 credit per request:

import re

import requests

API_KEY = "faf_live_..."  # your FastAF key

def discover(query, domain="com", pages=1):
    products = []
    for page in range(1, pages + 1):
        resp = requests.get(
            "https://api.fastaf.co/v1/amazon",
            params={"query": query, "domain": domain, "page": page},
            headers={"Authorization": f"Bearer {API_KEY}"},
            timeout=60,
        )
        resp.raise_for_status()
        products.extend(
            item for item in resp.json()["results"]
            if item["type"] == "search_product"
        )
    return products

candidates = discover("mechanical keyboard")
watchlist = [p["asin"] for p in candidates if p.get("stars", 0) >= 4.0]

Run this once per category to build your watchlist, then switch to the product endpoint for actual tracking. Search results can reorder between requests; ASINs do not.

Step 2: track price by ASIN

resource=product pulls the full listing for one ASIN, including current price, availability and buybox seller, for 1 credit:

def check_price(asin, domain="com"):
    resp = requests.get(
        "https://api.fastaf.co/v1/amazon",
        params={"resource": "product", "asin": asin, "domain": domain},
        headers={"Authorization": f"Bearer {API_KEY}"},
        timeout=60,
    )
    resp.raise_for_status()
    # resource=product returns one flat object (title, price, ...), not a results list.
    # Its price field is a display string like "$25.49 with 40 percent savings" (checked August 2026).
    product = resp.json()
    match = re.search(r"[\d][\d.,]*", product.get("price") or "")
    price = float(match.group().replace(",", "")) if match else None
    return price, product.get("title")

Step 3: store history in SQLite

import sqlite3
import time

conn = sqlite3.connect("prices.db")
conn.execute("""
    CREATE TABLE IF NOT EXISTS price_history (
        asin TEXT,
        price REAL,
        checked_at INTEGER
    )
""")

def record_price(asin, price):
    conn.execute(
        "INSERT INTO price_history VALUES (?, ?, ?)",
        (asin, price, int(time.time())),
    )
    conn.commit()

def last_price(asin):
    row = conn.execute(
        "SELECT price FROM price_history WHERE asin = ? ORDER BY checked_at DESC LIMIT 1",
        (asin,),
    ).fetchone()
    return row[0] if row else None

Step 4: schedule the checks and alert on drops

A cron job (or a simple loop with time.sleep, if you are not on a machine with cron) that walks the watchlist and compares against the last stored price:

def run_check(watchlist, threshold_pct=5):
    for asin in watchlist:
        price, title = check_price(asin)
        if price is None:
            continue

        previous = last_price(asin)
        record_price(asin, price)

        if previous and price < previous * (1 - threshold_pct / 100):
            drop_pct = round((1 - price / previous) * 100, 1)
            alert(f"{title}: ${previous:.2f} -> ${price:.2f} ({drop_pct}% off)")

def alert(message):
    print(message)  # swap for email, Slack webhook, whatever you actually check

Schedule run_check(watchlist) however suits your setup: cron, a systemd timer, or a scheduled worker if you deploy this to a serverless platform. Checking a few times a day is enough for most consumer goods; hourly is overkill unless you are chasing lightning deals specifically.

Watching beyond Amazon

Amazon is not the only place a price moves. For a broader market check, run the product name through /serp, Google Search, and read the organic listings: which retailers rank for the product, and whether a new seller has entered the results, is useful signal even without a dedicated shopping feed:

def market_check(product_name, country="us"):
    resp = requests.get(
        "https://api.fastaf.co/v1/serp",
        params={"query": f"{product_name} price", "country": country},
        headers={"Authorization": f"Bearer {API_KEY}"},
        timeout=60,
    )
    resp.raise_for_status()
    return [r["link"] for r in resp.json().get("organic_results", [])]

That costs 5 credits per product and is worth running weekly, not daily: it is for spotting a new competitor or a delisting, not for catching an hourly price swing.

What does this actually cost?

A concrete bot: 200 ASINs tracked three times a day, plus a weekly market check on the same 200 products, plus 20 discovery searches a month to refresh the watchlist.

Job Requests (30 days) Credits each Credits (30 days)
ASIN price checks (200 x 3/day) 18,000 1 18,000
Weekly market check (200 x 4) 800 5 4,000
Discovery searches 20 1 20
Total ~22,020

A $29 Growth pack (75,000 credits) covers more than three months of it, or a month of a watchlist grown past 600 ASINs. The free tier (500 credits, no card) is enough to run this exact bot against a 15-ASIN watchlist for a week before you decide it is worth paying for.

The short version

Discover with search, track with the product endpoint, store every check even when nothing changed (you need the history to compute a drop percentage), and alert only past a threshold so you are not paged for a $0.01 fluctuation. Budget roughly 1 credit per ASIN per check: at that rate, tracking hundreds of products daily costs single-digit dollars for a month of checks. Full parameter list in the docs.