{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Search Visibility Tracker: ChatGPT & Perplexity",
    "description": "Type your brand: the Actor generates buyer prompts, suggests competitors and audits AI search visibility (ChatGPT, Perplexity, Gemini). Mentions, rank, sentiment, citations, trends, an outreach gap list and a client-ready HTML report. Works with any OpenAI-compatible API.",
    "version": "0.3",
    "x-build-id": "pzTNegChAaFuqHvM5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kordyukov~ai-search-visibility-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kordyukov-ai-search-visibility-tracker",
        "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/kordyukov~ai-search-visibility-tracker/runs": {
      "post": {
        "operationId": "runs-sync-kordyukov-ai-search-visibility-tracker",
        "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/kordyukov~ai-search-visibility-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-kordyukov-ai-search-visibility-tracker",
        "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": [
          "brand"
        ],
        "properties": {
          "brand": {
            "title": "Brand name",
            "type": "string",
            "description": "The brand or product name to track in AI answers. Use the brands list below to track multiple brands in one run."
          },
          "brands": {
            "title": "Brands (multi-client)",
            "type": "array",
            "description": "Track several brands/clients in a single run. Each brand gets its own prompts, competitors, report and history. When set, the single brand field above is ignored. Format: [{\"brand\": \"...\", \"brandAliases\": [...], \"competitors\": [...], \"prompts\": [...]}]"
          },
          "brandAliases": {
            "title": "Brand aliases",
            "type": "array",
            "description": "Extra spellings by which the brand may be mentioned (e.g. domain, abbreviations). The brand name itself is always included.",
            "items": {
              "type": "string"
            }
          },
          "competitors": {
            "title": "Competitors",
            "type": "array",
            "description": "Competitor names to detect in the same answers and to compute brand position and share of voice. Leave empty to let the AI suggest the top 5 competitors automatically.",
            "items": {
              "type": "string"
            }
          },
          "autoSuggestCompetitors": {
            "title": "Suggest competitors automatically",
            "type": "boolean",
            "description": "When the competitors list is empty, ask the AI to identify the 5 most relevant direct competitors. Disable to run without competitor tracking.",
            "default": true
          },
          "prompts": {
            "title": "Prompts",
            "type": "array",
            "description": "The questions your customers would type into an AI assistant, e.g. \"best CRM for small business\". One run checks every prompt. Leave empty (or enable autoPrompts) to let the AI generate them for you.",
            "items": {
              "type": "string"
            }
          },
          "autoPrompts": {
            "title": "Regenerate prompts automatically",
            "type": "boolean",
            "description": "Prompts are generated automatically whenever the prompts list is empty. Tick this to force regeneration even when prompts are provided.",
            "default": false
          },
          "promptCount": {
            "title": "Number of auto-generated prompts",
            "maximum": 50,
            "type": "integer",
            "description": "How many prompts to generate when autoPrompts is enabled (or when no prompts are provided).",
            "default": 20
          },
          "engines": {
            "title": "AI engines (multi-engine comparison)",
            "type": "array",
            "description": "Run the same prompts through several engines in one run and compare them in the report. Each entry is an OpenAI-compatible engine ({name, baseUrl, model, apiToken}) or a Google SERP engine: {provider: 'serpapi', apiKey} for Google AI Overviews (reliable), or {provider: 'google-ai-mode'} for Google AI Mode direct scraping (experimental, residential proxy required). Format: [{\"name\": \"ChatGPT\", \"baseUrl\": \"...\", \"model\": \"...\", \"apiToken\": \"...\"}, {\"provider\": \"serpapi\", \"apiKey\": \"...\"}]"
          },
          "model": {
            "title": "AI model",
            "type": "string",
            "description": "Model name passed to the OpenAI-compatible API.",
            "default": "gpt-4o-mini"
          },
          "baseUrl": {
            "title": "OpenAI-compatible base URL",
            "type": "string",
            "description": "Works with OpenAI, Perplexity (https://api.perplexity.ai), Gemini (https://generativelanguage.googleapis.com/v1beta/openai), Groq (https://api.groq.com/openai/v1) and OpenRouter (https://openrouter.ai/api/v1).",
            "default": "https://api.openai.com/v1"
          },
          "apiToken": {
            "title": "API token",
            "type": "string",
            "description": "API key for the engine above. Stored as a secret. Not required when the mock engine is enabled."
          },
          "useMockEngine": {
            "title": "Use mock engine (testing)",
            "type": "boolean",
            "description": "Runs deterministic fake answers without any API key. A free demo of the Actor's logic — under Pay Per Event pricing mock runs are not charged.",
            "default": false
          },
          "runsPerPrompt": {
            "title": "Runs per prompt (answer stability)",
            "maximum": 3,
            "type": "integer",
            "description": "Ask the same prompt several times to measure how stable the AI answer is (1 = off). AI assistants often answer inconsistently — this shows where your visibility flickers.",
            "default": 1
          },
          "webhookUrl": {
            "title": "Webhook URL (notifications)",
            "type": "string",
            "description": "Optional. A POST request with a JSON summary (scores, deltas per brand, outreach counts) is sent here when the run finishes — connect Slack, Make, n8n or your own endpoint."
          },
          "alertThresholdPct": {
            "title": "Alert when visibility drops (percentage points)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "When the visibility score drops by at least this many percentage points versus the previous run, the webhook payload includes alert: true (per brand and at the top level). Use it to trigger Slack/n8n notifications. 0 = alerts disabled.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max parallel prompts",
            "maximum": 20,
            "type": "integer",
            "description": "How many prompts to check in parallel. Keep low for strict API rate limits.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "type": "integer",
            "description": "Per-request timeout for a single prompt check.",
            "default": 60
          },
          "proxyGroup": {
            "title": "Proxy group for Google AI Mode",
            "type": "string",
            "description": "Apify Proxy group used by the google-ai-mode engine. Google blocks datacenter IPs, so residential proxies are required. Defaults to RESIDENTIAL.",
            "default": "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}