{
  "openapi": "3.0.1",
  "info": {
    "title": "Trustpilot Scraper - Reviews, Companies & Monitor",
    "description": "Scrape Trustpilot company profiles and reviews: TrustScore, stars, text, replies, language. Monitor mode for new reviews and score alerts. Filter splitting past the 200-review cap. Residential proxies recommended.",
    "version": "0.1",
    "x-build-id": "cM6bcUEcyaDI20CpL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~trustpilot-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-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/crawloop~trustpilot-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-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/crawloop~trustpilot-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-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": "Mode",
            "enum": [
              "company",
              "reviews",
              "monitor"
            ],
            "type": "string",
            "description": "company = profile + reviews; reviews = reviews only; monitor = incremental deltas (new reviews + trust-score changes) with early stop.",
            "default": "monitor"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Trustpilot company review page URLs (e.g. https://www.trustpilot.com/review/spotify.com).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "companyDomains": {
            "title": "Company domains",
            "type": "array",
            "description": "Identifying domains (e.g. spotify.com). Converted to /review/{domain} URLs.",
            "items": {
              "type": "string"
            }
          },
          "maxReviews": {
            "title": "Max reviews per company",
            "minimum": 0,
            "type": "integer",
            "description": "Cap reviews collected per company. 0 = unlimited (still bounded by filter splitting / page cap).",
            "default": 100
          },
          "maxItems": {
            "title": "Max dataset items",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on pushed dataset rows (company + reviews + monitor events). 0 = unlimited.",
            "default": 0
          },
          "includeCompanyProfile": {
            "title": "Emit company profile row",
            "type": "boolean",
            "description": "In company mode, also push a company recordType row.",
            "default": true
          },
          "stars": {
            "title": "Star filter",
            "type": "array",
            "description": "Only collect these star ratings (1–5 as strings). Empty = all stars. In full scrape, empty enables recursive star splitting when total > 200.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Language filter",
            "type": "array",
            "description": "ISO language codes (e.g. en, de, fr). Empty = all. Used as filters and as splitter languages when a star bucket exceeds 200.",
            "items": {
              "type": "string"
            }
          },
          "splitLargeCompanies": {
            "title": "Recursive filter splitting",
            "type": "boolean",
            "description": "When total reviews > 200, split by stars (then languages) to bypass Trustpilot's 10-page / 200-review hard cap. Disabled automatically in monitor mode.",
            "default": true
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel page / company workers. Keep moderate with residential proxies.",
            "default": 4
          },
          "monitorStoreName": {
            "title": "Monitor KV store name",
            "type": "string",
            "description": "Named Key-Value Store for incremental state (per-company watermarks + seen review IDs).",
            "default": "trustpilot-monitor-store"
          },
          "monitorBaselineOnly": {
            "title": "Monitor baseline only",
            "type": "boolean",
            "description": "First run: seed KV fingerprints and review watermarks without emitting deltas / webhooks.",
            "default": false
          },
          "resetMonitorState": {
            "title": "Reset monitor state",
            "type": "boolean",
            "description": "Clear MONITOR_STATE in the named store before this run.",
            "default": false
          },
          "monitorFetchReviews": {
            "title": "Monitor: fetch new reviews",
            "type": "boolean",
            "description": "In monitor mode, paginate newest reviews until early-stop.",
            "default": true
          },
          "monitorMaxPages": {
            "title": "Monitor max pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Safety cap on pages scanned per company in monitor mode (Trustpilot hard-caps at 10 anyway).",
            "default": 5
          },
          "earlyStopAfterKnown": {
            "title": "Early-stop after N known reviews",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "In monitor mode, stop pagination after this many consecutive already-seen reviews (newest-first).",
            "default": 5
          },
          "trustScoreDropThreshold": {
            "title": "TrustScore drop threshold",
            "minimum": 0,
            "type": "number",
            "description": "Emit trustscore_drop when score falls by at least this amount.",
            "default": 0.1
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Slack / Discord / custom HTTPS endpoint for monitor alerts (JSON POST)."
          },
          "telegramToken": {
            "title": "Telegram Bot Token",
            "type": "string",
            "description": "Optional Telegram bot token for monitor alerts."
          },
          "telegramChatId": {
            "title": "Telegram Chat ID",
            "type": "string",
            "description": "Telegram chat/user ID for alerts (requires token)."
          },
          "notifyOnNewReviews": {
            "title": "Notify on new reviews",
            "type": "boolean",
            "description": "Send webhook/Telegram when a new review appears.",
            "default": true
          },
          "notifyOnNegativeReviewsOnly": {
            "title": "Negative reviews only (≤2★)",
            "type": "boolean",
            "description": "If enabled, new-review notifications fire only for 1–2 star reviews.",
            "default": false
          },
          "notifyOnTrustScoreChange": {
            "title": "Notify on TrustScore change",
            "type": "boolean",
            "description": "Send webhook/Telegram when TrustScore rises or drops beyond the threshold.",
            "default": true
          },
          "notifyOnReviewCountChange": {
            "title": "Notify on review-count change",
            "type": "boolean",
            "description": "Send webhook/Telegram when the company's public review count changes.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "AWS WAF blocks datacenter IPs. Use Apify Residential proxies.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}