Tutorial

How to Build an Ecommerce Price Tracker with Scavio

Track product prices across Amazon, Walmart, and Google Shopping in one credit pool. Daily snapshots, alerts, $30/mo total.

Small ecommerce owners and competitive-intelligence consultants need daily price snapshots across two or three marketplaces. Scavio's Amazon, Walmart, and Google Shopping endpoints feed the same JSON shape into a tracker. This tutorial builds the daily run plus alert pipeline.

Prerequisites

  • Python 3.10+
  • Scavio API key
  • DuckDB or Postgres

Walkthrough

Step 1: Define watchlist

List of (sku, label, sources) tuples.

Python
WATCHLIST = [
  ('B08Z6HVSL5', 'lego star wars 75300', ['amazon', 'walmart', 'google_shopping']),
  # add more...
]

Step 2: Pull Amazon price

ASIN-based lookup.

Python
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']

def amazon_price(asin):
    r = requests.post('https://api.scavio.dev/api/v1/amazon/product',
        headers={'x-api-key': API_KEY},
        json={'asin': asin})
    return r.json().get('price')

Step 3: Pull Walmart price

Walmart product lookup by ID.

Python
def walmart_price(walmart_id):
    r = requests.post('https://api.scavio.dev/api/v1/walmart/product',
        headers={'x-api-key': API_KEY},
        json={'product_id': walmart_id})
    return r.json().get('price')

Step 4: Pull Google Shopping

SERP shopping search returns merchant offers.

Python
def shopping(query):
    r = requests.post('https://api.scavio.dev/api/v1/google',
        headers={'x-api-key': API_KEY},
        json={'query': query, 'search_type': 'shopping'})
    return r.json().get('shopping_results', [])

Step 5: Store and alert

DuckDB row per (sku, source, price, date); alert on threshold drops.

Python
import duckdb
db = duckdb.connect('prices.duckdb')
db.execute('CREATE TABLE IF NOT EXISTS prices(sku TEXT, source TEXT, price FLOAT, date DATE)')

def alert_if_drop(sku, source, price):
    last = db.execute('SELECT price FROM prices WHERE sku=? AND source=? ORDER BY date DESC LIMIT 1', (sku, source)).fetchone()
    if last and price < last[0] * 0.9:
        # send alert
        pass

Python Example

Python
import os, requests
API_KEY = os.environ['SCAVIO_API_KEY']

def snapshot(asin, walmart_id, query):
    a = requests.post('https://api.scavio.dev/api/v1/amazon/product',
        headers={'x-api-key': API_KEY}, json={'asin': asin}).json()
    w = requests.post('https://api.scavio.dev/api/v1/walmart/product',
        headers={'x-api-key': API_KEY}, json={'product_id': walmart_id}).json()
    g = requests.post('https://api.scavio.dev/api/v1/google',
        headers={'x-api-key': API_KEY}, json={'query': query, 'search_type': 'shopping'}).json()
    return {'amazon': a.get('price'), 'walmart': w.get('price'), 'shopping': g.get('shopping_results',[])[:5]}

print(snapshot('B08Z6HVSL5', 'WL12345', 'lego 75300'))

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
export async function snapshot(asin, walmartId, query) {
  const headers = { 'x-api-key': API_KEY, 'Content-Type': 'application/json' };
  const [a, w, g] = await Promise.all([
    fetch('https://api.scavio.dev/api/v1/amazon/product', { method:'POST', headers, body: JSON.stringify({ asin }) }).then(r => r.json()),
    fetch('https://api.scavio.dev/api/v1/walmart/product', { method:'POST', headers, body: JSON.stringify({ product_id: walmartId }) }).then(r => r.json()),
    fetch('https://api.scavio.dev/api/v1/google', { method:'POST', headers, body: JSON.stringify({ query, search_type: 'shopping' }) }).then(r => r.json())
  ]);
  return { a, w, g };
}

Expected Output

JSON
Daily price snapshots per SKU across Amazon, Walmart, and Google Shopping. Alerts fire on >10% price drops. DuckDB stores history for trend analysis.

Related Tutorials

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.10+. Scavio API key. DuckDB or Postgres. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, 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.

Start Building

Track product prices across Amazon, Walmart, and Google Shopping in one credit pool. Daily snapshots, alerts, $30/mo total.