ScavioScavio
ProductPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Build a Google Shopping Price Alert
Tutorial

How to Build a Google Shopping Price Alert

Build a price alert pipeline for Google Shopping products. Monitor prices, detect drops, and get notified when products hit your target price.

Get Free API KeyAPI Docs

Price monitoring for Google Shopping products is useful for personal buying decisions, competitive intelligence, and e-commerce arbitrage. Building your own price alert system lets you track specific products and get notified when prices drop below your threshold. This tutorial shows how to query Google Shopping via the Scavio API, store price history, detect price changes, and trigger alerts. You will build a pipeline that runs on a schedule and notifies you of significant price movements.

Prerequisites

  • Python 3.8+ installed
  • requests library installed
  • A Scavio API key from scavio.dev
  • A list of products to monitor

Walkthrough

Step 1: Define products to monitor

Set up the products and target prices you want to track.

Python
import os, requests, json
from datetime import date

API_KEY = os.environ["SCAVIO_API_KEY"]

WATCHLIST = [
    {"query": "Sony WH-1000XM5", "target_price": 250.00},
    {"query": "Apple AirPods Pro 2", "target_price": 180.00},
    {"query": "Samsung Galaxy Buds 3", "target_price": 120.00},
]
HISTORY_FILE = "price_history.json"

Step 2: Fetch current prices

Query Google Shopping for each product and extract the lowest current price.

Python
def get_prices(product_query):
    resp = requests.post("https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": API_KEY},
        json={"platform": "google", "query": product_query, "type": "shopping"})
    results = resp.json().get("shopping_results", [])[:10]
    prices = []
    for r in results:
        price_str = r.get("price", "").replace("$", "").replace(",", "")
        try:
            prices.append({"title": r["title"], "price": float(price_str),
                           "seller": r.get("source", ""), "link": r.get("link", "")})
        except ValueError:
            continue
    return sorted(prices, key=lambda x: x["price"])

Step 3: Track price history

Store prices over time to detect trends and drops.

Python
def load_history():
    try:
        with open(HISTORY_FILE) as f:
            return json.load(f)
    except FileNotFoundError:
        return {}

def save_price(query, prices):
    history = load_history()
    if query not in history:
        history[query] = []
    if prices:
        history[query].append({
            "date": date.today().isoformat(),
            "lowest": prices[0]["price"],
            "seller": prices[0]["seller"],
        })
    with open(HISTORY_FILE, "w") as f:
        json.dump(history, f, indent=2)

Step 4: Check alerts and notify

Compare current prices against target prices and previous prices to detect drops.

Python
def check_alerts(watchlist):
    alerts = []
    for item in watchlist:
        prices = get_prices(item["query"])
        if not prices: continue
        lowest = prices[0]["price"]
        save_price(item["query"], prices)
        if lowest <= item["target_price"]:
            alerts.append({
                "product": item["query"],
                "price": lowest,
                "target": item["target_price"],
                "seller": prices[0]["seller"],
                "link": prices[0]["link"],
            })
            print(f"ALERT: {item['query']} at ${lowest} (target: ${item['target_price']})")
        else:
            print(f"{item['query']}: ${lowest} (target: ${item['target_price']})")
    return alerts

alerts = check_alerts(WATCHLIST)

Python Example

Python
import os, requests
API_KEY = os.environ["SCAVIO_API_KEY"]
def lowest_price(query):
    resp = requests.post("https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": API_KEY},
        json={"platform": "google", "query": query, "type": "shopping"})
    results = resp.json().get("shopping_results", [])[:5]
    prices = []
    for r in results:
        try: prices.append(float(r.get("price","0").replace("$","").replace(",","")))
        except: pass
    return min(prices) if prices else None

print(f"Lowest: ${lowest_price('Sony WH-1000XM5')}")

JavaScript Example

JavaScript
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
async function lowestPrice(query) {
  const r = await fetch("https://api.scavio.dev/api/v1/search", {
    method: "POST", headers: H,
    body: JSON.stringify({platform: "google", query, type: "shopping"})
  });
  const items = (await r.json()).shopping_results || [];
  const prices = items.map(i => parseFloat((i.price||"0").replace(/[$,]/g,""))).filter(Boolean);
  return Math.min(...prices);
}
lowestPrice("Sony WH-1000XM5").then(p => console.log("Lowest: $" + p));

Expected Output

JSON
A price monitoring pipeline that tracks Google Shopping prices, stores history, detects drops, and alerts when products hit target price thresholds.

Related Tutorials

  • How to Build a Price Comparison Tool for Amazon and Walmart
  • How to Get Google Shopping Data Without Proxies

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Python 3.8+ installed. requests library installed. A Scavio API key from scavio.dev. A list of products to monitor. A Scavio API key gives you 50 free credits on signup.

Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Related Resources

Best Of

Best API for Cross-Platform Price Monitoring in 2026

Read more
Best Of

Best E-Commerce Price Tracking API in 2026

Read more
Use Case

Cross-Platform Product Price Monitoring

Read more
Use Case

Google Shopping Price Monitoring

Read more
Glossary

Google Shopping Structured Search

Read more
Solution

Track Products Across Amazon, Walmart, and Google Shopping

Read more

Start Building

Build a price alert pipeline for Google Shopping products. Monitor prices, detect drops, and get notified when products hit your target price.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy