{
  "openapi": "3.0.1",
  "info": {
    "title": "Trustpilot Scraper",
    "description": "5 modes (reviews, search companies, browse categories, company info, transparency reports). 50+ fields per review including AI summaries, B2B contact details (email/phone/address), competitor map, and reviewer cross-business stats. Up to 5K reviews per company.",
    "version": "0.1",
    "x-build-id": "h9gSQFnSeORTJdAOM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sourabhbgp~trustpilot-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sourabhbgp-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/sourabhbgp~trustpilot-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sourabhbgp-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/sourabhbgp~trustpilot-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sourabhbgp-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": {
          "mode": {
            "title": "Scraping Mode",
            "enum": [
              "reviews",
              "searchCompanies",
              "categoryBrowser",
              "companyInfo",
              "transparency"
            ],
            "type": "string",
            "description": "Choose what to scrape. Each mode is billed separately (review_result $0.0005, company_result $0.001, search_result $0.0002, transparency_report $0.005).",
            "default": "reviews"
          },
          "urls": {
            "title": "Company URLs or Domains",
            "type": "array",
            "description": "List of Trustpilot company URLs or domain names. Used by reviews, companyInfo, transparency modes. Examples: 'amazon.com', 'https://www.trustpilot.com/review/booking.com', 'www.netflix.com'.",
            "items": {
              "type": "string"
            }
          },
          "companyUrls": {
            "title": "Company URLs (alias)",
            "type": "array",
            "description": "Alias for `urls` — kept for backward compatibility with existing v1 saved configs.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Brand Names (auto-resolved)",
            "type": "array",
            "description": "Brand names to look up on Trustpilot. Each term is resolved to the best-matching company slug via the Trustpilot directory and then scraped. Use instead of `urls` when you only know the brand name.",
            "items": {
              "type": "string"
            }
          },
          "maxReviews": {
            "title": "Max Reviews per Company",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of reviews per company (reviews mode). 0 = 1,000 (back-compat). Up to 200 uses a single request; >200 enables aggressive slicing (stars × date × sort) for up to ~5,000 unique reviews.",
            "default": 200
          },
          "stars": {
            "title": "Star Ratings",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter to specific star ratings (e.g. [1, 5] for one- and five-star reviews only). Empty = all ratings.",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5
            },
            "default": []
          },
          "starFilter": {
            "title": "Star Filter (single, alias)",
            "enum": [
              "all",
              "1",
              "2",
              "3",
              "4",
              "5"
            ],
            "type": "string",
            "description": "Backward-compat alias for `stars` accepting a single value: 'all' / '1' / '2' / '3' / '4' / '5'.",
            "default": "all"
          },
          "languages": {
            "title": "Review Languages",
            "type": "array",
            "description": "ISO codes (e.g. ['en', 'de', 'fr']). Empty = all languages. Languages are fetched in order until maxReviews is reached — set maxReviews high enough to cover all languages (e.g. 200 per language).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language (single, alias)",
            "type": "string",
            "description": "Backward-compat alias for `languages` accepting a single ISO code (or 'all').",
            "default": "all"
          },
          "dateRange": {
            "title": "Published Within",
            "enum": [
              "all",
              "last30days",
              "last3months",
              "last6months",
              "last12months"
            ],
            "type": "string",
            "description": "Server-side date filter. Limited to Trustpilot's predefined buckets.",
            "default": "all"
          },
          "startDate": {
            "title": "Start Date Cutoff (YYYY-MM-DD)",
            "type": "string",
            "description": "Skip reviews published before this date. Use for chronological cutoff (e.g., '2025-01-01')."
          },
          "verifiedOnly": {
            "title": "Verified Only",
            "type": "boolean",
            "description": "Only return reviews marked as verified by Trustpilot.",
            "default": false
          },
          "repliesOnly": {
            "title": "Has Company Reply",
            "type": "boolean",
            "description": "Only return reviews that have a reply from the company.",
            "default": false
          },
          "topics": {
            "title": "Review Topics",
            "type": "array",
            "description": "Trustpilot topic filter (e.g. ['delivery_service', 'customer_service', 'refund', 'product']). Empty = all topics.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword in Review Body",
            "type": "string",
            "description": "Full-text search within review body. Server-side filter."
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "recency",
              "relevance"
            ],
            "type": "string",
            "description": "Sort reviews by recency or relevance.",
            "default": "recency"
          },
          "sortBy": {
            "title": "Sort (deprecated alias)",
            "enum": [
              "recency",
              "relevance"
            ],
            "type": "string",
            "description": "Backward-compat alias for `sort`. New configs should use `sort` instead.",
            "default": "recency"
          },
          "aggressiveSlicing": {
            "title": "Aggressive Slicing (>200 reviews)",
            "type": "boolean",
            "description": "Enable cartesian-product slicing (stars × date × sort) to bypass Trustpilot's 200-review per-filter cap. Auto-true when maxReviews > 200 or when multiple stars are requested."
          },
          "includeCompanyInfo": {
            "title": "Include Company Info",
            "type": "boolean",
            "description": "Add company metadata (trust score, distribution, categories) to each review record.",
            "default": true
          },
          "includeContact": {
            "title": "Include Contact (email/phone/address)",
            "type": "boolean",
            "description": "Add company contact info (email, phone, address, city, country, zip) to each review record. Real values for many brands. Unique to this scraper.",
            "default": true
          },
          "includeStats": {
            "title": "Include Per-Star Stats",
            "type": "boolean",
            "description": "Add full per-star count breakdown (one/two/three/four/five) to each review record.",
            "default": false
          },
          "includeSimilarCompetitors": {
            "title": "Include Similar Competitors",
            "type": "boolean",
            "description": "Add up to 8 similar businesses (with trustScore + review count) — Trustpilot's own competitor map. Unique to this scraper.",
            "default": false
          },
          "includeAiSummary": {
            "title": "Include AI Summary",
            "type": "boolean",
            "description": "Add Trustpilot's AI-generated review summary + topic summaries (delivery, product, customer service, etc.) on the first review per company. Unique to this scraper.",
            "default": true
          },
          "compact": {
            "title": "Compact Output (for AI/MCP)",
            "type": "boolean",
            "description": "Return only core fields (id, text, rating, reviewer, company, AI summary). Smaller payloads for LLM contexts.",
            "default": false
          },
          "incremental": {
            "title": "Incremental Mode",
            "type": "boolean",
            "description": "Track which review IDs have been seen across runs. Each output record gets `changeType` (NEW / UPDATED / REAPPEARED) plus `firstSeenAt` / `lastSeenAt` timestamps. Requires `stateKey`. Unique to this scraper.",
            "default": false
          },
          "stateKey": {
            "title": "Incremental State Key",
            "type": "string",
            "description": "Identifier for the persistent state store (e.g. 'monitor-amazon-2026'). Reuse the same key across runs to detect changes."
          },
          "lookbackDays": {
            "title": "Lookback Window (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only emit reviews published within the last N days. Shortcut for setting startDate. Convenient for monitoring use cases."
          },
          "searchQuery": {
            "title": "Search Query (searchCompanies mode)",
            "type": "string",
            "description": "Keyword to search the Trustpilot company directory. E.g., 'car insurance', 'web hosting', 'crypto exchange'."
          },
          "searchCountry": {
            "title": "Country (searchCompanies / categoryBrowser)",
            "type": "string",
            "description": "ISO Alpha-2 country code (e.g. 'US', 'GB', 'DE'). Default: US.",
            "default": "US"
          },
          "categoryId": {
            "title": "Category ID (categoryBrowser mode)",
            "type": "string",
            "description": "Trustpilot category id, e.g. 'electronics_technology', 'insurance_agency', 'web_hosting'. See trustpilot.com/categories for the full list."
          },
          "minTrustScore": {
            "title": "Min Trust Score",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Filter to companies with trust score >= this value (1-5). Used by categoryBrowser mode."
          },
          "maxTrustScore": {
            "title": "Max Trust Score",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Filter to companies with trust score <= this value (1-5)."
          },
          "onlyClaimed": {
            "title": "Claimed Companies Only",
            "type": "boolean",
            "description": "Filter to companies that have claimed their Trustpilot profile.",
            "default": false
          },
          "maxBusinesses": {
            "title": "Max Businesses Returned",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum businesses to return for searchCompanies / categoryBrowser modes.",
            "default": 200
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy used for outbound requests. Trustpilot is generally not blocked, so proxy is optional.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}