{
  "openapi": "3.0.1",
  "info": {
    "title": "⚠️ DEPRECATED - TikTok Shop Scraper V3 → Use V4 Instead",
    "description": "⚠️ DEPRECATED: Use the new Python V4 version instead (alizarin_refrigerator-owner/tiktok-shop-scraper-v4). V4 has better anti-detection, SadCaptcha captcha solving, 9 regions, incremental data push, price tracking, and PPE pricing.",
    "version": "1.0",
    "x-build-id": "UaivvAJOJiuLMAlnX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alizarin_refrigerator-owner~tiktok-shop-scraper-v3/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alizarin_refrigerator-owner-tiktok-shop-scraper-v3",
        "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/alizarin_refrigerator-owner~tiktok-shop-scraper-v3/runs": {
      "post": {
        "operationId": "runs-sync-alizarin_refrigerator-owner-tiktok-shop-scraper-v3",
        "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/alizarin_refrigerator-owner~tiktok-shop-scraper-v3/run-sync": {
      "post": {
        "operationId": "run-sync-alizarin_refrigerator-owner-tiktok-shop-scraper-v3",
        "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": "Scraping Mode",
            "enum": [
              "basic",
              "full",
              "intelligence"
            ],
            "type": "string",
            "description": "Choose the level of data extraction. Basic = product info only. Full = includes variants, stock, video links. Intelligence = includes price history, competitor comparison, trend analysis.",
            "default": "basic"
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Keywords to search for products on TikTok Shop (e.g., 'shampoo', 'wireless earbuds'). Leave empty if using clickCategories.",
            "items": {
              "type": "string"
            }
          },
          "clickCategories": {
            "title": "Browse Categories (Click-based)",
            "type": "array",
            "description": "RECOMMENDED: Browse TikTok Shop categories by clicking. Examples: 'Beauty', 'Electronics', 'Fashion', 'Home'. Has best success rate.",
            "items": {
              "type": "string"
            }
          },
          "productUrls": {
            "title": "Product URLs",
            "type": "array",
            "description": "Direct TikTok Shop product URLs to scrape",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "shopUrls": {
            "title": "Shop/Seller URLs",
            "type": "array",
            "description": "TikTok Shop seller profile URLs to scrape all products from",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxProducts": {
            "title": "Max Products",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of products to scrape per run",
            "default": 50
          },
          "region": {
            "title": "Region",
            "enum": [
              "US",
              "UK",
              "DE",
              "FR",
              "ES",
              "IT",
              "ID",
              "MY",
              "PH",
              "SG",
              "TH",
              "VN"
            ],
            "type": "string",
            "description": "TikTok Shop region - affects currency, price formatting, and available products. Southeast Asian markets often have better success rates.",
            "default": "US"
          },
          "enablePriceHistory": {
            "title": "Enable Price History Tracking",
            "type": "boolean",
            "description": "Track price changes over time. Compares current prices with data from previous runs (stored in named dataset). Enables price drop alerts.",
            "default": false
          },
          "priceHistoryDatasetId": {
            "title": "Price History Dataset ID",
            "type": "string",
            "description": "Optional: Dataset ID to use for price history. Leave empty to auto-create. Use same ID across runs to build history."
          },
          "priceDropThreshold": {
            "title": "Price Drop Alert Threshold (%)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Generate alert when price drops by this percentage or more",
            "default": 10
          },
          "priceIncreaseThreshold": {
            "title": "Price Increase Alert Threshold (%)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Generate alert when price increases by this percentage or more",
            "default": 20
          },
          "enableSellerAnalytics": {
            "title": "Enable Deep Seller Analytics",
            "type": "boolean",
            "description": "Extract comprehensive seller data: total products, category breakdown, average ratings, response rate, followers, top-selling items.",
            "default": false
          },
          "maxSellersToAnalyze": {
            "title": "Max Sellers to Analyze",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Limit seller deep analysis to this many unique sellers (most active first)",
            "default": 10
          },
          "enableVideoLinks": {
            "title": "Enable TikTok Video Extraction",
            "type": "boolean",
            "description": "Extract associated TikTok video URLs for products (great for influencer research)",
            "default": false
          },
          "enableVariants": {
            "title": "Enable Product Variant Scraping",
            "type": "boolean",
            "description": "Extract all product variants (sizes, colors, styles) with individual prices and stock status",
            "default": false
          },
          "enableCategoryMapping": {
            "title": "Enable Category Tree Mapping",
            "type": "boolean",
            "description": "Build a complete category hierarchy with product counts and average prices per category",
            "default": false
          },
          "enableCompetitorComparison": {
            "title": "Enable Competitor Comparison",
            "type": "boolean",
            "description": "Find and compare similar products from different sellers (same/similar title, different shop)",
            "default": false
          },
          "competitorSearchDepth": {
            "title": "Competitor Search Depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many competitor products to find per original product",
            "default": 3
          },
          "enableStockLevels": {
            "title": "Enable Stock Level Indicators",
            "type": "boolean",
            "description": "Detect stock status: 'In Stock', 'Low Stock', 'Selling Fast', 'Out of Stock'",
            "default": true
          },
          "enableTrendAnalysis": {
            "title": "Enable AI Trend Analysis",
            "type": "boolean",
            "description": "Use AI to analyze product/category trends, predict demand, identify rising products (requires AI API key)",
            "default": false
          },
          "includeReviews": {
            "title": "Include Reviews",
            "type": "boolean",
            "description": "Scrape product reviews (increases run time)",
            "default": false
          },
          "maxReviewsPerProduct": {
            "title": "Max Reviews Per Product",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum reviews to scrape per product",
            "default": 10
          },
          "demoMode": {
            "title": "Demo Mode",
            "type": "boolean",
            "description": "Return labeled sample data for testing (no scraping, no task-event charges). Uncheck to run a real scrape. API callers who omit this field always get a real run.",
            "default": false
          },
          "useCamoufox": {
            "title": "Use Camoufox Anti-Detection",
            "type": "boolean",
            "description": "Enable Camoufox browser fingerprint randomization. HIGHLY RECOMMENDED.",
            "default": true
          },
          "useMobileSafari": {
            "title": "Emulate Mobile Safari (iOS)",
            "type": "boolean",
            "description": "HIGHLY RECOMMENDED: Emulate iPhone Safari browser for best success rates.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. RESIDENTIAL proxies are STRONGLY RECOMMENDED.",
            "default": {
              "useApifyProxy": true
            }
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "URL to send results to when scraping completes (Zapier, Make, n8n compatible)"
          },
          "priceAlertWebhook": {
            "title": "Price Alert Webhook URL",
            "type": "string",
            "description": "Separate webhook for price drop/increase alerts (real-time notifications)"
          },
          "aiProvider": {
            "title": "AI Provider",
            "enum": [
              "none",
              "openai",
              "anthropic",
              "google"
            ],
            "type": "string",
            "description": "Which AI provider to use for trend analysis and sentiment",
            "default": "none"
          },
          "aiApiKey": {
            "title": "AI API Key",
            "type": "string",
            "description": "API key for your chosen AI provider"
          },
          "enableCaptchaSolving": {
            "title": "Enable CAPTCHA Solving",
            "type": "boolean",
            "description": "Automatically solve CAPTCHAs using 2Captcha service. Recommended for regions with high block rates (DE, FR, US).",
            "default": false
          },
          "twoCaptchaApiKey": {
            "title": "2Captcha API Key (NOT for TikTok)",
            "type": "string",
            "description": "Your 2Captcha.com API key. NOTE: 2Captcha does NOT support TikTok captchas. Use SadCaptcha instead."
          },
          "sadCaptchaApiKey": {
            "title": "SadCaptcha API Key (RECOMMENDED for TikTok)",
            "type": "string",
            "description": "Your SadCaptcha.com API key. HIGHLY RECOMMENDED - specialized for TikTok puzzle/rotate/shapes captchas. 100% puzzle accuracy. Get one at https://sadcaptcha.com (~$0.002/solve)"
          },
          "useAiCaptchaSolver": {
            "title": "Use AI Vision for Image CAPTCHAs",
            "type": "boolean",
            "description": "Use your AI provider (OpenAI/Claude/Gemini) to solve simple image-based CAPTCHAs. Requires AI API key above.",
            "default": false
          },
          "useFirecrawl": {
            "title": "Use Firecrawl API",
            "type": "boolean",
            "description": "Use Firecrawl API for scraping instead of browser. Can bypass some blocks but may have different data quality.",
            "default": false
          },
          "firecrawlApiKey": {
            "title": "Firecrawl API Key",
            "type": "string",
            "description": "Your Firecrawl API key. Get one at https://firecrawl.dev"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}