{
  "openapi": "3.0.1",
  "info": {
    "title": "Review Intelligence Analyzer - Google Reviews Sales Signals",
    "description": "Analyze a business's Google Maps reviews with an LLM and return structured intelligence a sales team can act on: overall sentiment, complaint themes, praise themes, owner-response tone, red flags and opportunity signals. Bring your own LLM key (Gemini, Groq, OpenRouter). Pay-per-result.",
    "version": "1.0",
    "x-build-id": "bVgKCD8swpH5UPwff"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/santamaria-automations~review-intelligence-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-santamaria-automations-review-intelligence-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/santamaria-automations~review-intelligence-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-santamaria-automations-review-intelligence-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/santamaria-automations~review-intelligence-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-santamaria-automations-review-intelligence-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",
        "properties": {
          "places": {
            "title": "Places",
            "type": "array",
            "description": "Array of Google Maps place records. Each element is a full place object as emitted by the google-maps-scraper actor with `user_reviews[]` populated (run gmaps with `includeReviews: true`).",
            "items": {
              "type": "object"
            }
          },
          "companies": {
            "title": "Companies (with company_id passthrough)",
            "type": "array",
            "description": "Alternative to `places`. Each entry carries a company_id (echoed on the output row) plus the place record.",
            "items": {
              "type": "object",
              "required": [
                "place"
              ],
              "properties": {
                "company_id": {
                  "title": "Company ID",
                  "type": "string",
                  "description": "Your internal identifier, echoed on the output row so you can join intelligence back to your source data."
                },
                "place": {
                  "title": "Place",
                  "type": "object",
                  "description": "The Google Maps place record including `user_reviews[]`."
                }
              }
            }
          },
          "maxReviewsSampled": {
            "title": "Max Reviews Sampled per Place",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Cap on the number of reviews sent to the LLM per place. Higher = sharper signals but higher per-row token cost. The sampler blends most-recent, highest-rated and lowest-rated reviews so both praise and complaint angles are represented.",
            "default": 30
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "gemini",
              "groq",
              "openrouter"
            ],
            "type": "string",
            "description": "Primary AI provider. Gemini Flash is fastest and has a generous free tier.",
            "default": "gemini"
          },
          "fallbackProvider": {
            "title": "Fallback LLM Provider",
            "enum": [
              "gemini",
              "groq",
              "openrouter"
            ],
            "type": "string",
            "description": "Second-level fallback if the primary provider fails (rate limit, auth error, etc)."
          },
          "fallback2Provider": {
            "title": "Third-Level Fallback",
            "enum": [
              "gemini",
              "groq",
              "openrouter"
            ],
            "type": "string",
            "description": "Third-level fallback if both primary and first fallback fail."
          },
          "llmModel": {
            "title": "LLM Model (optional override)",
            "type": "string",
            "description": "Override the default model. Defaults: Gemini -> gemini-2.0-flash, Groq -> llama-3.3-70b-versatile, OpenRouter -> google/gemini-2.0-flash-001. If your OpenRouter key does not have access to the default paid Gemini model, try a free model like meta-llama/llama-3.1-8b-instruct."
          },
          "geminiApiKey": {
            "title": "Gemini API Key (recommended)",
            "type": "string",
            "description": "Google Gemini Flash. Best quality/cost ratio, generous free tier. Get a key at https://aistudio.google.com/app/apikey"
          },
          "groqApiKey": {
            "title": "Groq API Key (optional)",
            "type": "string",
            "description": "Groq. Ultra-fast inference. Get a key at https://console.groq.com/keys"
          },
          "openrouterApiKey": {
            "title": "OpenRouter API Key (optional)",
            "type": "string",
            "description": "OpenRouter. Access to 100+ models. Get a key at https://openrouter.ai/keys"
          },
          "outputLanguage": {
            "title": "Output Language",
            "type": "string",
            "description": "Language for the theme labels and sample quotes translated back. Uses standard ISO 639-1 codes: en, de, fr, ja, es, pt, it, ko, zh-CN, ar, nl, pl, sv, da, fi, no, cs, hu, ro, el, tr, th, vi, id, and more. Set to `auto` to match the business's country/language.",
            "default": "en"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Not used by this actor (LLM calls only). Accepted for schema consistency with sibling enrichment actors.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}