{
  "openapi": "3.0.1",
  "info": {
    "title": "Trustpilot Reviews Scraper — Ratings, Replies & TrustScore",
    "description": "Scrape Trustpilot reviews, star ratings, reply text, TrustScore, and reviewer profiles for any business. Filter by star rating, language, or date. No Trustpilot API key needed.",
    "version": "1.0",
    "x-build-id": "7FAl4aU62poAmfe6a"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/intelscrape~trustpilot-reviews-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-intelscrape-trustpilot-reviews-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/intelscrape~trustpilot-reviews-scraper/runs": {
      "post": {
        "operationId": "runs-sync-intelscrape-trustpilot-reviews-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/intelscrape~trustpilot-reviews-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-intelscrape-trustpilot-reviews-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": {
          "domains": {
            "title": "Company domains",
            "type": "array",
            "description": "Trustpilot company domains (e.g. amazon.com).",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Full Trustpilot review page URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchTerms": {
            "title": "Brand / company search terms",
            "type": "array",
            "description": "Brand names to resolve via Trustpilot public search/autosuggest to a company domain (/review/{domain}), then scrape like domains. Domain-like terms (contain a dot) are used directly. Failures are logged — companies are never invented.",
            "items": {
              "type": "string"
            }
          },
          "maxReviews": {
            "title": "Max reviews",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum reviews to push across all targets.",
            "default": 50
          },
          "maxPages": {
            "title": "Max pages per company",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many Trustpilot review pages to crawl per domain (~20 reviews/page).",
            "default": 3
          },
          "stars": {
            "title": "Star rating filter",
            "type": "array",
            "description": "Only include these star ratings. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5"
              ],
              "enumTitles": [
                "1 star",
                "2 stars",
                "3 stars",
                "4 stars",
                "5 stars"
              ]
            }
          },
          "languages": {
            "title": "Language filter",
            "type": "array",
            "description": "ISO language codes (e.g. en, de, fr). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Author countries",
            "type": "array",
            "description": "ISO alpha-2 country codes (e.g. US, GB, DE). Client filter on authorCountry. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "dateRange": {
            "title": "Date range",
            "enum": [
              "",
              "all",
              "last30days",
              "last3months",
              "last6months",
              "last12months"
            ],
            "type": "string",
            "description": "Trustpilot date preset. Empty/all = no date filter.",
            "default": ""
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only keep reviews published strictly after this ISO date/datetime (YYYY-MM-DD or full timestamp)."
          },
          "lastDays": {
            "title": "Last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Rolling window: only reviews newer than now−N days. Composed with publishedAfter — the more recent cutoff wins."
          },
          "topics": {
            "title": "Topics / keywords",
            "type": "array",
            "description": "Client filter: title+text must contain at least one topic (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "reviewKeyword": {
            "title": "Review keyword",
            "type": "string",
            "description": "Single keyword filter (same as topics). title+text must contain this string (case-insensitive). Combined with topics[] (OR)."
          },
          "verifiedOnly": {
            "title": "Verified reviews only",
            "type": "boolean",
            "description": "Only include verified purchase / invitation reviews.",
            "default": false
          },
          "repliesOnly": {
            "title": "Reviews with replies only",
            "type": "boolean",
            "description": "Only include reviews that have a company reply.",
            "default": false
          },
          "sort": {
            "title": "Sort reviews by",
            "enum": [
              "recency",
              "relevance"
            ],
            "type": "string",
            "description": "Order before scraping. Affects which reviews you get when limited.",
            "default": "recency"
          },
          "sampling": {
            "title": "Sampling when capped",
            "enum": [
              "balanced",
              "proportional"
            ],
            "type": "string",
            "description": "When maxReviews caps results: balanced = equal budget across star ratings 1–5 among collected reviews; proportional = sample matching the observed star histogram. Applied after filters, before push.",
            "default": "balanced"
          },
          "scrapeAllReviews": {
            "title": "Scrape all reviews (bypass ~200-review cap)",
            "type": "boolean",
            "description": "Adds language=all to the Trustpilot URL and forces sort=recency, bypassing Trustpilot's ~200-review relevancy cap. Combine with maxPages to control depth. Very large companies (100k+ reviews) still need high maxPages.",
            "default": false
          },
          "expandRegionalDomains": {
            "title": "Expand regional domains",
            "type": "boolean",
            "description": "After resolving each company domain, also collect regional sibling domains (e.g. nike.de, nike.co.uk) via Trustpilot autosuggest. Sibling results share the same maxReviews cap. Use strictNameMatch to limit to exact brand name matches.",
            "default": true
          },
          "strictNameMatch": {
            "title": "Strict brand name match (regional siblings)",
            "type": "boolean",
            "description": "When expandRegionalDomains is on: only add a sibling if its Trustpilot displayName matches the primary domain's displayName exactly (case-insensitive). Reduces false siblings at the cost of fewer results.",
            "default": false
          },
          "demoMode": {
            "title": "Demo mode",
            "type": "boolean",
            "description": "Push synthetic fixtures (no live scrape). Use for Store smoke / PPE tests.",
            "default": false
          },
          "includeReviewSummary": {
            "title": "Company review summary",
            "type": "boolean",
            "description": "After scraping, push one company-level summary row (avg rating, star histogram, reply rate, top keywords, sentiment buckets) and charge the review-summary event once per company. Heuristic extractive summary — no external LLM.",
            "default": true
          },
          "includeReviewInsights": {
            "title": "Review insights digest",
            "type": "boolean",
            "description": "After scraping, push one review-insights row per company (rating breakdown, ranked complaint themes with severity, top negative terms from 1–2★ reviews, request snippets) and charge review-insights once per company. Deterministic — no external LLM. Undercuts memo23 reviewInsights pricing.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}