{
  "openapi": "3.0.1",
  "info": {
    "title": "Ai Search Visibility Tracker",
    "description": "Monitor how AI answer engines mention your brand across prompts and countries. Detect target/competitor mentions, extract cited domains/URLs, and export clean datasets for weekly tracking and reporting on Apify.",
    "version": "0.1",
    "x-build-id": "X6iKarFCCC06BQgpI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~ai-search-visibility-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-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/coregent~ai-search-visibility-tracker/runs": {
      "post": {
        "operationId": "runs-sync-coregent-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/coregent~ai-search-visibility-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-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": [
          "targetName"
        ],
        "properties": {
          "template": {
            "title": "Template",
            "enum": [
              "custom",
              "agency",
              "saas",
              "ecommerce",
              "local"
            ],
            "type": "string",
            "description": "Choose a preset prompt pack. 'custom' requires your own queries. Other templates auto-generate queries from seed keywords.",
            "default": "custom"
          },
          "seedKeywords": {
            "title": "Seed Keywords",
            "type": "array",
            "description": "Keywords/topics used to generate prompts when using a non-custom template (e.g., 'youtube analytics', 'plumber').",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "locations": {
            "title": "Locations (for local template)",
            "type": "array",
            "description": "Cities or areas for local query generation (required for local template when queries are empty).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "queries": {
            "title": "Queries",
            "type": "array",
            "description": "Prompts or search questions to test against AI engines. Optional when using a non-custom template with seed keywords.",
            "items": {
              "type": "string"
            }
          },
          "queryGroups": {
            "title": "Query Groups",
            "type": "array",
            "description": "Group queries by label for agency-friendly reporting. If provided, overrides the queries field. Each group: { \"groupName\": \"...\", \"queries\": [...] }.",
            "items": {
              "type": "object",
              "properties": {
                "groupName": {
                  "title": "Group Name",
                  "type": "string",
                  "description": "Label for this query group (e.g., 'Brand awareness')."
                },
                "queries": {
                  "title": "Queries",
                  "type": "array",
                  "description": "List of queries in this group.",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "groupName",
                "queries"
              ]
            },
            "default": []
          },
          "targetName": {
            "title": "Target Name",
            "type": "string",
            "description": "Brand, product, person, domain, or topic to track visibility for."
          },
          "targetAliases": {
            "title": "Target Aliases",
            "type": "array",
            "description": "Alternate brand names, spelling variants, or abbreviations (e.g., 'Gitoken.app', 'Gitoken AI').",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "competitors": {
            "title": "Competitors",
            "type": "array",
            "description": "Competitor names or domains to detect in AI answers.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "engines": {
            "title": "Engines",
            "type": "array",
            "description": "AI search engines to query. Perplexity is stable; Google AI is experimental.",
            "items": {
              "type": "string",
              "enum": [
                "perplexity",
                "google_ai"
              ],
              "enumTitles": [
                "Perplexity (stable)",
                "Google AI Overview (experimental)"
              ]
            },
            "default": [
              "perplexity"
            ]
          },
          "country": {
            "title": "Country",
            "enum": [
              "US",
              "GB",
              "AU",
              "CA",
              "DE",
              "FR",
              "ES",
              "IT",
              "NL",
              "SE",
              "NO",
              "DK",
              "FI",
              "BR",
              "MX",
              "IN",
              "JP",
              "KR",
              "SG",
              "NZ",
              "IE",
              "AT",
              "CH",
              "BE",
              "PT",
              "PL",
              "CZ",
              "ZA",
              "AE",
              "IL"
            ],
            "type": "string",
            "description": "Country code for market-specific results.",
            "default": "US"
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "de",
              "fr",
              "es",
              "it",
              "pt",
              "nl",
              "sv",
              "no",
              "da",
              "fi",
              "pl",
              "cs",
              "ja",
              "ko",
              "zh",
              "ar",
              "hi",
              "he"
            ],
            "type": "string",
            "description": "Language code for results.",
            "default": "en"
          },
          "includeAnswerText": {
            "title": "Include Answer Text",
            "type": "boolean",
            "description": "Include the full extracted AI answer text in output.",
            "default": true
          },
          "includeSources": {
            "title": "Include Sources",
            "type": "boolean",
            "description": "Include cited source URLs and domains in output.",
            "default": true
          },
          "includeCompetitors": {
            "title": "Include Competitor Detection",
            "type": "boolean",
            "description": "Check for competitor mentions in answers and sources.",
            "default": false
          },
          "deduplicateSources": {
            "title": "Deduplicate Sources",
            "type": "boolean",
            "description": "Remove duplicate source URLs within each result.",
            "default": true
          },
          "saveScreenshot": {
            "title": "Save Screenshot",
            "type": "boolean",
            "description": "Save a screenshot of each AI answer page to Key-Value Store.",
            "default": false
          },
          "saveHtml": {
            "title": "Save HTML",
            "type": "boolean",
            "description": "Save raw HTML of each AI answer page to Key-Value Store.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of browser pages open at once.",
            "default": 1
          },
          "navigationTimeoutSecs": {
            "title": "Navigation Timeout (seconds)",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time to wait for a page to load.",
            "default": 60
          },
          "maxRetries": {
            "title": "Max Retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum retries for failed page loads.",
            "default": 2
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional proxy settings. Provide your own proxy configuration if needed."
          },
          "debugMode": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Enable verbose logging and include debug info in output.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}