# AI Answer Visibility Checker (ChatGPT + Perplexity) (`milamikeymedia/ai-answer-visibility-checker`) Actor

Check whether ChatGPT (OpenAI API with web search) and Perplexity name your brand, cite your website, and which competitors they mention. Bring your own API keys. Pay only for successful checks.

- **URL**: https://apify.com/milamikeymedia/ai-answer-visibility-checker.md
- **Developed by:** [Mila & Mikey Media](https://apify.com/milamikeymedia) (community)
- **Categories:** SEO tools, AI, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$25.00 / 1,000 engine checks

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 Answer Visibility Checker (ChatGPT + Perplexity)

**Does ChatGPT or Perplexity recommend your business, cite your website, or name your competitors instead?**
Give this Actor a brand, its website, and the questions your customers ask. It asks each question through the
**official OpenAI and Perplexity APIs with live web search**, then tells you, per engine and per question:

- **Mentioned?** `true`, `false`, or `unclear` (only part of the name appeared)
- **Where:** sentence number, and the **list rank** when the answer is a "top 5" style list
- **Cited?** whether your own domain is among the answer's source links, and whether the answer links your
  business's map listing (`place_cited`; ChatGPT often links local businesses to a Google Maps search, not their site)
- **Competitors named:** other businesses the answer recommends
- **Citations:** every source URL the engine linked
- **A 0–100 visibility score** per engine, per question, and for the whole run

One run gives you a side-by-side report for both engines, which is the point: you don't need one scraper per engine.

### Who it's for

- Local businesses and the agencies that serve them ("Who's the best dentist in Fremont, NE?")
- SEO / GEO consultants tracking AI-search visibility for clients week to week
- Brands checking whether AI answers name competitors and not them

### How much does it cost?

**$0.025 per successful engine check** (one question answered by one engine and analysed).

- 10 questions × 2 engines = **$0.50** per run.
- **Failed checks are never charged:** bad or missing key, rate limits, timeouts, provider errors, unreadable answers.
- **Bring your own API keys.** OpenAI and Perplexity bill your own accounts for the API calls. As a rough guide from
  their published prices (Nov 2026, not a quote): about **$0.012** per OpenAI check (gpt-4o-mini + web_search) and
  about **$0.004** per Perplexity check (sonar + one standard search). Actual cost depends on how many searches the
  model runs. Each result includes the token and search counts the provider reported so you can audit your bill.
- Set a **maximum charge** for the run in Apify. The Actor stops calling the AI APIs as soon as the next check would go
  over it, so you're not paying OpenAI or Perplexity for checks this Actor can't finish.

### Input

| Field | Required | Example |
|---|---|---|
| `brand` | yes | `Prairie Smile Dental` |
| `prompts` | yes (1–50) | `["Who is the best dentist in Fremont, Nebraska?"]` |
| `domain` | recommended | `prairiesmiledental.com` (subdomains count) |
| `aliases` | no | `["Prairie Smile Dental Care"]` |
| `engines` | no | `["openai", "perplexity"]` (default: both) |
| `openaiApiKey` | for ChatGPT | your key (secret field) |
| `perplexityApiKey` | for Perplexity | your key (secret field) |
| `location` | no | `{"country": "US", "region": "Nebraska", "city": "Fremont"}` |
| `openaiModel` | no | `gpt-4o-mini` (default) or `gpt-4.1-mini` |
| `perplexityModel` | no | `perplexity/sonar` (default) |
| `perplexitySearchType` | no | `web` (default) or `fast` |
| `requestTimeoutSecs` | no | `60` |

If you only have one key, select only that engine, or leave both selected: checks for the engine without a key are
skipped and **not charged**.

#### Your API keys

Keys are Apify **secret inputs**: encrypted at rest, sent only to `api.openai.com` / `api.perplexity.ai`, and never
written to logs, the dataset, or the output record. If a provider rejects a key, the Actor stops using that key for
the rest of the run.

### Output

The dataset has two kinds of rows (two table views are provided):

**`engine_check`** — one row per question × engine

```json
{
  "item_type": "engine_check",
  "prompt": "Who is the best dentist in Fremont, Nebraska?",
  "engine": "openai",
  "model": "gpt-4o-mini-2024-07-18",
  "status": "ok",
  "mentioned": true,
  "mention_type": "brand",
  "position": 6,
  "list_rank": 2,
  "domain_cited": true,
  "competitors_named": ["Fremont Family Dentistry", "Elkhorn Valley Orthodontics"],
  "cited_urls": [{"url": "https://www.prairiesmiledental.com/new-patients", "title": "New Patients | Prairie Smile Dental"}],
  "engine_score": 85,
  "billed": true,
  "usage": {"input_tokens": 8312, "output_tokens": 214, "web_search_calls": 1},
  "answer_text": "Here are some well-reviewed dentists in Fremont, Nebraska: ..."
}
```

**`prompt_rollup`** — one row per question: `share_of_voice` (engines that named you ÷ engines that answered),
`report_score`, a compact per-engine view, and all citations and competitors deduplicated.

The key-value store record **`OUTPUT`** holds the run summary: overall score, and per engine the mention rate, domain
citation rate, average score and error counts.

*(Example values above come from the Actor's test fixtures for a fictional business, not a live answer.)*

### How the score works

| Signal | Points |
|---|---|
| Brand, alias or domain mentioned | 60 (30 if `unclear`) |
| Cited: your domain is among the sources, **or** the answer links your own map listing (`place_cited`) | 25 |
| First mention is in the first third of the answer | 15 |
| Not mentioned at all | score is 0 |

`report_score` is the average over engines that answered; `overall_score` is the average over every successful check.
It's a simple, transparent tracking number, **not a ranking guarantee.**

### Errors (never charged)

| `error_code` | Meaning |
|---|---|
| `missing_api_key` | No key for that engine; skipped without calling it |
| `auth` | Provider rejected the key (401/403). Later checks with that key are skipped |
| `quota_exceeded` | Key has no remaining credit (OpenAI `insufficient_quota`) |
| `rate_limited` | Still rate-limited after 3 retries with backoff |
| `timeout` | No answer within the timeout |
| `provider_error` | Provider 5xx after 3 retries, or an incomplete answer |
| `invalid_request` | Provider rejected the request (e.g. unknown model) |
| `parse_error` | The response had no readable answer |
| `network_error` | Connection failed after retries |

If every check in a run fails, the run is marked **Failed** so it's obvious.

### Limitations (please read)

- **API answers aren't identical to the consumer apps.** This uses the official APIs with web search, not the ChatGPT
  or Perplexity websites, so answers can differ from what a person sees. Answers also vary from run to run, so track
  trends over several runs rather than one result.
- **Google AI Overviews / Gemini and Microsoft Copilot are not included.** Their official options either don't
  return the consumer answer or have terms that don't fit a stored, scored report.
- **Mention and competitor detection is heuristic.** Matching is case- and punctuation-insensitive on whole words.
  Competitor names are pulled from bold text, list items and names ending in words like "Dental" or "Agency", so
  expect some misses and the occasional false positive.
- For "best X near me" questions, ChatGPT usually links each business to a Google Maps search rather than its
  website, so `domain_cited` is often false even when you're listed. A map link titled with your name (`place_cited`) earns
  the same 25 "cited" points; `list_rank` shows where you appear in the list.
- Perplexity often answers without any links. Only links shown in the answer count as citations; the ~15 pages it
  searched are listed separately in `sources_searched` (with `domain_in_sources`) and don't earn citation points.
- Individual practitioners ("Dr. Jane Smith") are reported like businesses. Add your own staff names as aliases,
  written the way the AI writes them (middle initials matter).
- `position` counts sentences, and each list line counts as at least one sentence; `list_rank` is usually the more
  useful signal for list-style answers.

### FAQ

**Do you store my data?** Results stay in your own Apify run storage. Keys are never stored outside Apify's
encrypted input.

**Why bring my own key?** You pay OpenAI/Perplexity directly at their prices, with no markup, and your usage stays
under your own account and terms.

**Can I schedule it?** Yes. Use an Apify schedule (e.g. weekly) with the same input to track visibility over time.

# Actor input Schema

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

The name to look for in AI answers, e.g. "Prairie Smile Dental".

## `domain` (type: `string`):

Used to detect when the AI cites your site, e.g. prairiesmiledental.com. Subdomains count.

## `aliases` (type: `array`):

Other names the business goes by (DBA, short name, old name).

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

Search-style questions your customers might ask. Up to 50 per run. Each question is sent once to each selected engine.

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

Which AI engines to check. Checks for an engine without an API key are skipped and not charged.

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

Your own OpenAI API key. Stored encrypted by Apify, sent only to api.openai.com, never logged or saved to the dataset. OpenAI bills your account for the API usage.

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

Your own Perplexity API key. Stored encrypted by Apify, sent only to api.perplexity.ai, never logged or saved to the dataset. Perplexity bills your account for the API usage.

## `location` (type: `object`):

Approximate searcher location passed to both engines' web search, e.g. {"country": "US", "region": "Nebraska", "city": "Fremont"}. Country is a 2-letter code.

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

Model used with OpenAI's web_search tool.

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

Perplexity Agent API model.

## `perplexitySearchType` (type: `string`):

"web" = standard search, "fast" = cheaper lower-latency search (billed by Perplexity at a lower rate).

## `requestTimeoutSecs` (type: `integer`):

Calls slower than this are recorded as timeout and not charged.

## Actor input object example

```json
{
  "brand": "Prairie Smile Dental",
  "prompts": [
    "Who is the best dentist in Fremont, Nebraska?"
  ],
  "engines": [
    "openai",
    "perplexity"
  ],
  "location": {
    "country": "US",
    "region": "Nebraska",
    "city": "Fremont"
  },
  "openaiModel": "gpt-4o-mini",
  "perplexityModel": "perplexity/sonar",
  "perplexitySearchType": "web",
  "requestTimeoutSecs": 60
}
```

# Actor output Schema

## `results` (type: `string`):

Engine checks and per-prompt rollups written to the default dataset. Use the Engine checks and Per-prompt summary views.

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

Run-level summary (overall score, mention rates, citation rates, and billed check counts) stored under the OUTPUT key in the default key-value store.

# 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 = {
    "brand": "Prairie Smile Dental",
    "prompts": [
        "Who is the best dentist in Fremont, Nebraska?"
    ],
    "location": {
        "country": "US",
        "region": "Nebraska",
        "city": "Fremont"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("milamikeymedia/ai-answer-visibility-checker").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 = {
    "brand": "Prairie Smile Dental",
    "prompts": ["Who is the best dentist in Fremont, Nebraska?"],
    "location": {
        "country": "US",
        "region": "Nebraska",
        "city": "Fremont",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("milamikeymedia/ai-answer-visibility-checker").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 '{
  "brand": "Prairie Smile Dental",
  "prompts": [
    "Who is the best dentist in Fremont, Nebraska?"
  ],
  "location": {
    "country": "US",
    "region": "Nebraska",
    "city": "Fremont"
  }
}' |
apify call milamikeymedia/ai-answer-visibility-checker --silent --output-dataset

```

## MCP server setup

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

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/TU18BFWIDurjODSic/builds/AysjJDGw0jWBo3Wyn/openapi.json
