Get Started

Get a ping on your phone the moment your wishlist drops in price

Build a small Python price tracker that checks your wishlist once a day, reads prices the way Google does, keeps a spreadsheet history and buzzes your phone when something gets cheaper. You build it on a practice shop on your own PC, then point it at real shops politely and legally.

80 minIntermediateTools: FreeStep 1 free
Your own price trackerone list of products, one run a day, a growing history in prices.csv
Prices read from the structured data shops publish for Google, with a CSS selector fallback and a real-browser mode for JavaScript pages
A price-drop alert on your phone, desktop or email, with secrets kept in a .env file
  • A formatted Excel workbook with a summary, a day-by-day table and a price chart
  • Good manners built in (robots.txt, a named User-Agent, a pause between pages, backing off when asked) and a plain-English guide to UK law on scraping
Before you start
  • The basics: Terminal survival kit. If you've done Get an alert when a price drops, you already know the idea; this is the do-it-yourself version with a spreadsheet at the end.
  • uv, the small Python tool used across this site. Step 1 installs it if you don't have it. You don't need to install Python separately.
  • The kit: price-tracker-kit.zip (12KB). It has the tracker, the spreadsheet maker and a practice shop.
  • Optional, for alerts: the free ntfy app (no account), and/or a Gmail account with 2-Step Verification turned on for email alerts.
  • Optional, for JavaScript-heavy pages: Edge or Chrome already installed. The Playwright package is a one-off 39MB download on Windows; no extra browser download is needed if you use Edge or Chrome.
01/07Get the kit and open the practice shop0 done
STEP 01 of 07~10 min

Get the kit and open the practice shop

You'll build the tracker against a shop you control, so you can change prices yourself and nobody else's server is touched while you learn.

  1. Install uv if you haven't already. It runs Python scripts and fetches the libraries each script asks for, without touching the rest of your PC (uv install docs ↗):

    Windows
    winget install --id astral-sh.uv -e
    Mac / Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
  2. Close the terminal and open a new one so it finds uv. Then download price-tracker-kit.zip, right-click it, choose Extract All, and extract it into your user folder so you end up with a price-tracker folder there. Inside:

    • tracker.py: the tracker. You'll read it properly in step 2.
    • products.csv: the list of things to track.
    • env.example: settings and secrets, which you'll copy to .env.
    • to_excel.py: turns the price history into an Excel workbook (step 6).
    • sample-shop/: Puddle Lane Kitchen, a practice shop with a kettle, a toaster and a robots.txt. It only exists on your PC.
  3. Start the practice shop. Python has a tiny web server built in, and --bind 127.0.0.1 keeps it visible to your PC only:

    Windows
    cd "$HOME\price-tracker"
    uv run python -m http.server 8000 --bind 127.0.0.1 --directory sample-shop
    Mac / Linux
    cd ~/price-tracker
    uv run python -m http.server 8000 --bind 127.0.0.1 --directory sample-shop
  4. Leave that window open. Open 127.0.0.1:8000/kettle.html ↗ in your browser: a copper kettle at £39.99. Now press Ctrl + U (on a Mac, Option + Cmd + U) to see the page's source. Near the top is the part this whole lesson is built on:

    sample-shop/kettle.html
    <!doctype html>
    <html lang="en-GB">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>Copper Kettle 1.7L | Puddle Lane Kitchen (practice shop)</title>
      <!-- The bit the tracker reads. Shops add this for Google; the format is schema.org Product. -->
      <script type="application/ld+json">
      {
        "@context": "https://schema.org/",
        "@type": "Product",
        "name": "Copper Kettle 1.7L",
        "sku": "PLK-KET-017",
        "offers": {
          "@type": "Offer",
          "url": "http://127.0.0.1:8000/kettle.html",
          "price": "39.99",
          "priceCurrency": "GBP",
          "availability": "https://schema.org/InStock"
        }
      }
      </script>
      <link rel="stylesheet" href="shop.css">
    </head>
    <body>
      <header><b>Puddle Lane Kitchen</b> <span class="note">A practice shop that only runs on your PC</span></header>
      <main>
        <h1>Copper Kettle 1.7L</h1>
        <p class="price">£39.99</p>
        <p class="stock">In stock</p>
        <p class="noise">7 people are looking at this right now</p>
        <p>Edit this file to change the price: there are two places, the JSON-LD block at the top and the price you can see.</p>
      </main>
    </body>
    </html>
  5. That application/ld+json block is structured data: the product's name, price, currency and stock, written for machines in the schema.org ↗ vocabulary. Shops add it so Google can show prices and stock in search results (Google's product structured data guide ↗). For you it's a gift: the price in a fixed, labelled place, instead of somewhere in the design that changes every redesign.

    TipTry it on a shop you use: open a product page, press Ctrl + U, then Ctrl + F and search for ld+json. On many shops you'll find an "offers" section with a "price" in it. That tells you the tracker will work there without any extra setup.
✓
CheckpointThe kettle page opens at 127.0.0.1:8000, and its source shows the "price": "39.99" line.
If it breaks'uv' is not recognised + 2 more
'uv' is not recognised
Close every terminal window and open a new one, so it picks up the newly installed uv. Still failing? Restart the PC.
OSError: [WinError 10048] Only one usage of each socket address ... is normally permitted
Something else is already using port 8000. Use 8001 in the command instead, open 127.0.0.1:8001, and change 8000 to 8001 in both lines of products.csv.
The browser says it can't reach 127.0.0.1
The server window must stay open. Check it's still running and that you typed http://, not https://: this little test server doesn't do HTTPS.
Still stuck? Ask the community
Next mission · Automate the boring stuffMake your scripts run themselves: nightly backups and free site-down alerts
→