{
  "openapi": "3.0.1",
  "info": {
    "title": "Trustpilot Review Scraper - AI Reputation Monitor",
    "description": "Trustpilot review scraper for reputation monitoring: reviews, ratings, owner replies, AI sentiment/topics, rating-drop tracking, probe-mode block diagnostics, and user-controlled bypass hooks. Experimental anti-bot tier. x402-ready PPE at $0.003/review.",
    "version": "1.7",
    "x-build-id": "kNYK5TgYnNU52dDE3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/harvestlab~trustpilot-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-harvestlab-trustpilot-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~trustpilot-scraper/runs": {
      "post": {
        "operationId": "runs-sync-harvestlab-trustpilot-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~trustpilot-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-harvestlab-trustpilot-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": {
          "businessUrls": {
            "title": "Trustpilot Business URLs",
            "type": "array",
            "description": "One or more Trustpilot business review page URLs (e.g. https://www.trustpilot.com/review/amazon.com, https://www.trustpilot.com/review/revolut.com, https://uk.trustpilot.com/review/booking.com). Each URL points to a company's reviews page on Trustpilot.",
            "items": {
              "type": "string"
            }
          },
          "companyDomain": {
            "title": "Company Domain (alternative)",
            "type": "string",
            "description": "Shortcut for Business URLs — enter just the company domain (e.g. 'amazon.com', 'revolut.com', 'booking.com') and the actor builds the Trustpilot URL automatically."
          },
          "businessUrl": {
            "title": "Business URL (CLI alias)",
            "type": "string",
            "description": "CLI alias for businessUrls (single URL). Hidden from Console form."
          },
          "url": {
            "title": "URL (CLI alias)",
            "type": "string",
            "description": "CLI alias for businessUrls (single URL). Hidden from Console form."
          },
          "businessDomain": {
            "title": "Business Domain (CLI alias)",
            "type": "string",
            "description": "CLI alias for companyDomain. Hidden from Console form."
          },
          "domain": {
            "title": "Domain (CLI alias)",
            "type": "string",
            "description": "CLI alias for companyDomain. Hidden from Console form."
          },
          "maxReviews": {
            "title": "Max Reviews per Business",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of reviews to scrape per business (1-500). Typical values: 50 (quick sample), 100 (balanced), 300 (deep analysis). More reviews = better AI analysis but higher runtime and cost.",
            "default": 50
          },
          "maxItems": {
            "title": "Max Items (CLI alias)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "CLI alias for maxReviews. Hidden from Console form."
          },
          "language": {
            "title": "Analysis Language",
            "enum": [
              "English",
              "Dutch",
              "German",
              "French",
              "Spanish",
              "Italian",
              "Portuguese"
            ],
            "type": "string",
            "description": "Language for the AI analysis output (reviews themselves can be in any language — the AI translates as needed).",
            "default": "English"
          },
          "analysisDepth": {
            "title": "Analysis Depth",
            "enum": [
              "quick",
              "standard",
              "deep"
            ],
            "type": "string",
            "description": "How detailed the AI analysis should be. Quick = executive summary only (fastest, cheapest). Standard = themes + sentiment breakdown. Deep = full competitive intelligence report with recommendations.",
            "default": "standard"
          },
          "enableAiAnalysis": {
            "title": "Enable AI Analysis",
            "type": "boolean",
            "description": "Generate an AI-powered reputation report with sentiment scoring, top complaints, and competitive insights from the collected reviews. Requires an LLM API key for your chosen provider.",
            "default": false
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openrouter",
              "anthropic",
              "google",
              "openai",
              "ollama"
            ],
            "type": "string",
            "description": "Which LLM provider to use for AI analysis. 'openrouter' supports many cheap models (Gemini Flash, Llama, etc.), 'anthropic' uses Claude directly.",
            "default": "openrouter"
          },
          "llmModel": {
            "title": "LLM Model (optional)",
            "type": "string",
            "description": "Specific model to use. Leave empty for the provider default (google/gemini-2.0-flash-001 for OpenRouter, claude-sonnet-4-20250514 for Anthropic, gemini-2.0-flash for Google AI, gpt-4o-mini for OpenAI, llama3.1 for Ollama)."
          },
          "openrouterApiKey": {
            "title": "OpenRouter API Key",
            "type": "string",
            "description": "OpenRouter API key for AI analysis. Set OPENROUTER_API_KEY env var OR openrouterApiKey input. Get one at https://openrouter.ai/keys."
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key",
            "type": "string",
            "description": "Anthropic API key for AI analysis. Set ANTHROPIC_API_KEY env var OR anthropicApiKey input. Get one at https://console.anthropic.com/settings/keys."
          },
          "googleApiKey": {
            "title": "Google AI API Key",
            "type": "string",
            "description": "Google AI API key for Gemini analysis. Set GOOGLE_API_KEY env var OR googleApiKey input. Get one at https://aistudio.google.com/app/apikey."
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "OpenAI API key for AI analysis. Set OPENAI_API_KEY env var OR openaiApiKey input. Get one at https://platform.openai.com/api-keys."
          },
          "ollamaBaseUrl": {
            "title": "Ollama Base URL",
            "type": "string",
            "description": "Ollama base URL for self-hosted analysis. Set ollamaBaseUrl input or run Ollama locally. Install at https://ollama.com/download. Default: http://localhost:11434"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. Trustpilot aggressively blocks datacenter IPs with 403 errors - Apify residential proxy is strongly recommended."
          },
          "mode": {
            "title": "Run Mode",
            "enum": [
              "scrape",
              "probe"
            ],
            "type": "string",
            "description": "'scrape' (default) runs the full scrape + AI pipeline. 'probe' performs a single lightweight health-check fetch against the first URL and records the outcome to the 7-day rolling success-rate telemetry - useful for pipelines that want to pre-check the Cloudflare wall state before paying for a batch. Probe runs are charged at $0.0005 via the probe-completed event.",
            "default": "scrape"
          },
          "useProxyBypass": {
            "title": "Anti-Bot Bypass Provider",
            "enum": [
              "off",
              "auto",
              "scrapingbee",
              "brightdata-unlocker",
              "apify-scraping"
            ],
            "type": "string",
            "description": "Route Trustpilot fetches through a commercial anti-bot bypass service. 'auto' picks the first provider with an API key configured. 'off' (default) uses only the built-in curl_cffi fingerprint rotation. NOTE: providers are schema-stable placeholders - ScrapingBee and Bright Data Web Unlocker execute real API calls when credentials are present; apify-scraping is reserved for a future iteration.",
            "default": "off"
          },
          "scrapingBeeApiKey": {
            "title": "ScrapingBee API Key",
            "type": "string",
            "description": "API key for ScrapingBee. Get one at app.scrapingbee.com/account. Only needed if useProxyBypass includes 'scrapingbee' or 'auto'."
          },
          "brightDataApiKey": {
            "title": "Bright Data API Token",
            "type": "string",
            "description": "Account token for Bright Data Web Unlocker. Get one at brightdata.com. Required together with brightDataZone. Only used when useProxyBypass includes 'brightdata-unlocker' or 'auto'."
          },
          "brightDataZone": {
            "title": "Bright Data Zone",
            "type": "string",
            "description": "Bright Data unlocker zone name (set up in the Bright Data dashboard). Required together with brightDataApiKey."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}