Quickstart
Fetch product data, switch retailers and watch for changes: three calls, five minutes.
Fetch product data, switch retailers and watch for changes: three calls, five minutes.
1. Get an API key
Sign up and create a key under Dashboard → Developers → API keys. Buy a credit pack under Dashboard → Billing & credits, then export the key so the samples can read it:
export SCRAPELY_API_KEY="sk_live_…"2. Fetch products
Send a platform and its item ids. This asks Walmart for two items; the second does not exist.
- cURL
- Python
- Node.js
curl -X POST "https://api.scrapelyserp.com/v1/products" \
-H "Authorization: Bearer $SCRAPELY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform":"walmart","ids":["931920073","1000000404"]}'import os
import requests
HEADERS = {"Authorization": f"Bearer {os.environ['SCRAPELY_API_KEY']}"}
r = requests.post(
"https://api.scrapelyserp.com/v1/products",
headers=HEADERS,
json={"platform": "walmart", "ids": ["931920073", "1000000404"]},
timeout=120,
)
r.raise_for_status()
data = r.json()
for item in data["results"]:
print(item["id"], item["status"], item.get("price"))const res = await fetch('https://api.scrapelyserp.com/v1/products', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SCRAPELY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ platform: 'walmart', ids: ['931920073', '1000000404'] }),
signal: AbortSignal.timeout(120_000),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
for (const item of data.results) console.log(item.id, item.status, item.price);Response
{
"platform": "walmart",
"marketplace": "us",
"tier": "standard",
"results": [
{
"id": "931920073",
"status": "ok",
"fetchedAt": "2026-10-16T14:02:37.118Z",
"title": "Mainstays 20\" 3-Speed Box Fan, White",
"url": "https://www.walmart.com/ip/931920073",
"price": {
"amount": 30,
"currency": "USD"
},
"availability": {
"inStock": true,
"message": "Available"
},
"seller": {
"name": "Walmart.com"
},
"fulfillment": {
"byPlatform": true,
"name": "Walmart"
},
"walmart": {
"…": "Walmart-only fields"
}
},
{
"id": "1000000404",
"status": "not_found",
"fetchedAt": "2026-10-16T14:02:37.118Z"
}
],
"stats": {
"requested": 2,
"ok": 1,
"partial": 0,
"notFound": 1,
"unavailable": 0,
"elapsedMs": 1840
},
"credits": 7.8e-7
}Every id comes back exactly once, in the order you sent them, with a
status.The missing item is
not_found: a definitive answer. Items Scrapely could not read this time would beunavailable.creditsis what the call was charged, a small fraction of one credit: credits are spent in proportion to the data a call moves. TheX-Scrapely-Creditsheader says the same;X-Scrapely-Balanceis what is left.A small call costs a tiny fraction of a credit, which JSON may write in exponent form (
7.8e-7). Parse it as a number.
3. Switch retailer
The same call works on every live retailer: change platform and the ids. Amazon has three tiers and asks you to pick one; the others have one.
- Target
- Best Buy
- Amazon
{
"platform": "target",
"ids": ["83887639"]
}{
"platform": "bestbuy",
"ids": ["6505727"]
}{
"platform": "amazon",
"ids": ["B0009KNLV6"],
"tier": "lite"
}4. Watch for changes
Register a webhook endpoint once (keep the secret it returns), then create a watchlist. Every 15 minutes Scrapely reads the items and sends a signed watchlist.product.changed event when a price or stock level moves.
Register an endpoint
- cURL
- Python
- Node.js
curl -X POST "https://api.scrapelyserp.com/v1/webhook_endpoints" \
-H "Authorization: Bearer $SCRAPELY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/hooks/scrapely"}'import os
import requests
HEADERS = {"Authorization": f"Bearer {os.environ['SCRAPELY_API_KEY']}"}
r = requests.post(
"https://api.scrapelyserp.com/v1/webhook_endpoints",
headers=HEADERS,
json={"url": "https://example.com/hooks/scrapely"},
timeout=30,
)
r.raise_for_status()
data = r.json()
print(data["id"], data["secret"]) # the secret is shown only onceconst res = await fetch('https://api.scrapelyserp.com/v1/webhook_endpoints', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SCRAPELY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url: 'https://example.com/hooks/scrapely' }),
signal: AbortSignal.timeout(30_000),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data.id, data.secret); // the secret is shown only onceCreate a watchlist
- cURL
- Python
- Node.js
curl -X POST "https://api.scrapelyserp.com/v1/watchlists" \
-H "Authorization: Bearer $SCRAPELY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Headphones",
"platform": "bestbuy",
"ids": ["6505727"],
"every": "15m",
"webhook_url": "https://example.com/hooks/scrapely"
}'import os
import uuid
import requests
HEADERS = {"Authorization": f"Bearer {os.environ['SCRAPELY_API_KEY']}"}
r = requests.post(
"https://api.scrapelyserp.com/v1/watchlists",
headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
json={
"name": "Headphones",
"platform": "bestbuy",
"ids": ["6505727"],
"every": "15m",
"webhook_url": "https://example.com/hooks/scrapely",
},
timeout=30,
)
r.raise_for_status()
data = r.json()const res = await fetch('https://api.scrapelyserp.com/v1/watchlists', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SCRAPELY_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({
name: 'Headphones',
platform: 'bestbuy',
ids: ['6505727'],
every: '15m',
webhook_url: 'https://example.com/hooks/scrapely',
}),
signal: AbortSignal.timeout(30_000),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();Next: verify signatures in your receiver, and read Watchlists & pipelines to choose what each run reads and when you are told.
Full reference → POST /v1/products, POST /v1/webhook_endpoints, POST /v1/watchlists