# Google AI Overviews, Perplexity & ChatGPT GEO Monitor (`vesper_studio/ai-search-geo-visibility-monitor`) Actor

Monitor Generative Engine Optimization (GEO) brand visibility, citation URLs, Share of Voice, sentiment & competitors across Google AI Overviews, Perplexity, OpenAI Web Search, and DuckDuckGo grounding. Supports BYOK API or HTTP fallback, weekly delta alerts, Looker Studio & n8n.

- **URL**: https://apify.com/vesper_studio/ai-search-geo-visibility-monitor.md
- **Developed by:** [Xavier Richard](https://apify.com/vesper_studio) (community)
- **Categories:** AI, SEO tools, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 ai search prompt checked & analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Search & GEO Brand Visibility Monitor (`ai-search-geo-visibility-monitor`)

Monitor **brand mentions, source citation URLs, appearance rank, sentiment, and Share of Voice (SOV)** across AI answer engines (**Google AI Overviews, Perplexity, OpenAI Web Search, and DuckDuckGo Web Grounding**) — built for **SEO/GEO agencies**, **SaaS growth teams**, and **automated n8n / Make / Looker Studio / Google Sheets reporting**.

Replace $95–$495/month SaaS subscriptions with a lightweight (**256–512 MB RAM**), Pay-Per-Event Apify Actor you control with **Bring-Your-Own-Key (BYOK)** APIs and transparent direct HTTP adapters.

***

### Key Capabilities

- **Multi-Engine Transparent Architecture (BYOK + Clean Direct HTTP)**:
  - `google_ai_overview`: Uses **SerpApi** (`serpApiKey`, including `page_token` follow-up for lazy-loaded `text_blocks` + `references`), **Google Custom Search JSON API** (`googleCseKey` + `googleCseCx`), or direct HTTP (`curl_cffi` Chrome TLS + `selectolax` Lexbor parser).
  - `perplexity`: Uses **Perplexity Sonar API** (`perplexityApiKey`, parsing `choices`, `citations`, and `search_results`) or direct HTTP.
  - `openai_web_search`: Uses **OpenAI Responses API** (`web_search` tool `url_citation` annotations + `web_search_call.action.sources`) or **Search Chat Completions** (`gpt-4o-mini-search-preview`) with `openaiApiKey`, or direct HTTP.
  - `duckduckgo_search`: Zero-key live web grounding via DuckDuckGo Lite (`lite.duckduckgo.com`) for immediate out-of-the-box visibility checks.
  - **No CAPTCHA/Turnstile Bypass**: If a direct HTTP endpoint returns an anti-bot, JS-gate (`enablejs`), consent wall, or SPA shell without rendered answers, the Actor never attempts to solve or bypass it — it cleanly outputs `status: "blocked_requires_api_or_proxy"` with actionable guidance.
- **Deterministic GEO Analyzer (`src/analyzer.py`)**:
  - `brandMentioned`, `brandMentionCount`, `brandFirstPosition` (1-based appearance rank among tracked brands)
  - `brandCited` (exact domain & subdomain matching against `brandDomains`), `brandCitationCount`, `brandFirstCitationRank`, `brandCitedUrls`
  - `competitorsMentioned` (per-competitor mentions, rank, citations, sentiment) + flat `competitorsSummaryCsv`
  - `sentiment` (`positive`, `neutral`, `negative`, `mixed`, `not_mentioned`) & `sentimentScore` (-1.0 to 1.0)
  - `shareOfVoiceScore` (0–100 weighted by mention count, rank prominence `1/pos`, and citation share)
- **Weekly Delta Monitoring (`onlyChanges`)**:
  - Persists compact per-`(engine, prompt)` snapshots in a persistent named Apify Key-Value Store (`geo-visibility-state` or custom `stateKey` per client), flushing safely on `ABORTING` signals.
  - Flags `visibilityGained`, `visibilityLost`, `newCompetitorAppeared`, `newCompetitors`, and `shareOfVoiceDelta`.
  - Enable `onlyChanges: true` on a weekly Apify Schedule to emit only prompts whose visibility changed.
- **Flat CSV / Looker Studio / Google Sheets / n8n Ready**:
  - Every dataset row represents one `(prompt, engine)` observation with flat scalar KPIs alongside structured `citations` and `competitorsMentioned` arrays.

***

### Example Input

```json
{
  "prompts": [
    "best CRM software for small business",
    "HubSpot vs Salesforce pricing for mid-market teams"
  ],
  "brandName": "HubSpot",
  "brandDomains": ["hubspot.com"],
  "brandAliases": ["HubSpot CRM", "Marketing Hub"],
  "competitors": [
    {
      "name": "Salesforce",
      "domains": ["salesforce.com"],
      "aliases": ["SFDC", "Sales Cloud"]
    },
    {
      "name": "Pipedrive",
      "domains": ["pipedrive.com"],
      "aliases": []
    }
  ],
  "engines": [
    "google_ai_overview",
    "perplexity",
    "openai_web_search",
    "duckduckgo_search"
  ],
  "country": "us",
  "language": "en",
  "onlyChanges": false,
  "openaiApiKey": "<optional-secret>",
  "perplexityApiKey": "<optional-secret>",
  "serpApiKey": "<optional-secret>"
}
```

***

### Output Dataset Example

```json
{
  "promptKey": "perplexity::8f4c1a90b2e3d411",
  "checkedAt": "2026-11-14T00:40:00Z",
  "prompt": "best CRM software for small business",
  "engine": "perplexity",
  "answerSource": "perplexity_sonar_api",
  "status": "ok",
  "statusReason": "",
  "country": "us",
  "language": "en",
  "brandName": "HubSpot",
  "brandMentioned": true,
  "brandMentionCount": 2,
  "brandFirstPosition": 1,
  "brandCited": true,
  "brandCitationCount": 1,
  "brandFirstCitationRank": 2,
  "brandCitedUrls": ["https://blog.hubspot.com/sales/best-crm"],
  "sentiment": "positive",
  "sentimentScore": 0.75,
  "shareOfVoiceScore": 58.33,
  "competitorsMentionedCount": 1,
  "competitorsMentionedNames": ["Salesforce"],
  "competitorsCitedNames": ["Salesforce"],
  "competitorsSummaryCsv": "Salesforce (pos=2, mentions=1, cited=true)",
  "topCitedDomain": "forbes.com",
  "allCitedDomains": ["forbes.com", "blog.hubspot.com", "salesforce.com"],
  "isFirstRunForPrompt": false,
  "visibilityGained": true,
  "visibilityLost": false,
  "newCompetitorAppeared": false,
  "newCompetitors": [],
  "shareOfVoiceDelta": 12.5,
  "hasChanged": true
}
```

#### Key-Value Store `OUTPUT` Summary

Each run writes an aggregated KPI report to `OUTPUT` (`mentionRatePct`, `citationRatePct`, `averageShareOfVoice`, `byEngine`, `topCitedDomains`, `visibilityGainedCount`, `visibilityLostCount`, `newCompetitorAppearedCount`).

***

### Agency Workflows: Looker Studio, Google Sheets & n8n

- **Google Sheets / Looker Studio**:
  - Point `IMPORTDATA` or Looker Studio's Apify / CSV connector to:
    `https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=csv&clean=true`
  - Slice by `prompt`, `engine`, `brandMentioned`, `brandFirstPosition`, `shareOfVoiceScore`, and `sentiment`.
- **n8n Weekly Delta Alerts**:
  1. Schedule the Actor weekly with `onlyChanges: true` and a client-specific `stateKey` (e.g. `geo_client_acme`).
  2. Trigger an n8n Webhook on `ACTOR.RUN.SUCCEEDED`.
  3. Fetch dataset items and route `visibilityLost == true` or `newCompetitorAppeared == true` to Slack / Microsoft Teams / client email digests.

***

### Pay-Per-Event Billing (`prompt-checked`)

- Charges `prompt-checked` **only** when a check obtains real upstream data (`status` is `ok` or `no_ai_overview`).
- Requests returning `blocked_requires_api_or_proxy` or `error` are **not charged**.
- Strictly enforces Apify's `maxTotalChargeUsd` budget limit via slot reservation before executing concurrent checks.

***

### Local Development & Tests

```bash
python -m venv .venv
pip install -r requirements.txt -r requirements-dev.txt
pytest -v
```

# Actor input Schema

## `prompts` (type: `array`):

List of buyer-intent questions or commercial search prompts to test across AI search engines (e.g., 'best CRM software for startups', 'HubSpot vs Salesforce pricing').

## `brandName` (type: `string`):

Your brand or client's primary brand name to track across AI answers.

## `brandDomains` (type: `array`):

Owned domains (and subdomains) to detect in cited source URLs (e.g., 'hubspot.com', 'academy.hubspot.com').

## `brandAliases` (type: `array`):

Alternative names, product lines, or common spellings for the brand (e.g., 'HubSpot CRM', 'Marketing Hub').

## `competitors` (type: `array`):

Competitors to measure Share of Voice against. Each entry can be a simple string ('Salesforce') or an object { "name": "Salesforce", "domains": \["salesforce.com"], "aliases": \["SFDC", "Sales Cloud"] }.

## `engines` (type: `array`):

Engines to query. Provide BYOK API keys below for native production extraction on Google AI Overviews, Perplexity, and OpenAI Web Search. Without API keys, direct HTTP runs cleanly without solving CAPTCHAs and (when fallbackToPublicSearch is enabled) falls back to honest live public web-search grounding labeled `status: fallback_grounding` / `answerSource: public_search_fallback`. 'duckduckgo_search' runs zero-key live web grounding.

## `country` (type: `string`):

Two-letter country code for localized search results (e.g., 'us', 'fr', 'gb', 'de').

## `language` (type: `string`):

Two-letter language code for prompts and Google hl parameter (e.g., 'en', 'fr', 'es', 'de').

## `onlyChanges` (type: `boolean`):

When enabled, compares current run against the Key-Value Store snapshot from the previous run and only pushes rows where visibilityGained, visibilityLost, newCompetitorAppeared, or cited domains changed.

## `stateKey` (type: `string`):

Named Apify Key-Value Store used to persist weekly delta snapshots across runs (alphanumeric and hyphens). Override per client/campaign if sharing one Actor across multiple clients.

## `includeRawAnswer` (type: `boolean`):

Include the full/truncated AI answer text in each dataset row for qualitative audits.

## `fallbackToPublicSearch` (type: `boolean`):

When enabled (default), if a direct engine endpoint (Google, Perplexity, ChatGPT) is gated and no BYOK API key is provided, automatically fall back to live keyless public web-search grounding (Ecosia organic + DuckDuckGo Lite + Wikipedia) clearly labeled `status: fallback_grounding` and `answerSource: public_search_fallback`. Disable to strictly emit `blocked_requires_api_or_proxy`.

## `openaiApiKey` (type: `string`):

Optional OpenAI API key for OpenAI Web Search (Responses API / Search models). Stored securely as a secret.

## `openaiModel` (type: `string`):

OpenAI model used when openaiApiKey is supplied (e.g., 'gpt-4o-mini', 'gpt-4.1-mini', 'gpt-4o-mini-search-preview').

## `perplexityApiKey` (type: `string`):

Optional Perplexity API key for Sonar web-grounded citations. Stored securely as a secret.

## `perplexityModel` (type: `string`):

Perplexity Sonar model used when perplexityApiKey is supplied (e.g., 'sonar', 'sonar-pro').

## `serpApiKey` (type: `string`):

Optional SerpApi key for live Google Search + Google AI Overview text_blocks and references.

## `googleCseKey` (type: `string`):

Optional Google Custom Search JSON API key (fallback grounding when serpApiKey is not set).

## `googleCseCx` (type: `string`):

Programmable Search Engine ID (cx) paired with googleCseKey.

## `maxConcurrency` (type: `integer`):

Maximum concurrent prompt-engine requests (1-10). Keep 2-4 for 256 MB memory.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy configuration for direct HTTP adapters (residential proxies recommended if querying direct Google SERPs without SerpApi).

## Actor input object example

```json
{
  "prompts": [
    "best CRM software for small business",
    "HubSpot vs Salesforce for mid-market teams"
  ],
  "brandName": "HubSpot",
  "brandDomains": [
    "hubspot.com"
  ],
  "brandAliases": [
    "HubSpot CRM"
  ],
  "competitors": [
    {
      "name": "Salesforce",
      "domains": [
        "salesforce.com"
      ],
      "aliases": [
        "SFDC",
        "Sales Cloud"
      ]
    },
    {
      "name": "Pipedrive",
      "domains": [
        "pipedrive.com"
      ],
      "aliases": []
    },
    {
      "name": "Zoho CRM",
      "domains": [
        "zoho.com"
      ],
      "aliases": [
        "Zoho"
      ]
    }
  ],
  "engines": [
    "google_ai_overview",
    "perplexity",
    "openai_web_search",
    "duckduckgo_search"
  ],
  "country": "us",
  "language": "en",
  "onlyChanges": false,
  "stateKey": "geo-visibility-state",
  "includeRawAnswer": true,
  "fallbackToPublicSearch": true,
  "openaiModel": "gpt-4o-mini",
  "perplexityModel": "sonar",
  "maxConcurrency": 4
}
```

# Actor output Schema

## `visibilityRecords` (type: `string`):

Flat CSV/Looker-ready GEO metrics per (prompt, engine): brand mentions, position rank, cited domains, sentiment, Share of Voice score, competitor breakdown, and weekly delta flags. Append ?format=csv or ?format=json for Google Sheets, Looker Studio, or n8n.

## `summary` (type: `string`):

Aggregated GEO KPIs: overall mention rate, citation rate, average Share of Voice, per-engine breakdown, top cited domains, and delta alert counts.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "prompts": [
        "best CRM software for small business",
        "HubSpot vs Salesforce for mid-market teams"
    ],
    "brandName": "HubSpot",
    "brandDomains": [
        "hubspot.com"
    ],
    "brandAliases": [
        "HubSpot CRM"
    ],
    "competitors": [
        {
            "name": "Salesforce",
            "domains": [
                "salesforce.com"
            ],
            "aliases": [
                "SFDC",
                "Sales Cloud"
            ]
        },
        {
            "name": "Pipedrive",
            "domains": [
                "pipedrive.com"
            ],
            "aliases": []
        },
        {
            "name": "Zoho CRM",
            "domains": [
                "zoho.com"
            ],
            "aliases": [
                "Zoho"
            ]
        }
    ],
    "engines": [
        "google_ai_overview",
        "perplexity",
        "openai_web_search",
        "duckduckgo_search"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vesper_studio/ai-search-geo-visibility-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "prompts": [
        "best CRM software for small business",
        "HubSpot vs Salesforce for mid-market teams",
    ],
    "brandName": "HubSpot",
    "brandDomains": ["hubspot.com"],
    "brandAliases": ["HubSpot CRM"],
    "competitors": [
        {
            "name": "Salesforce",
            "domains": ["salesforce.com"],
            "aliases": [
                "SFDC",
                "Sales Cloud",
            ],
        },
        {
            "name": "Pipedrive",
            "domains": ["pipedrive.com"],
            "aliases": [],
        },
        {
            "name": "Zoho CRM",
            "domains": ["zoho.com"],
            "aliases": ["Zoho"],
        },
    ],
    "engines": [
        "google_ai_overview",
        "perplexity",
        "openai_web_search",
        "duckduckgo_search",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("vesper_studio/ai-search-geo-visibility-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "prompts": [
    "best CRM software for small business",
    "HubSpot vs Salesforce for mid-market teams"
  ],
  "brandName": "HubSpot",
  "brandDomains": [
    "hubspot.com"
  ],
  "brandAliases": [
    "HubSpot CRM"
  ],
  "competitors": [
    {
      "name": "Salesforce",
      "domains": [
        "salesforce.com"
      ],
      "aliases": [
        "SFDC",
        "Sales Cloud"
      ]
    },
    {
      "name": "Pipedrive",
      "domains": [
        "pipedrive.com"
      ],
      "aliases": []
    },
    {
      "name": "Zoho CRM",
      "domains": [
        "zoho.com"
      ],
      "aliases": [
        "Zoho"
      ]
    }
  ],
  "engines": [
    "google_ai_overview",
    "perplexity",
    "openai_web_search",
    "duckduckgo_search"
  ]
}' |
apify call vesper_studio/ai-search-geo-visibility-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vesper_studio/ai-search-geo-visibility-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ncpsIEiDKF5eRrmrQ/builds/OTYffoK6itrsq0Er6/openapi.json
