{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Search Visibility Tracker — AEO & Citation Audit",
    "description": "Check whether Perplexity, ChatGPT, Claude and Gemini cite your domain, with citation rank, content gaps and competing domains per keyword. Works with Apify MCP and the API.",
    "version": "1.1",
    "x-build-id": "C9z2UcqQkvTurV9Am"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~ai-search-visibility-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-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/khadinakbar~ai-search-visibility-tracker/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-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/khadinakbar~ai-search-visibility-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-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": [
          "targetDomain",
          "keywords"
        ],
        "properties": {
          "targetDomain": {
            "title": "Target domain to track",
            "type": "string",
            "description": "The website domain whose pages you want to track as cited sources in AI search results. Enter just the domain without https:// or www (e.g., 'ahrefs.com', 'hubspot.com'). The actor checks whether any URL from this domain appears in AI citations. NOT a brand name — use the ai-search-brand-monitor actor for brand name tracking."
          },
          "keywords": {
            "title": "Keywords / topics to query",
            "type": "array",
            "description": "List of keywords or topics to ask AI platforms about. The actor submits topic-based queries (e.g., 'best resources for SEO') and checks whether your domain is cited as a source. Enter each topic as a separate item (e.g., ['SEO', 'keyword research', 'backlink analysis']). NOT brand names — use topics and categories your content covers.",
            "items": {
              "type": "string"
            }
          },
          "targetUrls": {
            "title": "Target URLs to track (optional)",
            "type": "array",
            "description": "Specific page URLs from your domain to monitor for citations (e.g., 'https://ahrefs.com/blog/seo-guide/'). When provided, the actor also tracks whether these exact pages are cited, not just the domain. Leave empty to track any page from the domain. Each URL must start with https://.",
            "items": {
              "type": "string"
            }
          },
          "competitorDomains": {
            "title": "Competitor domains to compare",
            "type": "array",
            "description": "Competitor website domains to compare against (e.g., ['semrush.com', 'moz.com']). The summary adds a share_of_voice table for your domain and these competitors, and top_competing_domains is limited to them. Leave empty to see the top 5 domains cited alongside yours.",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "title": "AI platforms to query",
            "type": "array",
            "description": "Which AI search platforms to query for citations. Valid values: 'perplexity' (real-time citations), 'chatgpt' (web search), 'claude' (live web search), 'google_aio' (Google AI Overviews, not charged when Google shows none), 'gemini' (Google search grounding; costs more to run, limited to 25 checks per run, and may use a backup route if the main one is busy). Defaults to perplexity, chatgpt, claude and google_aio.",
            "items": {
              "type": "string"
            },
            "default": [
              "perplexity",
              "chatgpt",
              "claude",
              "google_aio"
            ]
          },
          "queryTemplates": {
            "title": "Query template categories",
            "type": "array",
            "description": "Built-in topic-query templates to run for each keyword. Options: 'topic_authority' (best resources/authoritative sites for X), 'how_to' (how to do X), 'what_is' (what is X / define X), 'comparison' (top tools and resources for X), 'expert_picks' (what experts recommend for X). Use customQueries instead when you have specific questions. Defaults to topic_authority, how_to, what_is.",
            "items": {
              "type": "string"
            },
            "default": [
              "topic_authority",
              "how_to",
              "what_is"
            ]
          },
          "customQueries": {
            "title": "Custom queries (optional)",
            "type": "array",
            "description": "Specific questions to submit to AI platforms for every keyword (e.g., 'Which tools do professional SEOs recommend for {keyword}?'). These run in addition to selected queryTemplates. Use plain English questions — the actor submits them verbatim. NOT query templates — these are literal prompts sent to AI.",
            "items": {
              "type": "string"
            }
          },
          "maxQueriesPerKeyword": {
            "title": "Max queries per keyword",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of unique queries to run per keyword across all templates. Each query × platform = one billed check, so higher values cost more. Default is 3 queries per keyword. Set to 5 for a deeper audit.",
            "default": 3
          },
          "responseFormat": {
            "title": "Response format",
            "enum": [
              "concise",
              "detailed"
            ],
            "type": "string",
            "description": "Controls how much of the AI's answer is stored in ai_answer_excerpt. 'concise' stores the first 300 characters (fewer tokens, lower storage). 'detailed' stores the first 600 characters (richer context for manual review). Does not affect which platforms are queried or what citations are tracked.",
            "default": "detailed"
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "An HTTPS URL that receives a POST request when the run completes. The payload is the full run summary JSON — visibility_score, citation_rate, content_gaps, top_cited_pages, recommendations. Compatible with Make.com, Zapier, n8n, Slack webhooks, and any HTTP endpoint."
          },
          "demoMode": {
            "title": "Demo / health check mode",
            "type": "boolean",
            "description": "Set to true to verify the actor is functional without making any AI API calls. The actor exits successfully with a confirmation message. Use for Apify scheduling tests, connectivity checks, or MCP tool validation without consuming credits.",
            "default": false
          },
          "country": {
            "title": "Country",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "DE",
              "FR",
              "ES",
              "IT",
              "NL",
              "IN",
              "BR",
              "MX",
              "JP",
              "SG",
              "AE",
              "ZA",
              "IE",
              "NZ",
              "SE",
              "PL"
            ],
            "type": "string",
            "description": "Country the AI answers and Google AI Overviews are localized for (two-letter code, e.g. US, GB, DE, FR, IN, AU, CA, JP, AE). Default US. Search volume uses the same country.",
            "default": "US"
          },
          "maxChecks": {
            "title": "Max checks per run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard limit on billed checks (keywords × queries × platforms) in one run. Extra planned checks are skipped and not charged. Also sets the run's memory: up to 200 uses 256 MB, up to 600 uses 512 MB, above that 1024 MB. Free plan runs are capped at 30.",
            "default": 200
          },
          "includeSearchVolume": {
            "title": "Include monthly search volume",
            "type": "boolean",
            "description": "Adds one search volume record per keyword (monthly searches, CPC, competition, keyword difficulty, intent, 12-month history) for the chosen country. Billed per keyword that has data, under the separate 'keyword search volume' price. Off by default; tick this box (or set includeSearchVolume to true) to turn it on. Needs at least 2 keywords per run.",
            "default": false
          },
          "trendMode": {
            "title": "Compare with last run",
            "type": "boolean",
            "description": "Adds a trend block to the summary: change in visibility score, citation rate and topic coverage versus your previous run for the same domain and country. The history is kept in your own named storage 'ai-visibility-history'.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}