{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Best Sellers Scraper",
    "description": "Scrape Amazon Best Sellers rankings by category from Amazon.in (and other marketplaces). Extracts rank, title, ASIN, price, rating, reviews, and optionally full product details.",
    "version": "1.1",
    "x-build-id": "Z61A621ZZYfW369QB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codingfrontend~amazon-bestsellers-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codingfrontend-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/codingfrontend~amazon-bestsellers-scraper/runs": {
      "post": {
        "operationId": "runs-sync-codingfrontend-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/codingfrontend~amazon-bestsellers-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-codingfrontend-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "category",
              "categoryUrl",
              "productUrl"
            ],
            "type": "string",
            "description": "Scraping mode: category uses a marketplace-relative category slug, categoryUrl uses a direct Best Sellers URL, and productUrl uses direct product URLs.",
            "default": "category"
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Best Sellers category slug used when mode is category.",
            "default": "electronics"
          },
          "categoryUrl": {
            "title": "Category URL",
            "type": "string",
            "description": "Direct public Amazon Best Sellers category or subcategory URL used when mode is categoryUrl."
          },
          "productUrls": {
            "title": "Product URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Public Amazon product page URLs used when mode is productUrl.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "default": []
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of product records to save, excluding access diagnostics.",
            "default": 50
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of Best Sellers pages to follow in category modes.",
            "default": 2
          },
          "deepSearch": {
            "title": "Deep Search",
            "type": "boolean",
            "description": "Visit each selected product detail page for additional public product information.",
            "default": false
          },
          "extractReviews": {
            "title": "Extract Reviews",
            "type": "boolean",
            "description": "Extract up to 10 visible public customer reviews per product when deepSearch is enabled.",
            "default": false
          },
          "includeMedia": {
            "title": "Include Media",
            "type": "boolean",
            "description": "Include product gallery, high-resolution image, and A+ media fields in deep-search records. The primary thumbnail remains available.",
            "default": true
          },
          "includeTechnicalDetails": {
            "title": "Include Technical Details",
            "type": "boolean",
            "description": "Include technical attributes and product-overview rows in deep-search records.",
            "default": true
          },
          "country": {
            "title": "Amazon Marketplace",
            "enum": [
              "in",
              "com",
              "co.uk",
              "de",
              "co.jp",
              "ca",
              "com.au",
              "com.br"
            ],
            "type": "string",
            "description": "Amazon marketplace suffix to scrape.",
            "default": "in"
          },
          "locale": {
            "title": "Locale",
            "enum": [
              "en-IN",
              "en-US",
              "en-GB",
              "de-DE",
              "ja-JP",
              "fr-CA",
              "en-AU",
              "pt-BR"
            ],
            "type": "string",
            "description": "Accept-Language locale sent with public Amazon requests.",
            "default": "en-IN"
          },
          "filters": {
            "title": "Filters",
            "required": [],
            "type": "object",
            "description": "Optional filters applied before records are saved.",
            "properties": {
              "minRating": {
                "title": "Minimum Rating",
                "type": "number",
                "description": "Keep products with at least this rating out of 5.",
                "minimum": 0,
                "maximum": 5
              },
              "minReviewsCount": {
                "title": "Minimum Reviews",
                "type": "integer",
                "description": "Keep products with at least this many reviews.",
                "minimum": 0
              },
              "minPrice": {
                "title": "Minimum Price",
                "type": "number",
                "description": "Keep products whose current price is at least this marketplace-local amount.",
                "minimum": 0
              },
              "maxPrice": {
                "title": "Maximum Price",
                "type": "number",
                "description": "Keep products whose current price is at most this marketplace-local amount.",
                "minimum": 0
              },
              "includePrimeOnly": {
                "title": "Prime Only",
                "type": "boolean",
                "description": "Keep only listing cards that expose a public Prime badge.",
                "default": false
              },
              "includeKeywords": {
                "title": "Include Keywords",
                "type": "array",
                "description": "Keep products whose title, brand, or category contains at least one keyword.",
                "items": {
                  "type": "string"
                },
                "editor": "stringList",
                "default": []
              },
              "excludeKeywords": {
                "title": "Exclude Keywords",
                "type": "array",
                "description": "Discard products whose title, brand, or category contains any keyword.",
                "items": {
                  "type": "string"
                },
                "editor": "stringList",
                "default": []
              }
            },
            "default": {},
            "additionalProperties": false
          },
          "deduplicate": {
            "title": "Deduplicate Products",
            "type": "boolean",
            "description": "Avoid saving repeated ASINs or product URLs across pages, inputs, and fallback paths.",
            "default": true
          },
          "minDelayMs": {
            "title": "Minimum Delay (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Bounded pacing delay between serialized direct public requests.",
            "default": 500
          },
          "maxDelayMs": {
            "title": "Maximum Delay (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Maximum randomized pacing delay between serialized public requests.",
            "default": 1500
          },
          "maxRetries": {
            "title": "Max Retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum bounded retries per public request. A fresh proxy URL is used for each attempt when proxying.",
            "default": 2
          },
          "navigationTimeoutMs": {
            "title": "Navigation Timeout (ms)",
            "minimum": 5000,
            "maximum": 180000,
            "type": "integer",
            "description": "Maximum time allowed for each direct public HTTP request.",
            "default": 60000
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "required": [],
            "type": "object",
            "description": "Proxy settings used for public Amazon requests. Residential proxying is the reliability default.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            },
            "additionalProperties": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}