# Quickstart

> For AI agents: the index of these docs is at https://scrapelyserp.com/docs/llms.txt (every page it lists has a Markdown version like this one).

Fetch product data, switch retailers and watch for changes: three calls, five minutes.

## 1. Get an API key {#get-a-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:

```bash
export SCRAPELY_API_KEY="sk_live_…"
```

## 2. Fetch products {#fetch-products}

Send a platform and its item ids. This asks Walmart for two items; the second does not exist.

:::codeGroup{syncKey="lang"}
```bash title="cURL"
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"]}'
```
```python title="Python"
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"))
```
```javascript title="Node.js"
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**

```json
{
  "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 be `unavailable`.
- `credits` is what the call was charged, a small fraction of one credit: credits are spent in proportion to the data a call moves. The `X-Scrapely-Credits` header says the same; `X-Scrapely-Balance` is 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 {#switch-platform}

The same call works on every live retailer: change `platform` and the ids. Amazon has three [tiers](/docs/credits#tiers) and asks you to pick one; the others have one.

:::codeGroup
```json title="Target"
{
  "platform": "target",
  "ids": ["83887639"]
}
```
```json title="Best Buy"
{
  "platform": "bestbuy",
  "ids": ["6505727"]
}
```
```json title="Amazon"
{
  "platform": "amazon",
  "ids": ["B0009KNLV6"],
  "tier": "lite"
}
```
:::

## 4. Watch for changes {#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**

:::codeGroup{syncKey="lang"}
```bash title="cURL"
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"}'
```
```python title="Python"
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 once
```
```javascript title="Node.js"
const 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 once
```
:::

**Create a watchlist**

:::codeGroup{syncKey="lang"}
```bash title="cURL"
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"
  }'
```
```python title="Python"
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()
```
```javascript title="Node.js"
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](/reference/webhook-events#verifying-signatures) in your receiver, and read [Watchlists & pipelines](/docs/watchlists) to choose what each run reads and when you are told.

**Full reference →** [`POST /v1/products`](/reference/products#fetch-products), [`POST /v1/webhook_endpoints`](/reference/webhook-endpoints#create-webhook-endpoint), [`POST /v1/watchlists`](/reference/watchlists#create-watchlist)

---

## For AI agents

- This page for a human reader: https://scrapelyserp.com/docs/quickstart
- The whole space as one Markdown file: https://scrapelyserp.com/docs/llms-full.txt
- Live search + fetch over MCP: https://scrapelyserp.com/docs/_api/public/orgs/affc5b0f-d3c2-423a-8143-9d10db5736ae/spaces/981e6275-da3f-446c-82de-889f59c83b6f/mcp
  - Install (Claude CLI): `claude mcp add scrapely --transport http https://scrapelyserp.com/docs/_api/public/orgs/affc5b0f-d3c2-423a-8143-9d10db5736ae/spaces/981e6275-da3f-446c-82de-889f59c83b6f/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
