# AI Search Visibility Tracker: ChatGPT & Perplexity (`zhtech/ai-search-visibility-tracker`) Actor

Track how ChatGPT and Perplexity answer your prompts through their official APIs, no scraping. Get every answer, cited URL and domain, brand mention, rank, share of voice vs competitors, sentiment, mention rate over samples and changes since your last run.

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

## Pricing

from $4.00 / 1,000 answer (your own api key)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Visibility Tracker: ChatGPT and Perplexity (Official APIs, No Scraping)

Find out whether ChatGPT and Perplexity recommend **your brand** when people ask about your market. Give it the prompts your buyers ask, your brand and your competitors. It asks each engine through its **official API with live web search on**, then returns every answer with **every cited URL and domain**, and the analysis you actually need:

- Is your brand mentioned? How many times? **Which position** (named first, second...) and **which place in the list**?
- **Share of voice** against your competitors, and **sentiment** for each brand.
- Is **your website cited** as a source? Which sites do the engines lean on?
- **Mention rate across samples** (AI answers change from one ask to the next, so each prompt is asked several times).
- **Monitor mode**: what changed since your last run (mention gained or lost, new or lost citations, competitors that appeared).

**Official APIs, no scraping.** ChatGPT answers come from the OpenAI Responses API with the web search tool. Perplexity answers come from the official Perplexity API (Sonar). The Actor never opens chatgpt.com or perplexity.ai, so it does not break when those apps change their pages, and it does not depend on scraping that their terms forbid.

### Important: API answers are not identical to the apps

The ChatGPT and Perplexity consumer apps add their own system prompts, memory, personalization, location and model versions. An API answer to the same prompt is **similar but not identical** to what a person sees in the app, and answers also vary between two asks in the same app. Use this Actor to measure **trends and relative visibility** (are you mentioned more or less often than last month, and more or less than competitors) rather than to reproduce one exact screen. Sampling each prompt several times is how serious AI visibility tools deal with this, and it is built in.

### What you get

Each run writes four kinds of rows to the dataset (column `rowType`), plus the same summaries as JSON in the key-value store.

#### 1. One row per answer (`rowType: answer`)

Example from the offline test suite (mocked API response, shortened):

```json
{
    "rowType": "answer",
    "status": "ok",
    "engine": "chatgpt",
    "model": "gpt-6-luna",
    "prompt": "best project management software",
    "sampleIndex": 1,
    "answerText": "Here are some of the best project management tools in 2026:\n\n1. **Asana**: A popular and intuitive choice...",
    "brand": "Asana",
    "brandMentioned": true,
    "brandMentionCount": 2,
    "brandRank": 1,
    "brandListPosition": 1,
    "brandFirstMentionPercent": 0.13,
    "brandCited": true,
    "brandSentiment": "positive",
    "shareOfVoice": 0.5,
    "mentionedCompetitors": ["Trello", "Monday.com"],
    "mentionOrder": ["Asana", "Monday.com", "Trello"],
    "competitorMentions": [
        { "name": "Trello", "mentioned": true, "mentionCount": 1, "rank": 3, "listPosition": 3, "shareOfVoice": 0.25, "cited": false, "sentiment": "mixed" },
        { "name": "Monday.com", "mentioned": true, "mentionCount": 1, "rank": 2, "listPosition": 2, "shareOfVoice": 0.25, "cited": false, "sentiment": "mixed" }
    ],
    "citations": [
        { "position": 1, "url": "https://asana.com/product", "title": "Asana product overview", "domain": "asana.com", "rootDomain": "asana.com", "ownedBy": "Asana", "ownerType": "brand" },
        { "position": 2, "url": "https://zapier.com/blog/best-project-management-software/", "domain": "zapier.com", "rootDomain": "zapier.com", "ownedBy": null }
    ],
    "citedDomains": ["asana.com", "zapier.com"],
    "sources": ["https://asana.com/product", "https://zapier.com/blog/best-project-management-software/", "https://www.g2.com/categories/project-management"],
    "searchQueries": ["best project management software 2026", "project management tools comparison"],
    "searchCalls": 1,
    "usage": { "inputTokens": 7120, "outputTokens": 980, "reasoningTokens": 512 },
    "keySource": "owner",
    "chargedEvent": "answer-chatgpt",
    "charged": true,
    "answeredAt": "2026-11-23T12:00:00.000Z"
}
```

| Field | Meaning |
|---|---|
| `brandMentioned`, `brandMentionCount` | Whole word, case insensitive match on your brand and aliases. Link targets and bare URLs are ignored, so `asana.com/pricing` inside a link does not count as a mention. |
| `brandRank` | Order of first mention among the tracked brands (1 = named before every competitor). |
| `brandListPosition` | Place of the first list item that names you, when the answer is a numbered list, headings or bullets. |
| `brandFirstMentionPercent` | How far into the answer you are first named (0 = first word, 1 = last). |
| `shareOfVoice` | Your mentions divided by all mentions of tracked brands in that answer. |
| `brandSentiment` | positive, negative, mixed or neutral, from a transparent word list over the sentences that name you (see Limitations). |
| `brandCited`, `brandCitationPositions` | Whether a cited URL is on one of your domains, and where in the citation list. |
| `citations` | Every cited URL with title, domain and owner (you, a competitor, or neither). |
| `sources` | Every URL the engine consulted (often more than it cited). |
| `searchQueries` | The web searches the engine ran for this answer (the "query fan out"). |

#### 2. One summary row per prompt and engine (`rowType: prompt_summary`)

`brandMentionRate` (for example 0.667 = named in 2 of 3 samples), `brandMentionedIn` ("2/3"), `avgBrandRank`, `bestBrandRank`, `avgBrandListPosition`, `brandCitedRate`, `shareOfVoice`, sentiment counts, `topCompetitor`, per competitor mention rate, rank and share of voice, and the top cited domains. When both engines run you also get an `engine: all` row.

#### 3. Citation domain table (`rowType: citation_domain`)

Every domain cited in this run, ranked: answers citing it, share of answers, prompts, engines, top URLs, and whether it is your site or a competitor's. This is your list of sites to get featured on.

#### 4. Changes since last run (`rowType: change`, monitor mode)

`brand_mention_gained`, `brand_mention_lost`, `brand_mention_rate_up` or `_down`, `brand_rank_improved` or `_dropped`, `brand_citation_gained` or `_lost`, `competitor_mention_gained` or `_lost`, `citation_domain_new` or `_lost`, `new_prompt_baseline`, `baseline_saved`.

The dataset has four views: **Answers**, **Prompt summary**, **Citation domains** and **Changes since last run**. The key-value store also holds `PROMPT_SUMMARIES`, `CITATION_DOMAINS`, `CHANGES` and `RUN_SUMMARY` as JSON.

### Use cases

- **GEO / AEO tracking**: measure how often AI assistants recommend you for your money prompts, every week.
- **Competitor benchmarking**: share of voice and rank against named competitors, per engine.
- **Content and PR targeting**: the citation domain table shows which review sites, blogs and directories the engines trust for your category.
- **Agency reporting**: one scheduled run per client with its own monitor key, export to Sheets or Looker Studio.
- **Launch checks**: did the new product name start showing up after the launch?

### How to use

1. Add your **prompts**, written the way a buyer asks ("best CRM for a small agency", "Asana vs Trello").
2. Enter your **brand**, optional aliases and your domain (so the Actor can tell when you are cited).
3. Add **competitors** (aliases after a pipe: `Monday.com | monday`) and optionally their domains (`Trello: trello.com`).
4. Pick engines and **samples per prompt** (3 is a good default).
5. Optional: paste your own OpenAI or Perplexity API key to pay the much lower bring-your-own-key price.
6. Optional: turn on **monitor mode** and schedule the Actor daily or weekly.

#### Input example

```json
{
    "prompts": ["best project management software", "best project management tool for a 10 person agency"],
    "brand": "Asana",
    "brandDomains": ["asana.com"],
    "competitors": ["Trello", "Monday.com | monday", "ClickUp"],
    "competitorDomains": ["Trello: trello.com", "ClickUp: clickup.com"],
    "engines": ["chatgpt", "perplexity"],
    "samplesPerPrompt": 3,
    "country": "US",
    "monitorMode": true,
    "monitorKey": "asana-us-weekly"
}
```

That is 2 prompts x 2 engines x 3 samples = 12 answers.

An empty input `{}` runs the example from the form (prompt "best project management software", brand Asana, competitors Trello and Monday.com), so a first test always does something useful.

### API keys: built-in or bring your own

- **Built-in access**: when it is available, you do not need any key; each answer is billed at the engine price below.
- **Bring your own key** (`openaiApiKey`, `perplexityApiKey`): the provider bills your own account and each answer here costs only the small `answer-byo-key` fee. Keys are secret inputs (stored encrypted by Apify), used only for that run, never written to the dataset, the logs or the key-value store.
- If no key is available for an engine, you get one clear `missing_api_key` row and **nothing is charged**.

Using your own key means the provider's terms (OpenAI usage policies, Perplexity Acceptable Use Policy) apply to your prompts.

### Pricing

Pay per event. Only **successful answers** are charged:

| Event | What it is |
|---|---|
| `actor-start` | Once per run, charged with the first successful answer (a run that gets no answer costs nothing). |
| `answer-chatgpt` | One ChatGPT answer on built-in access. |
| `answer-perplexity` | One Perplexity answer on built-in access. |
| `answer-byo-key` | One answer on either engine with your own API key. |

The analysis, summaries, citation table and change rows are included and never charged separately. Errors, empty answers, rejected keys and rate limits are free. The run checks your **max total charge** before every API call and stops cleanly when the next answer would go over it. See the Pricing tab for current prices.

Cost tip: the bill is prompts x engines x samples. Start with 1 sample to shape your prompt list, then use 3 for tracking.

### Integrations and API

- **Schedules**: Apify Console > Schedules, same input, monitor mode on. Change rows tell you what moved.
- **Webhooks, Zapier, Make, n8n, Google Sheets**: send the Prompt summary or Changes view anywhere.
- **API**: `POST https://api.apify.com/v2/acts/zhtech~ai-search-visibility-tracker/run-sync-get-dataset-items?token=YOUR_TOKEN&view=summary` with the input JSON as the body.
- **LLM agents and MCP**: the Actor works as a tool in the Apify MCP server, so an AI agent can ask "how visible is my brand for these prompts" and get structured rows back.

### FAQ

**Is this scraping ChatGPT or Perplexity?** No. It only calls the official OpenAI and Perplexity APIs, the channels both companies provide for programmatic use.

**Why do my results differ from what I see in the ChatGPT app?** See "API answers are not identical to the apps" above. Expect the same direction, not the same words.

**Which models are used?** ChatGPT: a small, low cost OpenAI model with web search (`gpt-6-luna` by default, changeable in Advanced). Perplexity: `perplexity/sonar` through the Agent API. Model names live in one config file and are reviewed monthly.

**How is a mention detected?** Whole word, case insensitive matching on the names and aliases you give. "Asana" matches "ASANA" but not "Asanas". Names that are also common words (a brand called "Monday") should be entered in their distinctive form ("Monday.com").

**How does sentiment work?** A transparent word list (best, intuitive, reliable / expensive, complex, limited, steep learning curve...) with simple negation ("not ideal" counts as negative), applied only to sentences that name the brand. It is a quick signal, not a human judgement. The full `answerText` is always included so you can check.

**Does monitor mode store my data?** It saves a small snapshot (mention rates, competitor names, cited domains and URLs, no answer text, no keys) in a named key-value store `ai-search-visibility-monitor` on your own Apify account. A run where an engine fails never overwrites that engine's saved snapshot.

**Can I track a non English market?** Yes, write the prompts in that language and set `country` for local web results on ChatGPT.

### Limitations

- API answers differ from the consumer apps (see above), and both engines are non deterministic. Use samples.
- Brand matching is name based. A brand name that is also a common word can create false positives; use a distinctive alias.
- Sentiment is a keyword heuristic. A sentence comparing two brands gives both the same words.
- Rank is the order of first mention among the brands you track, not a position assigned by the engine.
- `country` is passed to OpenAI web search only.
- Perplexity is moving its API from Sonar Chat Completions to the Agent API; the Actor parses both shapes and lets you switch mode in Advanced.

# Actor input Schema

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

Questions people ask an AI assistant, one per line. Write them the way a buyer would: "best project management software", "Asana vs Trello for a small agency", "which CRM should a 10 person startup use". Duplicates are merged. Max 200 prompts, 1,000 characters each.

## `brand` (type: `string`):

The brand to look for in every answer, for example Asana. Matching ignores case and whole words only (Asana does not match Asanas). Add other spellings below.

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

Other spellings or product names that count as your brand, for example "Asana Work Management" or a former name.

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

Your websites, for example asana.com. Used to tell when an answer cites YOUR site as a source (subdomains count). A brand name that is itself a domain, like Monday.com, is added automatically.

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

Competitor names, one per line. Add other spellings after a pipe: "Monday.com | monday". Each answer reports which competitors were named, in what order, their share of voice and sentiment.

## `competitorDomains` (type: `array`):

One line per competitor as "Name: domain", for example "Trello: trello.com". Citations to these domains are labeled with the competitor.

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

chatgpt = OpenAI Responses API with web search. perplexity = Perplexity Sonar through the official Perplexity API. Both are asked through official APIs only, never by scraping the consumer apps.

## `samplesPerPrompt` (type: `integer`):

How many times each prompt is asked on each engine. AI answers vary from one ask to the next, so the summary reports a mention rate across samples (for example 2 of 3). 3 is a good balance of signal and cost. Each sample is one billed answer.

## `maxAnswers` (type: `integer`):

Safety cap on billed answers in one run (prompts x engines x samples). The run also stops at the max total charge you set.

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

Two letter country code (US, GB, DE...) passed to OpenAI web search as the approximate user location, so local results match that market. Leave empty for no location.

## `monitorMode` (type: `boolean`):

Saves a snapshot after each run in a named key-value store (ai-search-visibility-monitor) on your account and adds change rows: brand mention gained or lost, mention rate or rank moved, your domain cited or dropped, competitors and cited domains that appeared or disappeared. Schedule the Actor daily or weekly with the same input.

## `monitorKey` (type: `string`):

Name of the saved snapshot. Runs with the same key are compared. Defaults to monitor-<brand>. Use different keys for different projects or markets.

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

Optional. With your own key the OpenAI cost goes on your OpenAI bill and each answer is billed here at the much lower bring-your-own-key price. Stored encrypted by Apify, used only for this run, never logged or saved to the output. Create one at platform.openai.com.

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

Optional. Same as above for Perplexity. Create one in the Perplexity API settings. Never logged or saved to the output.

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

Any OpenAI model that supports the web_search tool in the Responses API. The default is a small, low cost model. Bigger models give answers closer to the ChatGPT app but cost more on your own key (the price per answer here does not change).

## `reasoningEffort` (type: `string`):

For reasoning models only. low is fast and cheap and still searches the web.

## `searchContextSize` (type: `string`):

How much web search content the model reads. low is cheapest; high reads more sources.

## `perplexityMode` (type: `string`):

agent = Perplexity Agent API (current, recommended). sonar = legacy Sonar endpoint, only if your account still uses it.

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

Leave empty for perplexity/sonar (agent mode) or sonar (legacy mode).

## `includeAnswerText` (type: `boolean`):

Turn off to keep only the analysis and citations (smaller exports).

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

How many API calls run at the same time. Lower it if your own key has low rate limits.

## Actor input object example

```json
{
  "prompts": [
    "best project management software"
  ],
  "brand": "Asana",
  "competitors": [
    "Trello",
    "Monday.com"
  ],
  "engines": [
    "chatgpt",
    "perplexity"
  ],
  "samplesPerPrompt": 3,
  "maxAnswers": 300,
  "monitorMode": false,
  "openaiModel": "gpt-6-luna",
  "reasoningEffort": "low",
  "searchContextSize": "low",
  "perplexityMode": "agent",
  "includeAnswerText": true,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `answers` (type: `string`):

No description

## `promptSummaries` (type: `string`):

No description

## `citationDomains` (type: `string`):

No description

## `changes` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# 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 project management software"
    ],
    "brand": "Asana",
    "competitors": [
        "Trello",
        "Monday.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhtech/ai-search-visibility-tracker").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 project management software"],
    "brand": "Asana",
    "competitors": [
        "Trello",
        "Monday.com",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("zhtech/ai-search-visibility-tracker").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 project management software"
  ],
  "brand": "Asana",
  "competitors": [
    "Trello",
    "Monday.com"
  ]
}' |
apify call zhtech/ai-search-visibility-tracker --silent --output-dataset

```

## MCP server setup

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

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/jDdTcrYNC0Wjt0p7b/builds/RL4EB7x3WnRMng1jl/openapi.json
