{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Best Sellers Scraper — Category Rank Charts & ASIN",
    "description": "Amazon Best Sellers scraper for category rank charts: Best Sellers, New Releases, Movers & Shakers, Most Wished For, Gift Ideas. Rank #1–100, ASIN, title, price, ratings across 20+ marketplaces. Multi-country batch, ASIN watch, full ranked payload.",
    "version": "0.2",
    "x-build-id": "IkTAFVQKz1mbmNhZF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~amazon-bestsellers-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-amazon-bestsellers-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/crawloop~amazon-bestsellers-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-amazon-bestsellers-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/crawloop~amazon-bestsellers-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-amazon-bestsellers-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "categories": {
            "title": "Category slugs",
            "type": "array",
            "description": "Best Sellers category slugs as they appear in the chart URL (e.g. electronics, kitchen, books). Slugs are marketplace-specific — on Amazon.de 'electronics' is auto-remapped to 'computers' when applyCategoryRemap is on. Leave empty only when startUrls are provided.",
            "items": {
              "type": "string"
            }
          },
          "charts": {
            "title": "Charts",
            "type": "array",
            "description": "Which Amazon rank charts to scrape for each category. Categories × charts × countries are crossed.",
            "items": {
              "type": "string",
              "enum": [
                "bestsellers",
                "new-releases",
                "movers-and-shakers",
                "most-wished-for",
                "gift-ideas"
              ],
              "enumTitles": [
                "Best Sellers",
                "New Releases",
                "Movers & Shakers",
                "Most Wished For",
                "Gift Ideas"
              ]
            },
            "default": [
              "bestsellers"
            ]
          },
          "country": {
            "title": "Marketplace country",
            "enum": [
              "US",
              "GB",
              "DE",
              "FR",
              "IT",
              "ES",
              "CA",
              "AU",
              "JP",
              "IN",
              "BR",
              "MX",
              "NL",
              "SE",
              "PL",
              "BE",
              "SA",
              "AE",
              "ZA",
              "IE",
              "SG",
              "TR",
              "EG"
            ],
            "type": "string",
            "description": "Single marketplace country code. Ignored when countries is set. Controls domain, currency, and default proxy geo.",
            "default": "US"
          },
          "countries": {
            "title": "Marketplace countries (batch)",
            "type": "array",
            "description": "Scrape the same categories/charts across multiple marketplaces in one run. Proxy geo rotates per country. Example: [\"US\",\"DE\",\"GB\"].",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Chart URLs (optional)",
            "type": "array",
            "description": "Paste full chart URLs such as https://www.amazon.com/gp/bestsellers/electronics/ or /zgbs/ paths. Marketplace is taken from the URL host when present.",
            "items": {
              "type": "string"
            }
          },
          "watchAsins": {
            "title": "Watch ASINs (rank tracking)",
            "type": "array",
            "description": "ASINs to track in the scraped charts. Matching rows get watched=true. Missing ASINs can emit watch_miss rows (foundInChart=false) for schedule-friendly rank monitoring.",
            "items": {
              "type": "string"
            }
          },
          "watchOnly": {
            "title": "Watch-only output",
            "type": "boolean",
            "description": "When watchAsins is set, only push matching chart rows (plus optional miss rows). Full chart dump is skipped.",
            "default": false
          },
          "emitWatchMisses": {
            "title": "Emit missing watch ASINs",
            "type": "boolean",
            "description": "When watchAsins is set, emit one row per ASIN not found in each chart target (detailLevel=watch_miss, rank=null).",
            "default": true
          },
          "maxItemsPerChart": {
            "title": "Max items per chart",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Amazon publishes at most 100 products per chart (2 pages of 50). Use 50 for the first page only.",
            "default": 100
          },
          "maxItems": {
            "title": "Max items (run cap)",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap across the whole run. 0 = unlimited (still capped by maxItemsPerChart × targets).",
            "default": 0
          },
          "fetchMissingDetails": {
            "title": "Fetch missing product details",
            "type": "boolean",
            "description": "Amazon hydrates only ~30 of 50 cards per chart page. When enabled, product pages are fetched for rank-only/partial rows to fill title, price, rating, and image.",
            "default": false
          },
          "skipIncompleteRows": {
            "title": "Skip rank-only rows",
            "type": "boolean",
            "description": "Drop rows that only have rank + ASIN (no title/price). Prefer leaving this off so chart ranks stay contiguous.",
            "default": false
          },
          "applyCategoryRemap": {
            "title": "Auto-remap known category slugs",
            "type": "boolean",
            "description": "When enabled, known marketplace mismatches are remapped (e.g. DE electronics → computers).",
            "default": true
          },
          "continueOnError": {
            "title": "Continue on target errors",
            "type": "boolean",
            "description": "If one category/country/chart fails (wrong slug, empty chart, block), continue with remaining targets. Errors are logged and saved to TARGET_ERRORS key-value record.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy settings. Residential proxies are strongly recommended. For multi-country runs, geo is rotated per marketplace automatically when apifyProxyCountry is left empty.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}