{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Product Scraper - Prices, ASIN, BSR & Reviews",
    "description": "Get Amazon prices by ASIN from searches or product URLs. Export prices, currency, ratings and stock signals. Detail pages can include technical specifications such as model number or dimensions. Optional BSR tracks category ranks. Fees apply to run starts, products, dataset rows and optional events.",
    "version": "2.2",
    "x-build-id": "bQ4WcwFaQBDpTUEHv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/harvestlab~amazon-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-harvestlab-amazon-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/harvestlab~amazon-scraper/runs": {
      "post": {
        "operationId": "runs-sync-harvestlab-amazon-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/harvestlab~amazon-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-harvestlab-amazon-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": {
          "searchQuery": {
            "title": "Amazon product search keywords",
            "type": "string",
            "description": "Search keyword(s) to find products on Amazon (e.g., 'iPhone 15 Pro', 'mechanical keyboard', 'air fryer')."
          },
          "keywordAsins": {
            "title": "ASINs to keep from the keyword search",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Optional fixed list for keyword searches. Enter 1–100 distinct uppercase ASINs. The Actor saves only matching cards within the page and product limits. Saved matching cards can be billed even if a price is unavailable. Leave both keyword options out for broad discovery or direct URLs.",
            "items": {
              "type": "string",
              "pattern": "^[A-Z0-9]{10}$"
            }
          },
          "keywordScanPages": {
            "title": "Maximum search pages for matching ASINs",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Set 1–3 search pages when keywordAsins is supplied. If omitted, the Actor checks at most one page. It stops sooner when the requested product count is met or search cannot continue."
          },
          "query": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for searchQuery. Hidden from Console form."
          },
          "q": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for searchQuery. Hidden from Console form."
          },
          "search": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for searchQuery. Hidden from Console form."
          },
          "keyword": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for searchQuery. Hidden from Console form."
          },
          "searchTerm": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for searchQuery. Hidden from Console form."
          },
          "productUrls": {
            "title": "Amazon product URLs or 10-character ASINs",
            "type": "array",
            "description": "Enter 10-character ASINs or full Amazon product URLs. An ASIN uses the selected marketplace. Use the full URL to keep seller or offer parameters. This field takes precedence over the search query.",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "Product URLs (CLI alias)",
            "type": "array",
            "description": "CLI alias for productUrls. Hidden from Console form.",
            "items": {
              "type": "string"
            }
          },
          "links": {
            "title": "Product URLs (CLI alias)",
            "type": "array",
            "description": "CLI alias for productUrls. Hidden from Console form.",
            "items": {
              "type": "string"
            }
          },
          "amazonDomain": {
            "title": "Amazon marketplace",
            "enum": [
              "amazon.com",
              "amazon.ca",
              "amazon.com.mx",
              "amazon.com.br",
              "amazon.co.uk",
              "amazon.de",
              "amazon.fr",
              "amazon.es",
              "amazon.it",
              "amazon.nl",
              "amazon.pl",
              "amazon.se",
              "amazon.co.jp",
              "amazon.in",
              "amazon.com.au",
              "amazon.ae",
              "amazon.sa",
              "amazon.sg",
              "amazon.com.tr"
            ],
            "type": "string",
            "description": "Which Amazon country marketplace to scrape. Different marketplaces have different ASINs, pricing in local currency, and product availability.",
            "default": "amazon.com"
          },
          "domain": {
            "title": "Amazon Domain (CLI alias)",
            "type": "string",
            "description": "CLI alias for amazonDomain. Hidden from Console form."
          },
          "country_domain": {
            "title": "Amazon Domain (CLI alias)",
            "type": "string",
            "description": "CLI alias for amazonDomain. Hidden from Console form."
          },
          "maxProducts": {
            "title": "Maximum products to return",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of products to scrape. Amazon shows ~20 per search page. Start with 10 to test before running larger jobs. Capped at 100 for PPE bill safety.",
            "default": 10
          },
          "maxItems": {
            "title": "Max Items (alias for Max Products)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Alternative name for Max Products - accepts the same values. Use either maxProducts or maxItems."
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "relevance",
              "price_low",
              "price_high",
              "avg_review",
              "newest"
            ],
            "type": "string",
            "description": "Sort order for search results. 'Relevance' (default) is Amazon's algorithmic ranking mixing sales, reviews, and keyword match. 'Price Low/High' sorts by current list price. 'Avg. Customer Review' ranks by star rating (biased toward items with many reviews). 'Newest Arrivals' surfaces recently listed products - best for trend-spotting but noisy. Only applies when using a search query, not direct product URLs.",
            "default": "relevance"
          },
          "fetchDetails": {
            "title": "Get product details and Best Sellers Rank",
            "type": "boolean",
            "description": "Fetch individual product detail pages to enrich results with brand, availability, description, features, and seller info. Adds ~2-3s per product but significantly improves data quality. Keep false for fast search-page-only first runs.",
            "default": false
          },
          "includeDetails": {
            "title": "Include Product Details (alias)",
            "type": "boolean",
            "description": "CLI alias for fetchDetails. Hidden from Console form."
          },
          "trackBestsellerRank": {
            "title": "Monitor Amazon Best Sellers Rank (BSR)",
            "type": "boolean",
            "description": "Save positive BSR observations with a known Amazon category and compare ranks for the same ASIN and category. A category change starts a fresh baseline. Forces fetchDetails=true. Each ASIN saved in the BSR history adds the `rank-tracked` charge ($0.01) to the product charge. Optional AI rank analysis uses saved comparable observations.",
            "default": false
          },
          "alertWebhookUrl": {
            "title": "BSR Alert Webhook URL (optional)",
            "type": "string",
            "description": "Send a POST when a saved BSR observation changes by at least the threshold in the same category. Uses a 5-second timeout and one retry. Setting a URL enables trackBestsellerRank. Each successful delivery adds an `alert-dispatched` charge ($0.002). Leave empty to disable."
          },
          "outputConnectors": {
            "title": "MCP Output Connectors",
            "maxItems": 5,
            "uniqueItems": true,
            "type": "array",
            "description": "Optional MCP connectors for BSR rank alerts. Choose Slack, Notion, GitHub, Sheets, CRM, or another compatible connector. When a rank alert qualifies, the actor sends a compact message plus structured payload through each connector. Connector failures never fail the scrape. Billed at $0.002 per successful connector dispatch."
          },
          "connectorAlertTarget": {
            "title": "Connector Target",
            "type": "string",
            "description": "Optional connector destination such as a Slack channel, Notion database ID, sheet name, table, or CRM list. Leave empty when the selected connector already has a default target."
          },
          "alertRankThreshold": {
            "title": "BSR Alert Rank Threshold",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Minimum absolute rank_change required to fire a webhook. Default 50 means a climb from #200 to #150 (or a drop from #100 to #151) triggers an alert. Lower = more alerts, higher = noisier movers only. Only applies when alertWebhookUrl is set.",
            "default": 50
          },
          "enableAiAnalysis": {
            "title": "Enable AI Analysis",
            "type": "boolean",
            "description": "Run AI-powered competitive pricing analysis on scraped products. Hosted providers require your own API key; their charges are separate from Actor fees and depend on model and token usage. When Track Best Sellers Rank is also ON, the AI switches to a rank-movement report (narrates why products are climbing/falling) instead of the default pricing analysis.",
            "default": false
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openrouter",
              "anthropic",
              "google",
              "openai",
              "ollama"
            ],
            "type": "string",
            "description": "Which AI provider to use for analysis.",
            "default": "openrouter"
          },
          "openrouterApiKey": {
            "title": "OpenRouter API Key",
            "type": "string",
            "description": "API key for OpenRouter (required if LLM Provider = OpenRouter). Get one at https://openrouter.ai/keys. Or set the OPENROUTER_API_KEY env var on the actor."
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key",
            "type": "string",
            "description": "API key for Anthropic Claude (required if LLM Provider = Anthropic). Get one at https://console.anthropic.com/settings/keys. Or set the ANTHROPIC_API_KEY env var on the actor."
          },
          "googleApiKey": {
            "title": "Google AI API Key",
            "type": "string",
            "description": "API key for Google AI / Gemini (required if LLM Provider = Google AI). Get one at https://aistudio.google.com/app/apikey. Or set the GOOGLE_API_KEY env var on the actor."
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "API key for OpenAI (required if LLM Provider = OpenAI). Get one at https://platform.openai.com/api-keys. Or set the OPENAI_API_KEY env var on the actor."
          },
          "ollamaBaseUrl": {
            "title": "Ollama Base URL",
            "type": "string",
            "description": "Base URL for a self-hosted Ollama server (only used if LLM Provider = Ollama). Default: http://localhost:11434. Install Ollama at https://ollama.com/download."
          },
          "llmModel": {
            "title": "LLM Model",
            "type": "string",
            "description": "Specific model to use. Leave empty for the provider default (google/gemini-3.8-flash for OpenRouter, claude-sonnet-5-5 for Anthropic, gemini-3.8-flash for Google AI, gpt-4o-mini for OpenAI, llama3.1 for Ollama)."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. Residential proxies recommended for Amazon. Tip: for consistent pricing/currency, match the proxy country to your target amazonDomain (e.g. `apifyProxyCountry=US` for amazon.com, `DE` for amazon.de, `JP` for amazon.co.jp) - Amazon localizes prices by visitor IP."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}