{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Visibility Monitor - ChatGPT, Perplexity, Gemini, Claude",
    "description": "Monitor how visible your brand is in AI search answers (ChatGPT via OpenAI web search, Perplexity Sonar, Gemini grounding, Claude). Tracks mentions, list rank, sentiment, competitors and citations - with built-in run-over-run diff and webhook alerts.",
    "version": "0.1",
    "x-build-id": "tnkrOaDLF7Z1VnHcI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/glueworks~ai-visibility-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-glueworks-ai-visibility-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/glueworks~ai-visibility-monitor/runs": {
      "post": {
        "operationId": "runs-sync-glueworks-ai-visibility-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/glueworks~ai-visibility-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-glueworks-ai-visibility-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": [
          "brandTerms",
          "prompts",
          "platforms"
        ],
        "properties": {
          "brandTerms": {
            "title": "Brand terms",
            "type": "array",
            "description": "Your brand/product name plus aliases and common spellings, e.g. <code>[\"Apify\", \"apify.com\"]</code>. A prompt's answer counts as a mention if it contains any of these (case-insensitive, whole-word).",
            "items": {
              "type": "string"
            }
          },
          "competitorTerms": {
            "title": "Competitor terms (optional)",
            "type": "array",
            "description": "Competitor brand names to track alongside yours, e.g. <code>[\"Zyte\", \"Bright Data\"]</code>. Each check records which competitors were mentioned; changes in the competitor set trigger alerts too.",
            "items": {
              "type": "string"
            }
          },
          "prompts": {
            "title": "Prompts to ask the AI platforms",
            "type": "array",
            "description": "The questions a potential customer would ask an AI assistant, e.g. <code>\"best web scraping platforms\"</code> or <code>\"how do I monitor competitor prices automatically\"</code>. Each prompt is asked on every selected platform (prompt × platform = one check).",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "title": "AI platforms to check",
            "type": "array",
            "description": "Which AI answer engines to query, via their official APIs: <code>openai</code> (ChatGPT-grade answers via OpenAI Responses API + web_search), <code>perplexity</code> (Sonar), <code>gemini</code> (grounding with Google Search), <code>claude</code> (Anthropic web search tool).",
            "items": {
              "type": "string",
              "enum": [
                "openai",
                "perplexity",
                "gemini",
                "claude"
              ],
              "enumTitles": [
                "OpenAI (ChatGPT via web search API)",
                "Perplexity (Sonar)",
                "Google Gemini (Search grounding)",
                "Anthropic Claude (web search)"
              ]
            }
          },
          "openaiApiKey": {
            "title": "OpenAI API key",
            "type": "string",
            "description": "API key from platform.openai.com (used for the <code>openai</code> platform). Stored encrypted. Leave all keys empty to run a free demo with mock answers."
          },
          "perplexityApiKey": {
            "title": "Perplexity API key",
            "type": "string",
            "description": "API key from perplexity.ai/settings/api (used for the <code>perplexity</code> platform). Stored encrypted."
          },
          "geminiApiKey": {
            "title": "Google Gemini API key",
            "type": "string",
            "description": "API key from Google AI Studio (used for the <code>gemini</code> platform). Stored encrypted."
          },
          "anthropicApiKey": {
            "title": "Anthropic API key",
            "type": "string",
            "description": "API key from console.anthropic.com (used for the <code>claude</code> platform). Stored encrypted."
          },
          "openaiModel": {
            "title": "OpenAI model",
            "type": "string",
            "description": "Model used with the OpenAI Responses API web_search tool. Default: <code>gpt-5.6</code>. Any web-search-capable model id works.",
            "default": "gpt-5.6"
          },
          "perplexityModel": {
            "title": "Perplexity model",
            "type": "string",
            "description": "Perplexity Sonar model. Default: <code>sonar</code> (cheapest). Also: <code>sonar-pro</code>.",
            "default": "sonar"
          },
          "geminiModel": {
            "title": "Gemini model",
            "type": "string",
            "description": "Gemini model used with Google Search grounding. Default: <code>gemini-3.5-flash-lite</code> (cheapest grounding-capable tier).",
            "default": "gemini-3.5-flash-lite"
          },
          "anthropicModel": {
            "title": "Claude model",
            "type": "string",
            "description": "Claude model used with the Anthropic web search tool. Default: <code>claude-haiku-4-5</code> (cheapest).",
            "default": "claude-haiku-4-5"
          },
          "webhookUrl": {
            "title": "Webhook URL (alerts)",
            "type": "string",
            "description": "Full http(s) URL to POST an alert to whenever visibility changes vs. the previous run (brand appeared/dropped, rank moved, competitor set changed) — e.g. a Slack incoming webhook or an n8n/Make/Zapier webhook node. Each delivery is retried twice. Leave empty to only store results in the dataset."
          },
          "webhookFormat": {
            "title": "Webhook payload format",
            "enum": [
              "json",
              "slack",
              "discord"
            ],
            "type": "string",
            "description": "<code>json</code> sends the full structured change event (best for n8n/Make/Zapier). <code>slack</code> sends <code>{\"text\": ...}</code>. <code>discord</code> sends <code>{\"content\": ...}</code>.",
            "default": "json"
          },
          "language": {
            "title": "Answer language",
            "type": "string",
            "description": "Optional. Ask the platforms to answer in this language (e.g. <code>German</code>, <code>zh-TW</code>). Leave empty or <code>en</code> for English."
          },
          "maxChecksPerRun": {
            "title": "Max checks per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap on prompt × platform checks in a single run (cost guardrail). Default 100, hard limit 500.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}