{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Search Share-of-Voice (AEO/GEO) & Citation Monitor",
    "description": "Monitors brand citations, recommendation rank, source domain attribution, and share-of-voice across AI search engines (Perplexity, Google AI Overviews). Syncs long-term trend timeline databases to Notion and sends Slack alerts via MCP connectors.",
    "version": "1.0",
    "x-build-id": "KSmyYqD7lt7FMap2K"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ishekofficial~ai-search-sov-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ishekofficial-ai-search-sov-monitor",
        "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/ishekofficial~ai-search-sov-monitor/runs": {
      "post": {
        "operationId": "runs-sync-ishekofficial-ai-search-sov-monitor",
        "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/ishekofficial~ai-search-sov-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-ishekofficial-ai-search-sov-monitor",
        "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": [
          "notionConnector",
          "monitoringDatabaseId",
          "timelineDatabaseId"
        ],
        "properties": {
          "notionConnector": {
            "title": "Notion connector — monitoring pack + timeline (read + write)",
            "type": "string",
            "description": "Connector used to (1) READ your monitoring pack — the prompts, brand, competitors, and domain that drive the scrape — and (2) WRITE dated timeline rows back after each run. Your Notion token never reaches this Actor: the Apify proxy injects it server-side."
          },
          "slackConnector": {
            "title": "Slack connector — SoV drop alerts (write)",
            "type": "string",
            "description": "Optional. Dispatches an alert card to Slack when Share-of-Voice drops by more than the configured threshold between runs."
          },
          "runMode": {
            "title": "Run mode",
            "type": "string",
            "description": "Leave as 'analyse'. Set to 'discover' only when connecting a new MCP server for the first time: it prints every tool the connector exposes, then exits without scraping anything.",
            "default": "analyse"
          },
          "monitoringDatabaseId": {
            "title": "Monitoring pack database ID",
            "type": "string",
            "description": "The 32-character ID from your Notion monitoring pack database URL. This database has rows with Type (Prompt, Brand, Domain, Competitor) and Value columns. See the README for the template."
          },
          "timelineDatabaseId": {
            "title": "SoV timeline database ID",
            "type": "string",
            "description": "The 32-character ID from your Notion SoV timeline database URL. Each run appends a row with the date, SoV%, CDS%, RPS, and prompt count."
          },
          "brandName": {
            "title": "Brand name (override)",
            "type": "string",
            "description": "⚠️ Overrides whatever the Notion monitoring pack says. Use only for testing without a connector, or to force a brand name for a single run. In production, this lives in Notion as a row with Type = Brand."
          },
          "domain": {
            "title": "Domain (override)",
            "type": "string",
            "description": "⚠️ Overrides Notion. Use only for testing."
          },
          "prompts": {
            "title": "Prompts (override)",
            "type": "array",
            "description": "⚠️ Overrides Notion. Commercial search queries to track. In production, these are rows with Type = Prompt in your Notion monitoring pack.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "competitors": {
            "title": "Competitors (override)",
            "type": "array",
            "description": "⚠️ Overrides Notion. Competing brand names to benchmark against.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "engines": {
            "title": "AI search engines to monitor",
            "type": "array",
            "description": "Which AI engines to query. Google AI Overviews is enabled by default and requires NO API key. Perplexity, ChatGPT, OpenAI GPT-OSS on Groq, Groq Compound, and xAI Grok require their respective API keys.",
            "items": {
              "type": "string",
              "enum": [
                "google_ai_overview",
                "perplexity",
                "openai_chatgpt",
                "openai_groq_oss",
                "groq_compound",
                "xai_grok"
              ]
            },
            "default": [
              "google_ai_overview",
              "perplexity"
            ]
          },
          "country": {
            "title": "Target country (e.g. US, UK, DE)",
            "type": "string",
            "description": "Two-letter country code(s) (e.g. US or US, UK, DE for multi-country). Leave default for Global (all regions).",
            "default": "Global (all regions)"
          },
          "language": {
            "title": "Target language (e.g. en, es, de)",
            "type": "string",
            "description": "Two-letter language code(s) (e.g. en or en, es, de for multi-language).",
            "default": "en"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxies used for web scraping engines.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "perplexityApiKey": {
            "title": "Perplexity API Key (optional)",
            "type": "string",
            "description": "Recommended for Perplexity AI. Uses Perplexity's official Sonar Pro model with zero Cloudflare block risk."
          },
          "openaiApiKey": {
            "title": "OpenAI API Key (optional)",
            "type": "string",
            "description": "Required ONLY if 'ChatGPT / OpenAI' is selected under AI engines to monitor."
          },
          "xaiApiKey": {
            "title": "xAI Grok API Key (optional)",
            "type": "string",
            "description": "Required ONLY if 'xAI Grok' is selected under AI engines to monitor."
          },
          "groqApiKey": {
            "title": "Groq API Key (optional)",
            "type": "string",
            "description": "Powers both 'Groq Compound' and 'OpenAI GPT-OSS on Groq' engine options."
          },
          "dryRun": {
            "title": "Dry run — scrape and score but do not write",
            "type": "boolean",
            "description": "Runs the full read → scrape → score pipeline and logs exactly what would be written to Notion and Slack, without touching either. Use this on your first run.",
            "default": true
          },
          "slackChannel": {
            "title": "Slack alert channel",
            "type": "string",
            "description": "Slack channel for SoV drop alerts. Include the # prefix.",
            "default": "#sov-alerts"
          },
          "sovDropThreshold": {
            "title": "SoV drop alert threshold (%)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Dispatch a Slack alert when SoV drops by this many percentage points between runs. Set higher to reduce noise from minor variance.",
            "default": 5
          },
          "debugMode": {
            "title": "Detailed logging",
            "type": "boolean",
            "description": "Adds per-query and per-engine detail lines. Useful when a result looks wrong and you want to see why.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}