Overview
This workflow refreshes Amazon product data daily for a monitored product list without any scraping infrastructure. It queries each product on Amazon via Scavio, extracts current prices, ratings, and review counts, compares against the previous day's data, and flags significant changes. Replaces fragile Amazon scrapers that break every 2-4 weeks with a maintenance-free API pipeline.
Trigger
Cron schedule (daily at 6 AM UTC)
Schedule
Runs daily at 6:00 AM UTC
Workflow Steps
Load product watchlist
Read the list of monitored products with their search queries and previous data.
Query Amazon via Scavio
For each product, call Scavio Amazon endpoint to get current listing data.
Extract product metrics
Parse price, rating, review count, and availability from structured results.
Compare against previous data
Flag products with price changes over 5%, rating changes, or availability changes.
Store updated data
Write current product data to storage for tomorrow's comparison.
Python Implementation
import requests
import json
from datetime import datetime
from pathlib import Path
API_KEY = "your_scavio_api_key"
THRESHOLD = 0.05
def refresh_products(products: list[dict]) -> dict:
baseline_path = Path("amazon_baseline.json")
baseline = json.loads(baseline_path.read_text()) if baseline_path.exists() else {}
updated = []
alerts = []
for product in products:
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "amazon", "query": product["query"]},
timeout=15,
)
if not res.ok:
continue
top = res.json().get("organic", [{}])[0] if res.json().get("organic") else {}
current_price = top.get("price")
slug = product["slug"]
if current_price and baseline.get(slug, {}).get("price"):
prev_price = baseline[slug]["price"]
change = abs(current_price - prev_price) / prev_price
if change >= THRESHOLD:
alerts.append({"slug": slug, "prev": prev_price, "current": current_price, "change_pct": round(change * 100, 1)})
baseline[slug] = {"price": current_price, "rating": top.get("rating"), "title": top.get("title", ""), "updated": datetime.utcnow().isoformat()}
updated.append(slug)
baseline_path.write_text(json.dumps(baseline, indent=2))
print(f"Refreshed {len(updated)} products, {len(alerts)} price alerts")
for a in alerts:
print(f" {a['slug']}: ${a['prev']} -> ${a['current']} ({a['change_pct']}%)")
return {"updated": len(updated), "alerts": alerts}
products = [
{"slug": "airpods-pro", "query": "Apple AirPods Pro"},
{"slug": "sony-wh1000xm5", "query": "Sony WH-1000XM5"},
]
refresh_products(products)JavaScript Implementation
const API_KEY = "your_scavio_api_key";
async function refreshProducts(products) {
const results = [];
for (const p of products) {
const res = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: { "x-api-key": API_KEY, "content-type": "application/json" },
body: JSON.stringify({ platform: "amazon", query: p.query }),
});
if (!res.ok) continue;
const top = ((await res.json()).organic ?? [])[0] ?? {};
results.push({ slug: p.slug, price: top.price, rating: top.rating, title: top.title ?? "" });
}
console.log(`Refreshed ${results.length} products`);
return results;
}
await refreshProducts([{ slug: "airpods", query: "Apple AirPods Pro" }]);Platforms Used
Amazon
Product search with prices, ratings, and reviews