> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spidra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Track prices and get alerts

> Watch product prices on Amazon, Walmart, eBay or any shop on a schedule, and get an email, Slack, Discord or webhook alert only when a price drops.

This guide sets up a [monitor](https://docs.spidra.io/monitors.md) that checks an Amazon product every morning and emails you when its price drops by 5% or more. Nothing is sent when the price stays the same. The same pattern works for Walmart, eBay and any other page.

You need Python with `requests`, and your API key in `SPIDRA_API_KEY`.

## 1. Describe what to watch and when to alert

```python theme={null}
monitor = {
    "name": "Echo Dot price",
    "sources": [
        {"kind": "template", "template": "amazon-product-details", "inputs": {"products": ["B0CG1LGWR6"]}}
    ],
    "schedule": {"every": "1d", "at": "08:00", "timezone": "America/New_York"},
    "alertOn": "changed",
    "watchFields": ["price"],
    "rule": {"field": "price", "op": "drops_by_pct", "value": 5},
    "notify": {"email": {"enabled": True}},
}
```

* **The source** is the **Amazon product details** [template](https://docs.spidra.io/templates.md), which returns the price as a number. `products` takes ASINs or product links, several at once.
* **`alertOn: "changed"` with `watchFields: ["price"]`** compares only the price between checks.
* **The rule** narrows it to drops of 5% or more. Use `"op": "lt", "value": 40` for "below \$40" instead.
* **Email** goes to your account's address. Add `"slack": {"webhookUrl": "..."}` or a `webhook` to get alerts elsewhere too.

## 2. Create the monitor

```python theme={null}
# price_watch.py
import os
import time

import requests

API = "https://api.spidra.io/api"
HEADERS = {"Authorization": f"Bearer {os.environ['SPIDRA_API_KEY']}"}

monitor = {
    "name": "Echo Dot price",
    "sources": [
        {"kind": "template", "template": "amazon-product-details", "inputs": {"products": ["B0CG1LGWR6"]}}
    ],
    "schedule": {"every": "1d", "at": "08:00", "timezone": "America/New_York"},
    "alertOn": "changed",
    "watchFields": ["price"],
    "rule": {"field": "price", "op": "drops_by_pct", "value": 5},
    "notify": {"email": {"enabled": True}},
}

# 1. See what it will cost
estimate = requests.post(f"{API}/monitors/estimate", headers=HEADERS, json=monitor).json()
print(f"{estimate['creditsPerCheck']} credit per check, about {estimate['creditsPerMonth']} a month")

# 2. Create it (the first check runs straight away and records today's price)
created = requests.post(f"{API}/monitors", headers=HEADERS, json=monitor).json()["monitor"]
print("Monitor", created["id"], "next check", created["nextRunAt"])

# 3. Read the first check
time.sleep(30)
checks = requests.get(f"{API}/monitors/{created['id']}/checks", headers=HEADERS).json()["checks"]
print(checks[0]["status"], "-", checks[0]["summary"])
```

```text theme={null}
1 credit per check, about 30 a month
Monitor 73f8b2aa-56d6-41c0-9121-3e5414f88b08 next check 2026-10-25T12:00:00.000Z
completed - Started watching (1 item)
```

The first check recorded the current price and didn't alert. From now on, each morning's price is compared with the day before, and an email goes out only when it has dropped by 5% or more. `nextRunAt` is in UTC: 08:00 in New York is 12:00 UTC.

## 3. When the price drops

The alert email names the monitor, says what changed, and shows the old and new price. Read the same thing from the API with [Get a Monitor Check](https://docs.spidra.io/api-reference/monitors/get-check.md), where each changed item looks like:

```json theme={null}
{ "key": "B0CG1LGWR6", "item": { "title": "...", "price": 39.99 }, "fields": [{ "field": "price", "previous": 49.99, "current": 39.99 }] }
```

(That's the shape; your values come from the product.) [Send a Test Notification](https://docs.spidra.io/api-reference/monitors/test-notification.md) shows what an alert looks like in each channel before a real one arrives.

## Watch other shops

| To watch | Source |
| - | - |
| Walmart products | `{"kind": "template", "template": "walmart-product-details", "inputs": {...}}` |
| eBay items | `{"kind": "template", "template": "ebay-item-details", "inputs": {...}}` |
| Any product page | A [preset](https://docs.spidra.io/presets.md) of a scrape with a schema that has a `price` field, as `{"kind": "preset", "presetId": "..."}` |
| A page's text | `{"kind": "urls", "urls": ["https://..."]}` with `"alertOn": "page"` |

[Get a Template](https://docs.spidra.io/api-reference/templates/get.md) lists each template's inputs.

## Good to know

* A check costs what the run costs: 1 credit per product here.
* Your plan sets the fastest schedule: daily on Free, hourly on Starter, every 15 minutes on Builder, every 5 minutes on Pro.
* After 5 failed checks in a row, the monitor pauses and emails you.
* Prices follow Amazon's marketplace. Set the template's `marketplace` input for amazon.co.uk, amazon.de and the rest.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.