# Local AI-Answer Mention Tracker (`conceivable_extension/local-ai-answer-mention-tracker`) Actor

Checks whether ChatGPT, Gemini, and Claude recommend a specific local business when asked a natural local-intent question. Extends AI visibility tracking to hyper-local business mentions. $0.05 per mention found.

- **URL**: https://apify.com/conceivable\_extension/local-ai-answer-mention-tracker.md
- **Developed by:** [joseph fadero](https://apify.com/conceivable_extension) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 query check mentioneds

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

## Local AI-Answer Mention Tracker

Checks whether ChatGPT, Gemini, and Claude recommend a specific local business when asked a natural local-intent question ("What's the best plumber in Bishop's Stortford?"). Extends domain-level AI visibility tracking down to hyper-local, business-name-level mentions.

**Important disclaimer:** AI answers are non-deterministic. Two runs of the exact same query against the exact same engine can return different results — different businesses mentioned, different ordering, different wording. This actor's output is a **sampled signal**, not a fixed or authoritative ranking. Treat a single run as one data point; for a reliable trend, run this actor periodically and look at mention rate over time rather than any one result.

### How it works

1. You supply a `businessName` plus either custom `queries` or a `serviceType` + `location` pair used to auto-generate natural local-intent questions.
2. Each query is sent to the selected engines via their **real, official APIs** — this actor never scrapes a chat UI. It uses the Anthropic SDK for Claude, the OpenAI SDK for ChatGPT, and the Google Generative AI SDK for Gemini.
3. Every query is a fresh, no-history conversation — no chat memory carries over between queries or engines.
4. A lightweight follow-up LLM call extracts all business names mentioned in the answer (simple NER-style extraction: "list all business names mentioned in this text").
5. Your `businessName` is matched against the extracted list (case-insensitive, tolerant of minor variation) to determine `mentioned` and its `position` in the list, if any.

### Inputs

| Field | Default | Description |
|-------|---------|-------------|
| `businessName` | "Acme Plumbing" | The exact local business name to check for (required) |
| `serviceType` | "plumber" | Used to auto-generate queries when `queries` is empty |
| `location` | "Bishop's Stortford, UK" | Used to auto-generate queries when `queries` is empty |
| `queries` | \[] | Custom natural-language questions; overrides auto-generation |
| `engines` | \["chatgpt","gemini","claude"] | Which AI engines to query |
| `maxQueries` | 2 | **Cost-control cap.** Hard limit on the number of distinct queries run. Every query × engine pair is a real, paid upstream LLM call (plus a second call for name extraction), so keep this low unless you intend to spend more. |

### API keys required

Set these as Actor environment variables/secrets in your Apify account:

- `OPENAI_API_KEY` — required for the `chatgpt` engine
- `ANTHROPIC_API_KEY` — required for the `claude` engine
- `GOOGLE_AI_API_KEY` — required for the `gemini` engine

If a key for a requested engine is missing, that engine is **skipped gracefully** (logged as a warning, recorded in the dataset with `status: "skipped"`) rather than crashing the whole run. Partial-engine failure never kills the run.

### Output fields (per query × engine)

| Field | Description |
|-------|--------------|
| `query` | The exact question asked |
| `engine` | `chatgpt`, `gemini`, or `claude` |
| `mentioned` | `true` if your business appears in the extracted list |
| `position` | 1st/2nd/3rd etc. if the answer gave an ordered/listed set of businesses, else `null` |
| `competitorsMentioned` | Other business names extracted from the same answer |
| `responseSnippet` | The relevant portion of the AI's raw answer (truncated to 500 chars) |
| `timestamp` | ISO timestamp of the check |
| `status` | `ok`, `skipped` (missing API key), or `error` (upstream call failed) |

### Pricing (Pay Per Event)

This actor makes real, paid upstream LLM API calls on every check, so it is priced meaningfully higher than scraping-based actors in this portfolio — you are paying for genuine third-party inference cost, not just compute.

| Event | Price | When charged |
|-------|-------|----------------|
| Actor Start | $0.05 | Once per run |
| Query Check Not Mentioned | $0.02 | Per query×engine check where your business was NOT found in the response |
| Query Check Mentioned | $0.05 | Per query×engine check where your business WAS found — includes the extra follow-up extraction call that identifies competitor mentions too |

Use `maxQueries` to control your maximum spend per run: worst case is `maxQueries × number of engines` mentioned-checks.

# Actor input Schema

## `businessName` (type: `string`):

The exact local business name to check for in AI answers (case-insensitive, minor-variation matching).

## `serviceType` (type: `string`):

What the business does, e.g. 'plumber'. Used to auto-generate queries when 'Custom Queries' is empty.

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

The town/city customers would search from, e.g. 'Bishop's Stortford, UK'. Used to auto-generate queries when 'Custom Queries' is empty.

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

Optional. Exact natural-language questions to ask each AI engine. If left empty, queries are auto-generated from Service Type + Location (capped at Max Queries).

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

Which AI engines to query. Each engine is queried via its official API — no scraping.

## `maxQueries` (type: `integer`):

Hard cap on the number of distinct queries checked in this run. Every query x engine combination is a real, paid LLM API call — keep this low to control cost.

## Actor input object example

```json
{
  "businessName": "Acme Plumbing",
  "serviceType": "plumber",
  "location": "Bishop's Stortford, UK",
  "queries": [],
  "engines": [
    "chatgpt",
    "gemini",
    "claude"
  ],
  "maxQueries": 2
}
```

# Actor output Schema

## `resultsDatasetUrl` (type: `string`):

Dataset of AI-answer mention check records produced by this run.

# 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 = {
    "businessName": "Acme Plumbing",
    "serviceType": "plumber",
    "location": "Bishop's Stortford, UK",
    "queries": [],
    "engines": [
        "chatgpt",
        "gemini",
        "claude"
    ],
    "maxQueries": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("conceivable_extension/local-ai-answer-mention-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 = {
    "businessName": "Acme Plumbing",
    "serviceType": "plumber",
    "location": "Bishop's Stortford, UK",
    "queries": [],
    "engines": [
        "chatgpt",
        "gemini",
        "claude",
    ],
    "maxQueries": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("conceivable_extension/local-ai-answer-mention-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 '{
  "businessName": "Acme Plumbing",
  "serviceType": "plumber",
  "location": "Bishop'\''s Stortford, UK",
  "queries": [],
  "engines": [
    "chatgpt",
    "gemini",
    "claude"
  ],
  "maxQueries": 2
}' |
apify call conceivable_extension/local-ai-answer-mention-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,conceivable_extension/local-ai-answer-mention-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/WCQyKQmU5MWTTfru3/builds/iujP3CL8BI0J5Px85/openapi.json
