---
title: "Price Monitoring Tool: Build One on Product APIs"
description: "Build a price monitoring tool in Python: daily Google Shopping, Walmart and idealo searches, price and seller per day in SQLite, 1 credit per check."
url: https://perceptlayer.com/blog/price-monitoring-tool-build
---

[Blog](https://perceptlayer.com/blog) / [Web data by industry](https://perceptlayer.com/blog/category/web-data)

# Price Monitoring Tool: Build One on Product APIs

31 Oct 2026 Perceptlayer 9 min read

A price monitoring tool checks the same products on the same shops every day, stores each price with its seller and date, and tells you when a price falls. You can build a small one in about 115 lines of Python on three product endpoints: Google Shopping, Walmart and idealo. Each check is one search call at 1 credit, matched to your product by its ID in the results. This tutorial builds the watchlist, the fetcher, a SQLite history and a drop alert, then works out the cost per product per day.

## Key takeaways

-   The tool makes one search call per product per source per day: `GET /v1/google-shopping/search`, `GET /v1/walmart/search` or `GET /v1/idealo/search`, each 1 credit per successful call.
-   Match by ID, not by position: `product_id` in Google Shopping's `shopping_results`, `us_item_id` in Walmart's `data.results`, and `id` in idealo's `results`.
-   Store the seller with every price: `source` on Google Shopping, `seller_name` on Walmart, and `cheapest_offer.shop_name` on idealo.
-   A product watched on all three sources costs 3 credits a day: 100 products × 3 × 30 days = 9,000 credits a month, inside the Starter pack's 10,000.
-   Failed calls cost nothing and return `X-Credits-Used: 0`, so a day with errors costs less, not more.

## What does the price monitoring tool do?

The tool runs once a day. For each entry in a watchlist, it searches one source with a query, finds the entry's product in the results by its ID, and writes a row with the date, source, product ID, price, currency and seller to a SQLite database. Then it compares today's price with the last stored price and with the lowest price in the last 30 days, and raises an alert when the drop passes a threshold you set.

That's deliberately narrower than an agent. There's no language model choosing what to search; the watchlist decides. If you want a tracker that an agent drives, or one that picks the lowest match from free-text results, [Build a Price Tracking Agent in Python with Live Data](https://perceptlayer.com/blog/price-tracking-agent-python) covers that design with Google Shopping and eBay. This tool trades flexibility for predictability: the same calls every day, a fixed credit bill, and rows you can compare day to day.

## Which endpoints does it call?

It calls one search endpoint on each source, because each search result already carries a price, a seller and an ID you can match on. All three are `GET` requests at 1 credit per successful call. The parameters below are the ones the tool sets; each API page lists the rest, and nothing about defaults is documented, so the tool sets every value it relies on.

| Source | Endpoint | Query parameter | Other parameters the tool can set | ID to match | Seller field |
| --- | --- | --- | --- | --- | --- |
| [Google Shopping](https://perceptlayer.com/apis/google-shopping) | `/v1/google-shopping/search` | `q` | `gl`, `hl`, `location`, `device` | `product_id` | `source` |
| [Walmart](https://perceptlayer.com/apis/walmart) | `/v1/walmart/search` | `query` | `country` ( `us` or `ca`), `sort`, `min_price`, `max_price` | `us_item_id` | `seller_name` |
| [idealo](https://perceptlayer.com/apis/idealo) | `/v1/idealo/search` | `query` | `category_id`, `sort`, `price_min`, `price_max` | `id` | `cheapest_offer.shop_name` |

Walmart and idealo also have detail endpoints that take an ID: [`/v1/walmart/product`](https://perceptlayer.com/apis/walmart/product) takes `us_item_id`, and [`/v1/idealo/offers`](https://perceptlayer.com/apis/idealo/offers) takes `product_id`. The names match the IDs in the search results. We don't have recorded responses for those two, so this tool stays on search, and you can try the detail endpoints in the playground if you need more per product.

## What does each source return?

Each search returns a list of products with a price and a seller, in a slightly different shape per source. The excerpts below are from recorded responses, trimmed to the fields the tool reads. Prices are what each page showed when the call was recorded.

Google Shopping, for `q=iphone 15&gl=us&hl=en`:

```json
{
  "shopping_results": [
    {
      "position": 2,
      "title": "Apple iPhone 15 128GB",
      "source": "Best Buy",
      …
      "product_id": "4379032623638529631",
      "link": "https://www.google.com/shopping/product/4379032623638529631",
      "price": "$441.00",
      "extracted_price": 441,
      …
    }
  ],
  "pagination": {
    "current_page": 1,
    "start": 0,
    "next_start": 10
  }
}
```

Walmart, for `query=air fryer`:

```json
{
  "success": true,
  "data": {
    "results": [
      {
        "us_item_id": "14678059894",
        "title": "Chefman Air Fryer 1500W, 6 Quart, 4 Functions with Touch Controls, Stainless Steel",
        "price": 59.98,
        "currency": "USD",
        …
        "seller_name": "Walmart.com",
        "availability_status": "IN_STOCK",
        …
        "out_of_stock": false,
        "sponsored": true
      }
    ],
    …
  }
}
```

idealo, for `query=air fryer`:

```json
{
  "success": true,
  "query": "air fryer",
  "results": [
    {
      "id": "204292458",
      "type": "PRODUCT",
      "title": "Philips NA221/00",
      …
      "price": 76.3,
      "price_formatted": "76,30 €",
      "currency": "EUR",
      "offer_count": 13,
      …
      "cheapest_offer": {
        …
        "shop_name": "proshop.de",
        …
        "shipping_costs": "4,99 €",
        "shipping_is_free": false
      },
      …
    }
  ],
  …
}
```

Three differences shape the code. Google Shopping has no currency field, so the tool stores the `price` string next to `extracted_price`. Walmart nests results under `data` and flags `sponsored` items, which is one more reason to match by ID instead of taking the first result. idealo's `price` is the product's price across shops, and its seller is the shop in `cheapest_offer`, with `shipping_costs` as a display string.

## How do you build the tool?

You build it in five steps: a key and one package, a watchlist, a fetcher that respects the limits, one extractor per source, and a store with a drop check. The complete script is in step 5. It uses Python's standard `sqlite3`, `json` and `datetime` modules plus `requests`.

### Step 1: Get a key and install requests

[Get a free API key](https://perceptlayer.com/signup); it starts with `sk_live_` and goes in the `X-API-Key` header. Every account gets 100 free credits after verifying an email. Then install the one package and export the key:

```bash
pip install requests
export API_KEY=sk_live_your_key
```

The [quick start](https://docs.perceptlayer.com/quickstart) and [authentication docs](https://docs.perceptlayer.com/authentication) cover the key in more detail.

### Step 2: Write the watchlist

Each watchlist entry is one product on one source: a label, the source, the search parameters and the ID to match. Use a query specific enough that the product appears on the first page of results, such as the model name. The IDs below are from the recorded responses; replace them with your own after a test search in each API's playground.

```python
WATCHLIST = [
    {"label": "iPhone 15 128GB", "source": "google_shopping",
     "params": {"q": "iphone 15", "gl": "us", "hl": "en"}, "id": "4379032623638529631"},
    {"label": "Chefman 6 qt air fryer", "source": "walmart",
     "params": {"query": "air fryer", "country": "us"}, "id": "14678059894"},
    {"label": "Philips NA221/00", "source": "idealo",
     "params": {"query": "air fryer"}, "id": "204292458"},
]
```

### Step 3: Fetch with retries and a pause

The fetcher sends the request with the key, waits for the seconds in `Retry-After` on a 429 or 503, and raises on other errors. Requests have no idempotency key, so a client timeout can hide a call that succeeded and was billed; a 60-second timeout keeps that rare. The main loop pauses one second between calls, which keeps a free account within its 1 request a second.

### Step 4: Extract the matched product from each source

One small function per source walks the result list, finds the entry whose ID matches, and returns the price, currency, seller and a raw note. It reads only fields that appear in the recorded responses, with `.get`, so a missing field becomes `None` instead of a crash. When the ID isn't on the page, it returns `None` and the tool records nothing for that day.

### Step 5: Store each day and check for drops

The complete script below puts steps 3 to 5 together. The `prices` table has one row per day, source and product ID; `INSERT OR REPLACE` means a second run on the same day overwrites the first rather than adding a duplicate.

```python
import datetime
import json
import os
import sqlite3
import time

import requests

API_KEY = os.environ["API_KEY"]
BASE = "https://api.perceptlayer.com"
PATHS = {
    "google_shopping": "/v1/google-shopping/search",
    "walmart": "/v1/walmart/search",
    "idealo": "/v1/idealo/search",
}
DROP = 0.05  # alert on a fall of 5% or more

WATCHLIST = [
    {"label": "iPhone 15 128GB", "source": "google_shopping",
     "params": {"q": "iphone 15", "gl": "us", "hl": "en"}, "id": "4379032623638529631"},
    {"label": "Chefman 6 qt air fryer", "source": "walmart",
     "params": {"query": "air fryer", "country": "us"}, "id": "14678059894"},
    {"label": "Philips NA221/00", "source": "idealo",
     "params": {"query": "air fryer"}, "id": "204292458"},
]

def fetch(path, params, attempts=3):
    for _ in range(attempts):
        r = requests.get(BASE + path, params=params,
                         headers={"X-API-Key": API_KEY}, timeout=60)
        if r.status_code in (429, 503):
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        r.raise_for_status()
        return r.json(), int(r.headers.get("X-Credits-Used", "0"))
    raise RuntimeError(f"gave up on {path} {params}")

def google_shopping(data, wanted):
    for item in data.get("shopping_results", []):
        if item.get("product_id") == wanted:
            return item.get("extracted_price"), None, item.get("source"), item.get("price")
    return None

def walmart(data, wanted):
    for item in data.get("data", {}).get("results", []):
        if item.get("us_item_id") == wanted:
            return (item.get("price"), item.get("currency"), item.get("seller_name"),
                    item.get("availability_status"))
    return None

def idealo(data, wanted):
    for item in data.get("results", []):
        if item.get("id") == wanted:
            offer = item.get("cheapest_offer") or {}
            return (item.get("price"), item.get("currency"), offer.get("shop_name"),
                    offer.get("shipping_costs"))
    return None

EXTRACT = {"google_shopping": google_shopping, "walmart": walmart, "idealo": idealo}

db = sqlite3.connect("prices.db")
db.execute("""CREATE TABLE IF NOT EXISTS prices (
    day TEXT, source TEXT, item_id TEXT, label TEXT,
    price REAL, currency TEXT, seller TEXT, note TEXT,
    PRIMARY KEY (day, source, item_id))""")

today = datetime.date.today().isoformat()
month_ago = (datetime.date.today() - datetime.timedelta(days=30)).isoformat()
spent = 0

for entry in WATCHLIST:
    src, wanted = entry["source"], entry["id"]
    try:
        data, credits = fetch(PATHS[src], entry["params"])
    except (requests.RequestException, RuntimeError) as err:
        print(f"ERROR  {entry['label']} on {src}: {err}")
        continue
    spent += credits
    hit = EXTRACT[src](data, wanted)
    if hit is None or hit[0] is None:
        print(f"MISS   {entry['label']} not on the first page of {src}")
        time.sleep(1)
        continue
    price, currency, seller, note = hit

    last = db.execute(
        "SELECT price FROM prices WHERE source=? AND item_id=? AND day<? "
        "ORDER BY day DESC LIMIT 1", (src, wanted, today)).fetchone()
    low = db.execute(
        "SELECT MIN(price) FROM prices WHERE source=? AND item_id=? AND day>=? AND day<?",
        (src, wanted, month_ago, today)).fetchone()[0]

    db.execute("INSERT OR REPLACE INTO prices VALUES (?,?,?,?,?,?,?,?)",
               (today, src, wanted, entry["label"], price, currency, seller, note))
    db.commit()

    if last and price <= last[0] * (1 - DROP):
        print(f"DROP   {entry['label']} on {src}: {last[0]} -> {price} ({seller})")
        if low is not None and price < low:
            print(f"LOW    {entry['label']} is below its 30-day low of {low}")
        with open("alerts.jsonl", "a") as f:
            f.write(json.dumps({"day": today, "source": src, "id": wanted,
                                "label": entry["label"], "was": last[0],
                                "now": price, "seller": seller}) + "\n")
    else:
        print(f"OK     {entry['label']} on {src}: {price} {currency or ''} ({seller})")
    time.sleep(1)

print(f"credits used this run: {spent}")
```

Alerts go to the terminal and to `alerts.jsonl`, one JSON object per line, so you can forward them to email or chat with whatever you already use. Schedule the script once a day with cron, for example `15 7 * * * cd /opt/prices && python3 monitor.py`.

## What does the result look like?

After the first run, the database holds one row per watchlist entry that was found, and no alerts, because there's no earlier price to compare with. With the values in the recorded responses, those rows would be:

| day | source | item\_id | price | currency | seller | note |
| --- | --- | --- | --- | --- | --- | --- |
| first run | google\_shopping | 4379032623638529631 | 441 |  | Best Buy | $441.00 |
| first run | walmart | 14678059894 | 59.98 | USD | Walmart.com | IN\_STOCK |
| first run | idealo | 204292458 | 76.3 | EUR | proshop.de | 4,99 € |

From the second day on, each run compares with the last stored row. If the Walmart item fell from 59.98 to 56.00, that's a 6.6% drop, past the 5% threshold, so the tool prints a `DROP` line and appends it to `alerts.jsonl`. The seller column matters as much as the price: on Google Shopping and idealo, a lower price can come with a different seller, and that's worth knowing before you act on the alert. For other ways to use the history, [Build an ETL Pipeline in Python for Web Data](https://perceptlayer.com/blog/etl-pipeline-python-web-data) and [Save API JSON to Parquet in Python](https://perceptlayer.com/blog/save-api-json-to-parquet-python) cover the storage side.

## What does price monitoring cost per product per day?

The cost is 1 credit per watchlist entry per day, because each entry is one search call. A product you watch on one source costs 1 credit a day; on all three, 3 credits a day. Failed calls cost nothing, and a retry that succeeds is billed once. The script prints the credits each run used, read from `X-Credits-Used`.

| Watchlist | Arithmetic | Credits a month |
| --- | --- | --- |
| 30 products, 1 source | 30 × 1 × 30 days × 1 credit | 900 |
| 100 products, 3 sources | 100 × 3 × 30 days × 1 credit | 9,000 |
| 500 products, 2 sources | 500 × 2 × 30 days × 1 credit | 30,000 |
| 500 products, 2 sources, twice a day | 500 × 2 × 2 × 30 days × 1 credit | 60,000 |

The 100 free credits on signup cover the first plan's first 3 days, enough to test the tool. A Starter pack's 10,000 covers 11 months of the first plan or one month of the second, the third the Build pack's 50,000, and the fourth needs the Growth pack's 200,000 or two Build packs. Purchased credits last 12 months, with no subscription. When the balance runs out, calls return `insufficient_credits` (402) and nothing more is debited. See [pricing](https://perceptlayer.com/pricing) for what credits cost and the [credits docs](https://docs.perceptlayer.com/credits) for how debits work.

Run time follows the rate limit, which is per account and counted per minute. At the free 1 request a second, 30 entries take about 30 seconds; a paying account runs at least 5 a second. The [rate limits docs](https://docs.perceptlayer.com/rate-limits) list each pack's rate.

## How do you keep the monitor honest?

A price monitor is only useful if each row means the same thing every day. Keep the parameters for each entry fixed, especially `gl`, `hl` and `country`, because a different market is a different price. Compare each source only with its own history: Walmart returns `USD`, idealo `EUR`, and Google Shopping a display string, so don't rank them against each other without converting first; [Normalise Prices Across Currencies and Sources in Python](https://perceptlayer.com/blog/normalize-prices-multiple-currencies) shows one way.

Watch the `MISS` lines too. A product that drops off the first page isn't necessarily gone; your query may have become too broad. Tighten the query, or add `page` (Walmart, idealo) or `start` (Google Shopping, whose `pagination.next_start` has the same name) and accept one more credit per extra page. Data is collected from publicly available sources and returned as found at the time of the call, so store the date with every price, as the table does.

To start, run a search for one of your products in the playground on the [Walmart API page](https://perceptlayer.com/apis/walmart) or the [idealo API page](https://perceptlayer.com/apis/idealo), copy its ID into the watchlist, and run the script. For more on the fields these sources return, see the [marketplaces APIs](https://perceptlayer.com/verticals/marketplaces).

## APIs in this post

-   [Google Shopping **1 credit per call** · 4 endpoints](https://perceptlayer.com/apis/google-shopping)
-   [Walmart **1 credit per call** · 11 endpoints](https://perceptlayer.com/apis/walmart)
-   [Idealo **1 credit per call** · 13 endpoints](https://perceptlayer.com/apis/idealo)

## Frequently asked questions

### How much does it cost to monitor one product?

One credit per source per day, because each check is one search call at 1 credit. A product watched on Google Shopping, Walmart and idealo costs 3 credits a day, or 90 credits over 30 days. Failed calls cost nothing and return `X-Credits-Used: 0`. The pricing page shows what credits cost.

### Why match products by ID instead of taking the first result?

Result order changes, and some results are promoted: the recorded Walmart search marks both of its first two items with `sponsored: true`. Matching `product_id`, `us_item_id` or `id` makes sure each day's row describes the same product. Check over a few runs that the ID stays the same for your products before you build history on it.

### Does the tool include shipping costs?

Only where the response has them. idealo's `cheapest_offer` carries `shipping_costs` as a display string, such as `4,99 €`, and `shipping_is_free`, which the tool stores in the `note` column. The recorded Google Shopping and Walmart search results have no shipping field, so the tool stores the item price alone for those sources.

### Can I monitor prices in other countries?

Partly. Google Shopping takes `gl` and `hl` for country and language, and `location` for a place. Walmart's `country` accepts `us` or `ca`. The recorded idealo search returned German results in `EUR`. Each country is a separate watchlist entry and a separate call at 1 credit, so keep currencies apart in your comparisons.

### What happens when a call fails during a run?

The tool prints an `ERROR` line for that entry and moves on, and no credits are debited for the failure. The fetcher waits for the seconds in `Retry-After` on a 429 or 503 before trying again. Other errors return an HTTP status and a JSON body with `code`, `message` and `request_id`; the errors docs list every code.

price monitoring ecommerce data walmart idealo google shopping python

## More from the blog

1.  [Web data by industry](https://perceptlayer.com/blog/category/web-data) 8 Aug 2026 Updated 2 Nov 2026 Perceptlayer 7 min read
    
    ## [News Data for Event Detection: Signals and Noise](https://perceptlayer.com/blog/news-data-event-detection)
    
    Turn news search results into event signals: drop duplicate URLs, cluster syndicated titles, count distinct sources in a window, and compare with a baseline.
    
2.  [Web data by industry](https://perceptlayer.com/blog/category/web-data) 17 Nov 2026 Perceptlayer 7 min read
    
    ## [Grocery Price Data from Five Stores as JSON](https://perceptlayer.com/blog/grocery-price-data-api)
    
    Grocery prices from Kroger, Whole Foods, Trader Joe's, Sprouts and Costco at 1 credit a search: sale and unit-price fields, and a weekly basket's cost.
    
3.  [API guides](https://perceptlayer.com/blog/category/api-guides) 6 Nov 2026 Perceptlayer 9 min read
    
    ## [Google Shopping Scraper or API: What You Get](https://perceptlayer.com/blog/google-shopping-scraper-vs-api)
    
    A Google Shopping scraper vs one GET at 1 credit: the recorded iphone 15 search with source, extracted\_price and product\_id, and the cost per item tracked.
