# Ai Citation Auditor (`dbott23/ai-citation-auditor`) Actor

- **URL**: https://apify.com/dbott23/ai-citation-auditor.md
- **Developed by:** [Darren S](https://apify.com/dbott23) (community)
- **Categories:** AI, SEO tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## AI Citation Auditor — Is Your Website Cited by ChatGPT, Perplexity & Gemini?

**Being mentioned by AI is good. Being cited as a source is better.**

When AI assistants answer buyer questions, they cite websites as evidence. This actor checks whether your domain (or a competitor's) appears in those citation lists — across ChatGPT, Perplexity, Gemini, and Claude — and tracks how that changes week over week.

---

### How it differs from the AI Brand Visibility Tracker

| | [AI Brand Visibility Tracker](https://apify.com/dbott23/ai-brand-visibility-tracker) | AI Citation Auditor |
|---|---|---|
| Measures | Brand *mentioned by name* in the response | Domain *cited as a source* |
| Input | Brand names + competitor names | Domain names (e.g. `asana.com`) |
| Best for | "Does AI recommend us?" | "Does AI link to us as evidence?" |

Run both together for a complete picture: are you being recommended *and* cited?

---

### What it does

For each combination of domain × query × engine, the actor:

1. Sends the query to the AI engine (web-search mode)
2. Inspects the structured citation list the engine returns
3. Records whether your domain appears, at what rank, and which URL was cited
4. Compares to your previous run and reports citation-rate and rank deltas

Multiple domains share engine calls — auditing 5 domains across 3 queries × 3 engines costs 9 API calls, not 45.

---

### Who uses it

- **SEO / GEO agencies** showing clients which pages AI engines treat as authoritative
- **Content marketers** identifying which articles get picked up vs. ignored by AI
- **Founders** benchmarking their domain's citation share vs. competitors
- **Brand teams** pairing citation data with mention data for a complete AI-presence report

---

### Input

```json
{
  "domains": ["asana.com", "trello.com", "monday.com"],
  "queries": [
    "best project management tool for small teams",
    "what project management software should a startup use"
  ],
  "engines": ["chatgpt", "perplexity", "gemini"],
  "trackTrends": true
}
````

**Input fields:**

| Field | Required | Description |
|---|---|---|
| `domains` | ✅ | Domains to audit. Include competitors to measure citation share. |
| `queries` | ✅ | Buyer-intent questions your customers ask AI assistants. |
| `engines` | — | `chatgpt`, `perplexity`, `gemini`, `claude`. Default: first three. |
| `trackTrends` | — | Store this run's summary and report deltas vs. the previous run. Default: `true`. |
| `trendKey` | — | Label for separate trend series (e.g. per client). |

***

### Output

#### Dataset — one row per (domain × query × engine) check

```json
{
  "domain": "asana.com",
  "engine": "perplexity",
  "query": "best project management tool for small teams",
  "cited": true,
  "citation_rank": 2,
  "citation_url": "https://asana.com/resources/project-management-guide",
  "all_citation_urls": ["https://asana.com/resources/project-management-guide"],
  "total_citations": 8,
  "response_truncated": false
}
```

**Key fields:**

- `cited` — was the domain in the citation list at all?
- `citation_rank` — position in the list (1 = first cited source); `null` if not cited
- `citation_url` — the specific URL that was cited
- `all_citation_urls` — all URLs from your domain that appeared (there may be several)
- `total_citations` — how many sources the engine returned in total

#### SUMMARY key-value — per-domain rollup + trend deltas

```json
{
  "summary": {
    "asana.com": {
      "citation_rate": 0.67,
      "avg_rank": 2.5,
      "engines": {
        "perplexity": { "citation_rate": 1.0, "avg_rank": 2.0, "checks": 2 },
        "chatgpt":    { "citation_rate": 0.5, "avg_rank": 3.0, "checks": 2 }
      }
    }
  },
  "trends": {
    "asana.com": {
      "citation_rate": { "current": 0.67, "previous": 0.5,  "delta":  0.17 },
      "avg_rank":      { "current": 2.5,  "previous": 3.1,  "delta": -0.6  }
    }
  }
}
```

***

### Pricing

Pay per event — a small flat fee per citation check (domain × query × engine). Engine API costs are included; you don't need your own keys.

**Example:** 3 domains × 2 queries × 3 engines = 18 checks (but only 6 unique engine calls — domains share responses).

***

### Scheduling for weekly trend reports

1. Set up a **Schedule** in Apify (Actors → Schedules → New schedule)
2. Point it at this actor with your saved input
3. Keep `trackTrends: true` (the default)
4. Every run compares to the previous one and writes deltas to `SUMMARY`

Use `trendKey` to keep separate trend series per client.

***

### Use as an MCP tool

Add this actor to Claude Desktop, Cursor, or any MCP-compatible client via [Apify's MCP server](https://apify.com/apify/actors-mcp-server) and let your agent audit AI citations on demand.

***

### FAQ

**Do I need API keys?**
No. All engine calls are made server-side; the cost is bundled into the per-check price.

**Why does auditing 5 domains cost the same API calls as 1?**
The actor caches each (query × engine) response. All domains are checked against the same citation list — so adding more domains barely increases cost.

**Perplexity returned 0 citations — is that a bug?**
No — some queries return fewer citations than others. ChatGPT's search-preview mode and Perplexity/sonar are the most citation-rich engines; Gemini and Claude return structured citations less consistently.

**How is `avg_rank` a useful metric?**
Lower is better — rank 1 means your domain was the first source the engine cited. Tracking `avg_rank` over time shows whether AI is treating your content as increasingly authoritative (rank trending down) or less so (rank trending up).

**Can I use this alongside the AI Brand Visibility Tracker?**
Yes — they're designed as a pair. The visibility tracker tells you whether AI *recommends* you by name; the citation auditor tells you whether AI *cites* your content as evidence. Both use the same query inputs so results are directly comparable.

# Actor input Schema

## `domains` (type: `array`):

Domains you want to check for AI citations (e.g. "asana.com"). Include competitors to benchmark your citation share.

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

Questions your customers ask AI assistants. The actor checks whether your domain is cited when AI answers each one.

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

Which engines to check. Search-backed engines (perplexity, chatgpt) return more structured citations.

## `trackTrends` (type: `boolean`):

Store this run's summary and report deltas vs your previous run — schedule weekly for automatic trend reports.

## `trendKey` (type: `string`):

Optional label to keep separate trend series (e.g. per client).

## Actor input object example

```json
{
  "domains": [
    "asana.com",
    "trello.com"
  ],
  "queries": [
    "best project management tool for small teams",
    "what project management software should a startup use"
  ],
  "engines": [
    "chatgpt",
    "perplexity",
    "gemini"
  ],
  "trackTrends": true
}
```

# 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 = {
    "domains": [
        "asana.com",
        "trello.com"
    ],
    "queries": [
        "best project management tool for small teams",
        "what project management software should a startup use"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dbott23/ai-citation-auditor").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 = {
    "domains": [
        "asana.com",
        "trello.com",
    ],
    "queries": [
        "best project management tool for small teams",
        "what project management software should a startup use",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("dbott23/ai-citation-auditor").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "domains": [
    "asana.com",
    "trello.com"
  ],
  "queries": [
    "best project management tool for small teams",
    "what project management software should a startup use"
  ]
}' |
apify call dbott23/ai-citation-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dbott23/ai-citation-auditor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Ai Citation Auditor",
        "version": "0.0",
        "x-build-id": "2yO3bEKEad4ffR6Cn"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dbott23~ai-citation-auditor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dbott23-ai-citation-auditor",
                "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/dbott23~ai-citation-auditor/runs": {
            "post": {
                "operationId": "runs-sync-dbott23-ai-citation-auditor",
                "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/dbott23~ai-citation-auditor/run-sync": {
            "post": {
                "operationId": "run-sync-dbott23-ai-citation-auditor",
                "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": [
                    "domains",
                    "queries"
                ],
                "properties": {
                    "domains": {
                        "title": "Domains to audit",
                        "type": "array",
                        "description": "Domains you want to check for AI citations (e.g. \"asana.com\"). Include competitors to benchmark your citation share.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "queries": {
                        "title": "Queries to test",
                        "type": "array",
                        "description": "Questions your customers ask AI assistants. The actor checks whether your domain is cited when AI answers each one.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "engines": {
                        "title": "AI engines",
                        "type": "array",
                        "description": "Which engines to check. Search-backed engines (perplexity, chatgpt) return more structured citations.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "chatgpt",
                                "perplexity",
                                "gemini",
                                "claude"
                            ]
                        },
                        "default": [
                            "chatgpt",
                            "perplexity",
                            "gemini"
                        ]
                    },
                    "trackTrends": {
                        "title": "Track trends (run-over-run deltas)",
                        "type": "boolean",
                        "description": "Store this run's summary and report deltas vs your previous run — schedule weekly for automatic trend reports.",
                        "default": true
                    },
                    "trendKey": {
                        "title": "Trend series key",
                        "type": "string",
                        "description": "Optional label to keep separate trend series (e.g. per client)."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
