{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Search Visibility Auditor",
    "description": "Check if ChatGPT, Claude, Perplexity and Gemini can find, read and cite your website. Audits AI crawler access, firewall blocks, JS rendering, schema, llms.txt and citability, generates llms.txt, and tracks your brand's share of voice in AI answers.",
    "version": "1.0",
    "x-build-id": "YUPX816h96sR3aEmJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codepal~ai-search-visibility-auditor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codepal-ai-search-visibility-auditor",
        "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/codepal~ai-search-visibility-auditor/runs": {
      "post": {
        "operationId": "runs-sync-codepal-ai-search-visibility-auditor",
        "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/codepal~ai-search-visibility-auditor/run-sync": {
      "post": {
        "operationId": "run-sync-codepal-ai-search-visibility-auditor",
        "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": {
          "startUrls": {
            "title": "Websites to audit",
            "type": "array",
            "description": "Home page or any page of each website. Pages on the same site are grouped; the auditor also adds pages from the sitemap and home-page links.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxPagesPerSite": {
            "title": "Max pages per site",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many pages to audit per website (home page included). Each page is one billable event.",
            "default": 20
          },
          "includeSitemapPages": {
            "title": "Add pages from sitemap",
            "type": "boolean",
            "description": "Audit pages listed in sitemap.xml in addition to your start URLs and home-page links.",
            "default": true
          },
          "testBotAccess": {
            "title": "Test live AI crawler access",
            "type": "boolean",
            "description": "Fetch the home page with each AI bot's user agent to catch CDN/firewall blocks (e.g. Cloudflare 'Block AI bots') that robots.txt does not show.",
            "default": true
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Skip pages your robots.txt disallows for all crawlers.",
            "default": true
          },
          "generateLlmsTxt": {
            "title": "Generate llms.txt",
            "type": "boolean",
            "description": "Save a ready-to-upload llms.txt for each site in the key-value store (LLMS_TXT_<domain>).",
            "default": true
          },
          "checkAiAnswers": {
            "title": "Track brand in AI answers",
            "type": "boolean",
            "description": "Ask AI models the questions your customers ask and measure how often (and how high) your brand is recommended vs competitors. Uses your own API key.",
            "default": false
          },
          "brandName": {
            "title": "Brand name",
            "type": "string",
            "description": "Your brand or business name as customers know it."
          },
          "brandAliases": {
            "title": "Other names for your brand",
            "type": "array",
            "description": "Short names, old names or product names that count as a mention.",
            "items": {
              "type": "string"
            }
          },
          "brandDomain": {
            "title": "Brand domain",
            "type": "string",
            "description": "Your domain (e.g. acme.co.ke) to detect when AI cites your site. Defaults to the first website above."
          },
          "competitors": {
            "title": "Competitors",
            "type": "array",
            "description": "One per line. Optionally add the domain after a pipe: 'SunKing|sunking.com'.",
            "items": {
              "type": "string"
            }
          },
          "questions": {
            "title": "Questions customers ask AI",
            "type": "array",
            "description": "e.g. 'Best solar installer in Nairobi', 'Which CRM is best for small businesses in Kenya?'. Each question × model × sample is one AI answer.",
            "items": {
              "type": "string"
            }
          },
          "aiModels": {
            "title": "AI models",
            "type": "array",
            "description": "Model names for your API provider. Add several to compare models.",
            "items": {
              "type": "string"
            }
          },
          "aiBaseUrl": {
            "title": "AI API base URL",
            "type": "string",
            "description": "Any OpenAI-compatible Chat Completions API: OpenAI (default), OpenRouter (https://openrouter.ai/api/v1, lets you query Claude, Gemini, Perplexity, Llama…), Groq, Together, Azure, or a local server.",
            "default": "https://api.openai.com/v1"
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "Your key for the provider above. Stored encrypted; you pay the provider directly for tokens."
          },
          "samplesPerQuestion": {
            "title": "Samples per question",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "AI answers vary; ask each question several times for a more stable share of voice.",
            "default": 1
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Runs with the same name are compared, so scheduled runs show gains and losses since last time.",
            "default": "default"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. Receives a JSON summary with a 'text' field (works with Slack/Teams/Discord-compatible webhooks, Zapier, Make, n8n)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}