> Documentation index: https://docs.scrapier.io/llms.txt
> Auth: header `X-API-Key: <key>` · Base: https://api.scrapier.io/api/v2 · Synchronous; paginate with `cursor` ← `data.next_cursor`.

# Amazon Best Sellers

Get ranked products from an Amazon Best Sellers category URL, with price, rating, review count and list position.

`GET|POST https://api.scrapier.io/api/v2/amazon-bestsellers/` · 1 credit per successful call · Cursor-paginated

## Overview

Send the URL of an Amazon Best Sellers category page (it contains best-sellers or zgbs) and get the ranked products back, with ASIN, name, price, star rating, review count, list position and product URL.

Set `depth_of_crawl` above 1 to also scrape the category's subcategories.

## Use cases

- Track which products hold the top ranks in a category over time.
- Spot new entrants in a Best Sellers list for product research.
- Feed category rankings into a pricing or assortment dashboard.

## Request

```bash
curl -G "https://api.scrapier.io/api/v2/amazon-bestsellers/" \
  -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode "url=https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/" \
  --max-time 210
```

```python
import requests

resp = requests.get(
    "https://api.scrapier.io/api/v2/amazon-bestsellers/",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={"url": "https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/"},
    timeout=210,
)
body = resp.json()
if not resp.ok:
    raise RuntimeError(body.get("error") or body.get("detail"))

print(body["data"]["products"])
```

POST with a JSON body works too (same parameters; the body is merged over the query string).

## Parameters

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `X-API-Key` (header) | string | yes | — | Your API key. |
| `url` | string | yes | e.g. `https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/` | Amazon Best Sellers category URL (contains best-sellers / zgbs). Required on first call. |
| `cursor` | string | no | — | Pagination cursor returned in the previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When `next_cursor` is null, you have reached the last page. |
| `language` | string | no | — | Optional Accept-Language primary tag (e.g. en-US, de-DE) |
| `depth_of_crawl` | integer | no | `1` | 1 = main category only; 2+ = also scrape subcategories (max 5) |
| `use_proxy` | boolean | no | `true` | Route the request through Scrapier's residential proxy pool. Default: `true`. Leave as is unless support tells you otherwise. |
| `raw_data` | boolean | no | `false` | When true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under `raw_responses`, in place of the formatted items. When false (default) you get the formatted output. Pagination (`cursor` / `next_cursor`) works the same in both modes. |

## Response

HTTP 200. Results are in `data.products`. Sample from the live catalog, arrays trimmed to 3 items.

```json
{
  "success": true,
  "data": {
    "url": "https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/",
    "page": 1,
    "page_size": 30,
    "products": [
      {
        "name": "blink plus plan with monthly auto-renewal",
        "url": "https://www.amazon.com/Blink-Plus-Plan-monthly-auto-renewal/dp/B08JHCVHTY/ref=zg_bs_g_electronics_d_sccl_1/137-2485543-6844536?psc=1",
        "asin": "B08JHCVHTY",
        "position": 1,
        "price": {
          "value": 11.99,
          "currency": "$"
        },
        "number_of_offers": null,
        "stars": 4.4,
        "reviews_count": 280863,
        "thumbnail_url": "https://images-na.ssl-images-amazon.com/images/I/31YHGbJsldL._AC_UL300_SR300,200_.png",
        "category_name": "Electronics",
        "category_full_name": "Best Sellers in Electronics",
        "subcategories": [
          {
            "category_name": "Accessories & Supplies",
            "category_url": "https://www.amazon.com/Best-Sellers-Electronics-Electronics-Accessories-Supplies/zgbs/electronics/281407/ref=zg_bs_nav_electronics_1"
          },
          {
            "category_name": "Camera & Photo",
            "category_url": "https://www.amazon.com/Best-Sellers-Electronics-Camera-Photo-Products/zgbs/electronics/502394/ref=zg_bs_nav_electronics_1"
          }
        ],
        "category_url": "https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/",
        "input_url": "https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/"
      }
    ],
    "next_cursor": "eyJoIjoiM2MwODUyZjg0ZDgzIiwicCI6MiwidSI6Imh0dHBzOi8vd3d3LmFtYXpvbi5jb20vQmVzdC1TZWxsZXJzLUVsZWN0cm9uaWNzL3pnYnMvZWxlY3Ryb25pY3MvIn0"
  }
}
```

## Response fields

| Field | Type | Example | Description |
|---|---|---|---|
| `url` | string | `https://www.amazon.com/Best-Sellers-Electroni…` | Link to the product page. |
| `page` | integer | `1` |  |
| `page_size` | integer | `30` |  |
| `products` | array | `[1 item]` | The results. |
| `next_cursor` | string | `eyJoIjoiM2MwODUyZjg0ZDgzIiwicCI6MiwidSI6Imh0d…` | Pass back as `cursor` for the next page. `null` on the last page. |
| `products[].name` | string | `blink plus plan with monthly auto-renewal` |  |
| `products[].url` | string | `https://www.amazon.com/Blink-Plus-Plan-monthl…` | Link to the product page. |
| `products[].asin` | string | `B08JHCVHTY` |  |
| `products[].position` | integer | `1` | Position in the Best Sellers list, starting at 1. |
| `products[].price` | object | `{…}` | Price as an object with value and currency. |
| `products[].number_of_offers` | null | `null` |  |
| `products[].stars` | number | `4.4` | Average star rating. |
| `products[].reviews_count` | integer | `280863` |  |
| `products[].thumbnail_url` | string | `https://images-na.ssl-images-amazon.com/image…` |  |
| `products[].category_name` | string | `Electronics` | The Best Sellers category the product was listed in. |
| `products[].category_full_name` | string | `Best Sellers in Electronics` |  |
| `products[].subcategories` | array | `[2 items]` |  |
| `products[].category_url` | string | `https://www.amazon.com/Best-Sellers-Electroni…` |  |
| `products[].input_url` | string | `https://www.amazon.com/Best-Sellers-Electroni…` |  |

## Pagination

Pass `data.next_cursor` back as `cursor` until it is `null`. Required inputs are ignored once a cursor is sent. Each page is one billed call.

```python
import requests

URL = "https://api.scrapier.io/api/v2/amazon-bestsellers/"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
params = {"url": "https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/"}
items = []

for _ in range(10):  # each page is one billed call
    resp = requests.get(URL, headers=HEADERS, params=params, timeout=210)
    resp.raise_for_status()
    data = resp.json()["data"]
    items.extend(data.get("products") or [])
    if not data.get("next_cursor"):  # None = last page
        break
    params = {"cursor": data["next_cursor"]}
```

## Errors

Failed calls are free. Branch on HTTP status; the message is in `error` (or `detail`). See https://docs.scrapier.io/errors.md

- **400** Bad input. The exact message varies by endpoint. `{"success":false,"error":"…"}`
- **402** Balance below the endpoint's price. `{"error":"Insufficient credits. Buy more to scrape more.","balance":1,"required":2}`
- **403** Invalid or unknown API key. `{"detail":"Authentication service unavailable or invalid API key."}`
- **429** Throttled — wait for Retry-After. `{"detail":"Request was throttled. Expected available in N seconds."}`
- **404** unknown slug · **503** busy (retry after `Retry-After`) · **5xx** upstream failure or timeout (retry with backoff).

## Notes

- `url` must be a Best Sellers category URL, not a search or product URL.
- `depth_of_crawl` is 1 for the main category only; 2 or more also scrapes subcategories (max 5).
- `language` takes an Accept-Language tag such as en-US or de-DE.

## Related

- [Amazon Search](https://docs.scrapier.io/api-reference/amazon/amazon-search.md): Search Amazon by keyword and get product results with price, rating and position, with marketplace and sort order options.
- [Amazon Today's Deals](https://docs.scrapier.io/api-reference/amazon/amazon-todays-deals.md): List Amazon's current deals with price, price before the discount, savings, rating and review count. Filters are optional.
- [Amazon Products](https://docs.scrapier.io/api-reference/amazon/amazon-product.md): Search Amazon by keyword or URL and get product listings, or send a product URL to get that single product.
