Amazon Best Sellers
Get ranked products from an Amazon Best Sellers category URL, with price, rating, review count and list position.
Overview
Section titled “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
Section titled “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
Section titled “Request”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 210const params = new URLSearchParams({ url: "https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/" });
const res = await fetch(`https://api.scrapier.io/api/v2/amazon-bestsellers/?${params}`, { headers: { "X-API-Key": "YOUR_API_KEY" }, signal: AbortSignal.timeout(210_000),});const body = await res.json();if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`);
console.log(body.data.products);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"])curl -X POST "https://api.scrapier.io/api/v2/amazon-bestsellers/" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/"}' \ --max-time 210Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
X-API-Key header | string | yes | — | Your API key from the dashboard. |
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) |
Advanced
| Name | Type | Default | Description |
|---|---|---|---|
use_proxy | boolean | true | Route the request through Scrapier's residential proxy pool. Default: true. Leave as is unless support tells you otherwise. |
raw_data | boolean | 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
Section titled “Response”{ "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" }}Bad input. The exact message varies by endpoint.
{ "success": false, "error": "…"}Balance below the endpoint’s price.
{ "error": "Insufficient credits. Buy more to scrape more.", "balance": 1, "required": 2}Invalid or unknown API key.
{ "detail": "Authentication service unavailable or invalid API key."}Throttled — wait for Retry-After.
{ "detail": "Request was throttled. Expected available in N seconds."}Sample from the live catalog; arrays trimmed to 3 items. Results are in data.products.
Response fields
Section titled “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
Section titled “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. More in Pagination.
const url = "https://api.scrapier.io/api/v2/amazon-bestsellers/";let params = { url: "https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/" };const items = [];
for (let page = 0; page < 10; page++) { // each page is one billed call const res = await fetch(`${url}?${new URLSearchParams(params)}`, { headers: { "X-API-Key": "YOUR_API_KEY" }, signal: AbortSignal.timeout(210_000), }); const body = await res.json(); if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`); const data = body.data; items.push(...(data.products ?? [])); if (!data.next_cursor) break; // null = last page params = { cursor: data.next_cursor };}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
Section titled “Errors”Failed calls are free. Branch on the HTTP status and read the message from error (or detail). Full details in Errors.
| Status | Meaning | Retry? | Charged? |
|---|---|---|---|
400 | Bad or missing input. | No — fix the params | No |
401 / 403 | Missing, invalid or revoked API key. | No — fix the key | No |
402 | Out of credits (body has balance). | No — top up | No |
404 | Unknown endpoint slug. | No — check the slug | No |
429 / 503 | Busy or throttled. | Yes — after Retry-After | No |
5xx | Target site or upstream failure, or timeout. | Yes — with backoff | No |
urlmust be a Best Sellers category URL, not a search or product URL.depth_of_crawlis 1 for the main category only; 2 or more also scrapes subcategories (max 5).languagetakes an Accept-Language tag such as en-US or de-DE.
Related
Section titled “Related”- Amazon Search — Search Amazon by keyword and get product results with price, rating and position, with marketplace and sort order options.
- Amazon Today’s Deals — List Amazon’s current deals with price, price before the discount, savings, rating and review count. Filters are optional.
- Amazon Products — Search Amazon by keyword or URL and get product listings, or send a product URL to get that single product.