# ChatGPT Brand Visibility & Citation Tracker (`muhammadafzal/chatgpt-brand-visibility-tracker`) Actor

Measure brand visibility and official-domain citations in current ChatGPT-style answers using a fixed OpenRouter model with web search grounding.

- **URL**: https://apify.com/muhammadafzal/chatgpt-brand-visibility-tracker.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / brand visibility report

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## ChatGPT Brand Visibility & Citation Tracker

Track whether a brand appears in current ChatGPT-style answers and whether its official website is cited. The Actor uses a fixed internal `openai/gpt-4o-mini` route through OpenRouter with the `openrouter:web_search` server tool, so users cannot change the provider model or increase cost through input.

This is a directional GEO/AEO benchmark, not a guarantee of what every ChatGPT user will see. Results vary by model, prompt, search index, time, location, and provider settings.

### Setup

Add `OPENROUTER_API_KEY` as a private Actor environment secret. Do not put the key in Actor input. `OPENROUTER_HTTP_REFERER` is optional and can be used to set your OpenRouter attribution URL.

### Inputs

- `brandName` — required tracked company, product, or brand.
- `brandDomain` — optional official domain used for citation detection.
- `industry` and `location` — optional context for three generated discovery prompts.
- `queries` — optional custom prompt list, up to 5. If supplied, it replaces generated prompts.
- `competitors` — optional names to detect in the same answers.
- `useWebSearch` — defaults to `true`; set false only when testing model-only behavior.

The Actor makes at most five sequential OpenRouter requests per run. The provider model is fixed internally to `openai/gpt-4o-mini`, which keeps the model-driven cost envelope predictable; OpenRouter input/output and web-search charges still depend on the provider's current rates.

Apify pricing is pay-per-event: `$0.20` for one complete `brand-visibility-report` after at least one prompt succeeds and the report is written. Failed all-request runs do not emit or charge a report event. The current pricing configuration also passes Apify platform usage through to the user; OpenRouter provider charges are separate.

### Output

The dataset contains one report record with:

- `visibilityScore` from 0–100: 70% successful-answer mention rate plus 30% official-domain citation rate when a domain is provided.
- `queryResults` with the exact prompt, answer, mention count, context snippets, citations, competitor mentions, fixed model used, and error state.
- `mentionRate`, `citationRate`, `queriesCompleted`, `competitorMentions`, `recommendations`, and `warnings`.

The Actor output schema exposes this report through the default dataset link in the run's Output tab and API output object.

Failed provider requests are not treated as missing brand mentions. If every request fails, the Actor fails honestly with a diagnostic instead of emitting a misleading empty report. A missing API key or invalid runtime input exits with a warning so configuration mistakes do not inflate the Actor's failure rate.

### Example input

```json
{
  "brandName": "Notion",
  "brandDomain": "notion.so",
  "industry": "project management software",
  "location": "United States",
  "competitors": ["Asana", "Trello", "ClickUp"]
}
```

For repeatable monitoring, keep the same location and custom prompt list across scheduled runs and compare the underlying `queryResults` as well as the score.

### Responsible use

Use the Actor for legitimate brand research, content measurement, and competitive analysis. Do not infer market share or factual truth from a single generated answer. Validate material decisions against primary sources and respect OpenRouter, model-provider, and source-site terms.

### Local development

```bash
npm install
npm test
```

The local tests cover mention parsing and scoring. A live API test requires an authorized `OPENROUTER_API_KEY` and incurs provider costs.

# Actor input Schema

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

The company, product, or brand to track. Example: Notion.

## `brandDomain` (type: `string`):

Optional official domain used to detect citations. Enter a domain such as notion.so or https://www.notion.so/.

## `industry` (type: `string`):

Optional category used to make the default discovery prompts more relevant. Example: project management software.

## `location` (type: `string`):

Optional market, country, or region to include in default prompts. Keep this stable for scheduled comparisons.

## `queries` (type: `array`):

Optional neutral prompts to test instead of generated prompts. Use up to 5 prompts. Avoid putting the tracked brand name in every prompt if you want an unbiased discovery test.

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

Optional competitor names to detect in the same answers. This is descriptive mention tracking, not a market-share estimate.

## `useWebSearch` (type: `boolean`):

Enable OpenRouter's openrouter:web\_search server tool so answers can use current web evidence and return citation annotations. Defaults to true.

## Actor input object example

```json
{
  "brandName": "Notion",
  "brandDomain": "notion.so",
  "industry": "project management software",
  "location": "United States",
  "queries": [
    "What are the leading project management tools for a distributed team?",
    "Which project management software is best for teams that need docs and task tracking?"
  ],
  "competitors": [
    "Asana",
    "Trello",
    "ClickUp"
  ],
  "useWebSearch": true
}
```

# Actor output Schema

## `report` (type: `string`):

Dataset containing one report with the visibility score, per-prompt answers, citations, competitor mentions, recommendations, and warnings.

# 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 = {
    "brandName": "Notion"
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/chatgpt-brand-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 = { "brandName": "Notion" }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/chatgpt-brand-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 '{
  "brandName": "Notion"
}' |
apify call muhammadafzal/chatgpt-brand-visibility-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/chatgpt-brand-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/fhnqBm47T1OqDKuax/builds/UK9QKtuljT8iZdKVv/openapi.json
