{
  "openapi": "3.0.1",
  "info": {
    "title": "Multi-Platform Reputation Analyzer",
    "description": "Cross-platform review monitoring, crisis detection, and decision-ready reputation risk scoring across Trustpilot, Google, BBB. Routable verdict, 30-day forecast, risk score, intervention playbook, cross-run memory layer. Deterministic. No LLM. Audit-ready.",
    "version": "1.0",
    "x-build-id": "Rcri2iCgQfcCdf5OD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~multi-review-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-multi-review-analyzer",
        "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/ryanclinton~multi-review-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-multi-review-analyzer",
        "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/ryanclinton~multi-review-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-multi-review-analyzer",
        "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": [
          "businessName"
        ],
        "properties": {
          "businessName": {
            "title": "Business Name",
            "type": "string",
            "description": "The business to analyse (e.g. 'Shopify', 'Tesla', 'Airbnb'). For comparing multiple businesses in one run, leave this and use the `businesses` field instead.",
            "default": "Apify"
          },
          "businesses": {
            "title": "Businesses to Compare (Multi-Business Mode)",
            "type": "array",
            "description": "Optional list of businesses for comparison mode. When set with 2 or more entries, the actor analyses each, emits per-business records, then a `recordType: 'comparison'` record naming the leader, biggest risk, and largest divergence. Overrides the single `businessName` field. Leave empty for single-business analysis."
          },
          "outputProfile": {
            "title": "Output Profile",
            "enum": [
              "compact",
              "standard",
              "full",
              "alert"
            ],
            "type": "string",
            "description": "Controls payload size. 'standard' returns the full report (default), 'compact' drops reviews[] and themes.detected[], 'full' is identical to standard, 'alert' returns only decision + oneLine + topPriority + confidence (minimal payload for Slack/webhooks).",
            "default": "standard"
          },
          "industry": {
            "title": "Industry Tag",
            "type": "string",
            "description": "Optional industry label (e.g. 'ecommerce', 'saas', 'airlines') echoed back in the run context. Does not affect scoring — useful for tagging/filtering across multiple runs."
          },
          "analysisProfile": {
            "title": "Analysis Profile",
            "enum": [
              "auto",
              "default",
              "monitoring",
              "competitor-benchmark",
              "due-diligence",
              "sales-prospecting",
              "voice-of-customer"
            ],
            "type": "string",
            "description": "Workflow preset that auto-tunes sample sizes, divergence threshold, and alert sensitivity. 'auto' (default) resolves the best profile from your input shape — pass monitorStateKey for monitoring, request 200+ reviews for due-diligence, request <25 reviews for sales-prospecting, etc. The resolution is logged at startup and surfaced in the run output's `context.analysisProfile`.",
            "default": "auto"
          },
          "businessDomain": {
            "title": "Business Domain",
            "type": "string",
            "description": "Business website domain (e.g. 'apify.com'). Enables direct Trustpilot lookup at trustpilot.com/review/<domain> instead of search — faster and more complete."
          },
          "platforms": {
            "title": "Platforms to Search",
            "type": "array",
            "description": "Which review platforms to check. Accepted values: 'trustpilot', 'google', 'bbb'. Leave empty to search all three.",
            "items": {
              "type": "string"
            }
          },
          "serperApiKey": {
            "title": "Serper API Key",
            "type": "string",
            "description": "Serper.dev API key for Google review search. Optional — Google search is skipped without it. Get a free key at https://serper.dev (2,500 queries/month free tier)."
          },
          "maxReviewsPerPlatform": {
            "title": "Max Reviews Per Platform",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of reviews to collect per platform.",
            "default": 50
          },
          "maxResults": {
            "title": "Maximum Total Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum total reviews across all platforms.",
            "default": 200
          },
          "monitorStateKey": {
            "title": "Monitor State Key (Recurring Runs)",
            "type": "string",
            "description": "Optional named key-value store ID for cross-run change detection. When set, the actor loads prior snapshots, computes deltas (sentiment flip, complaint surge, BBB grade transition, review volume cliff, accreditation change), saves the new snapshot, and includes a changeSinceLastRun report in the output. Leave empty for one-off analysis."
          },
          "divergenceThreshold": {
            "title": "Divergence Threshold (stars)",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Star-spread above which cross-platform divergence is flagged as severe. Default 1.2 — when platforms disagree by more than 1.2 stars, severity escalates to 'severe'.",
            "default": 1.2
          },
          "complaintSurgeThreshold": {
            "title": "Complaint Surge Threshold",
            "minimum": 1,
            "maximum": 5,
            "type": "number",
            "description": "Multiplier for BBB complaint surge detection (used only when monitorStateKey is set). Default 1.3 = 30% increase fires COMPLAINT_SURGE alert. Higher values reduce sensitivity.",
            "default": 1.3
          },
          "reviewVolumeCliffThreshold": {
            "title": "Review Volume Cliff Threshold",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Lower bound on review-volume retention between runs (used only when monitorStateKey is set). Default 0.8 — when current volume drops below 80% of prior volume, REVIEW_VOLUME_CLIFF fires.",
            "default": 0.8
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}