Build a Price Monitoring Bot in Python — 10 Lines of Code
March 4, 2026 · 4 min read
Want to track when a competitor drops their prices? Here's a complete price monitoring bot in 10 lines of Python.
The Complete Bot
import requests, json
API_KEY = "sr_live_your_key"
STORE = "competitor-store.com"
THRESHOLD = 50.00 # Alert if any product drops below $50
products = requests.post(
"https://api.shelfrun.com/v1/quickscan",
headers={"X-API-Key": API_KEY},
json={"url": STORE}
).json()["products"]
drops = [p for p in products if p["price"] < THRESHOLD]
for p in drops:
print(f"🔥 PRICE DROP: {p['name']} now " + str(p['price']))Making It Run Automatically
Add a cron job to check every hour:
0 * * * * python3 /path/to/price_monitor.pyOr Use ShelfRun's Built-in Alerts
Even easier: set up alert rules directly in ShelfRun. No code needed:
- Add your competitor's store to ShelfRun
- Set sync frequency to daily
- Create an alert rule: “Notify when any price drops by more than 10%”
- Add a webhook URL to receive notifications
Webhook Payload
When a price drop is detected, ShelfRun sends a webhook:
{
"event": "alert_triggered",
"rule_type": "price_drop_pct",
"product": "Nike Air Max 90",
"old_price": 120.00,
"new_price": 89.99,
"change_pct": -25.0
}Connect to Slack
Pipe the webhook to Slack using n8n or Zapier for instant team notifications. See our integration templates for step-by-step guides.