{
  "openapi": "3.0.1",
  "info": {
    "title": "Trustpilot Analytics — Search, Compare, Consumer & Monitoring",
    "description": "Advanced Trustpilot intelligence: search companies by keyword, compare up to 10 competitors side-by-side, batch process 50 companies, browse categories, extract consumer profiles, and set up real-time monitoring with webhooks.",
    "version": "1.0",
    "x-build-id": "JcWkUWdrkn5SDbOfN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jdtpnjtp~trustpilot-analytics/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jdtpnjtp-trustpilot-analytics",
        "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/jdtpnjtp~trustpilot-analytics/runs": {
      "post": {
        "operationId": "runs-sync-jdtpnjtp-trustpilot-analytics",
        "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/jdtpnjtp~trustpilot-analytics/run-sync": {
      "post": {
        "operationId": "run-sync-jdtpnjtp-trustpilot-analytics",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "compare",
              "batch_profiles",
              "batch_review_count",
              "categories",
              "consumer",
              "monitor"
            ],
            "type": "string",
            "description": "Choose the analytics mode. Each mode has its own set of parameters below.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Keyword to search for companies (e.g. 'cloud hosting', 'online store', 'insurance'). Used in 'Search Companies' mode."
          },
          "searchCountry": {
            "title": "Country Filter",
            "type": "string",
            "description": "ISO country code to filter search results (e.g. 'US', 'GB', 'DE'). Leave empty for global results."
          },
          "searchMaxPages": {
            "title": "Max Search Pages",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of search result pages to scrape. Each page contains ~20 results.",
            "default": 1
          },
          "compareCompanies": {
            "title": "Companies to Compare",
            "type": "array",
            "description": "List of 2-10 company identifying names to compare side-by-side. Used in 'Compare Companies' mode.",
            "items": {
              "type": "string"
            }
          },
          "batchCompanies": {
            "title": "Companies",
            "type": "array",
            "description": "List of up to 50 company identifying names for batch processing. Used in 'Batch Profiles' and 'Batch Review Count' modes.",
            "items": {
              "type": "string"
            }
          },
          "batchCountStars": {
            "title": "Stars Filter (for Review Count)",
            "type": "array",
            "description": "Only count reviews with these star ratings (1-5). Leave empty for total count. Used in 'Batch Review Count' mode."
          },
          "categoryId": {
            "title": "Category ID",
            "type": "string",
            "description": "Trustpilot category identifier (e.g. 'restaurants_bars', 'game_store', 'web_hosting'). Used in 'Browse Category' mode."
          },
          "consumerId": {
            "title": "Consumer ID",
            "type": "string",
            "description": "Trustpilot consumer ID (found in consumer profile URL). Used in 'Consumer Profile' mode."
          },
          "consumerMaxReviewPages": {
            "title": "Max Review Pages",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of review pages to scrape for the consumer.",
            "default": 1
          },
          "monitorWebhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Your endpoint URL where notifications will be sent via HTTP POST. Must be publicly accessible."
          },
          "monitorCompanies": {
            "title": "Companies to Monitor",
            "type": "array",
            "description": "List of company identifying names to monitor (e.g. 'www.steampowered.com', 'amazon.com'). At least one required.",
            "items": {
              "type": "string"
            }
          },
          "monitorEvents": {
            "title": "Event Types",
            "type": "array",
            "description": "Which events to listen for. Available: new_review, review_updated, review_deleted, rating_changed, company_profile_updated, transparency_updated.",
            "items": {
              "type": "string"
            }
          },
          "monitorWebhookSecret": {
            "title": "Webhook Secret (optional)",
            "type": "string",
            "description": "Secret key for HMAC-SHA256 signature verification. Min 8 characters. Sent in X-Webhook-Signature header."
          },
          "monitorMinRating": {
            "title": "Min Rating Filter",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Only trigger for reviews with this minimum rating (1-5). Leave empty for all ratings."
          },
          "monitorMaxRating": {
            "title": "Max Rating Filter",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Only trigger for reviews with this maximum rating (1-5). Leave empty for all ratings."
          },
          "monitorCheckInterval": {
            "title": "Check Interval (minutes)",
            "minimum": 5,
            "maximum": 1440,
            "type": "integer",
            "description": "How often to check for changes (5-1440 minutes). Default: 15 minutes.",
            "default": 15
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}