{
  "openapi": "3.0.1",
  "info": {
    "title": "Trustpilot Reviews Scraper — Company Reviews & Trust Scores",
    "description": "Scrape public reviews from Trustpilot by company domain. Parses the __NEXT_DATA__ JSON blob for reliability. Includes company profile (trust score, category, review count). Pay-per-event pricing — see the Pricing section for current per-review rates.",
    "version": "1.1",
    "x-build-id": "Zea9Vr84Mmg7BCzLy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mfapitools~trustpilot-reviews-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mfapitools-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/mfapitools~trustpilot-reviews-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mfapitools-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/mfapitools~trustpilot-reviews-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mfapitools-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": {
          "companyDomains": {
            "title": "Company domains",
            "type": "array",
            "description": "List of company domains to scrape reviews for. Example: [\"amazon.com\", \"apple.com\"]. Protocols (https://) and www. prefixes are stripped automatically.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Direct Trustpilot review page URLs (alternative or supplement to companyDomains). Example: [\"https://www.trustpilot.com/review/amazon.com\"]",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxReviewsPerCompany": {
            "title": "Max reviews per company",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of reviews to collect per company. 0 = collect all available (subject to the public pagination cap of ~200 reviews). Default: 100.",
            "default": 100
          },
          "sinceDate": {
            "title": "Since date (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Skip reviews older than this date. ISO format: YYYY-MM-DD. Useful for incremental runs — set to your last run date to fetch only new reviews. Leave blank to collect all available reviews."
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "recency",
              "relevance"
            ],
            "type": "string",
            "description": "Sort order for reviews. 'recency' (default) returns newest reviews first — recommended for incremental runs. 'relevance' uses Trustpilot's ranking algorithm.",
            "default": "recency"
          },
          "starRatings": {
            "title": "Star ratings",
            "type": "array",
            "description": "Only collect reviews with these star ratings. Leave empty to collect all ratings (default). Filtered client-side after fetching, not via Trustpilot's stars= query param — see README for why.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5"
              ],
              "enumTitles": [
                "1 star",
                "2 stars",
                "3 stars",
                "4 stars",
                "5 stars"
              ]
            },
            "default": []
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Only collect reviews written in these language codes, e.g. [\"en\", \"es\"]. Matched case-insensitively against Trustpilot's per-review language field. Leave empty to collect all languages (default). Filtered client-side after fetching — see README.",
            "items": {
              "type": "string"
            }
          },
          "verifiedOnly": {
            "title": "Verified reviews only",
            "type": "boolean",
            "description": "Only collect reviews Trustpilot marks as \"verified\". Default: false (collect all reviews regardless of verification status).",
            "default": false
          },
          "withRepliesOnly": {
            "title": "Reviews with a company reply only",
            "type": "boolean",
            "description": "Only collect reviews that have a public company reply. Default: false (collect all reviews).",
            "default": false
          },
          "includeCompanyProfile": {
            "title": "Include company profile",
            "type": "boolean",
            "description": "Push a company-profile record for each domain with: display name, trust score, total review count, and category. Adds one record per company at the start of the dataset. Default: true.",
            "default": true
          },
          "useResidentialProxy": {
            "title": "Use residential proxies",
            "type": "boolean",
            "description": "Use residential proxies (strongly recommended). Trustpilot uses AWS WAF that blocks datacenter IPs. Residential proxies significantly increase success rates. Datacenter proxies may work for small test runs but will be challenged under volume.",
            "default": false
          },
          "zeroYieldAbortThreshold": {
            "title": "Zero-yield abort threshold",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "If the first N processed pages ALL fail to produce any parseable data (WAF/challenge block or __NEXT_DATA__ parse failure), the run aborts immediately instead of burning further browser/proxy time. A company with genuinely 0 reviews does NOT count as a failure here. Set to 0 to disable. Default: 3.",
            "default": 3
          },
          "maxRunSeconds": {
            "title": "Max run duration (seconds)",
            "minimum": 0,
            "maximum": 3600,
            "type": "integer",
            "description": "Optional soft deadline checked between pages. 0 (default) = disabled — runs complete fully. If set, the run stops cleanly at the deadline with whatever was already collected (exit 0 with partial data, exit 1 if nothing). Use for scheduled runs with a strict per-run time budget; leave 0 when you need complete results.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}