# Claude Search Scraper (`taiw/claude-search-scraper`) Actor

Measure how your brand and competitors show up in Claude's answers with web search: mention rate, position, share of voice, sentiment and cited sources. Scheduled trends and change alerts. Official Anthropic API, your own key.

- **URL**: https://apify.com/taiw/claude-search-scraper.md
- **Developed by:** [ThinkAIWorks](https://apify.com/taiw) (community)
- **Categories:** AI, 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 $20.00 / 1,000 ai answer analyzeds

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

## Claude AI Search Visibility Tracker

Measure how your brand shows up in **Claude's answers**. You give it the questions your customers ask, a brand and optional competitors. It asks Claude through the official Anthropic API (with web search), then reports whether your brand is mentioned, where, how it is described and which sources are cited. Run it on a schedule to see trends and get alerts.

> Results show visibility **in Claude API answers with the settings you choose**. They are not what any individual user sees in the Claude app or website. See "Read this first".

### What it does

- Asks each prompt to one or more Claude models, optionally several times (samples), with web search on or off.
- Detects your brand and competitors in each answer: aliases, case, punctuation, word boundaries, and a context check that flags possible false positives (for example "apple pie" for the brand Apple).
- Records position, rank in a list, how the brand is described, sentiment, cited sources and whether your own website is cited.
- Summarizes mention rate, average position, share of voice, top cited domains, prompts where you are missing and prompts where a competitor leads.
- Stores a history per brand and prompt set, so every run shows the change since the last one. Optional webhook alerts.
- Optionally writes realistic customer questions for a category for you.

### Who it is for

Marketing, SEO and GEO teams, brand managers and agencies that want a repeatable, documented measurement of AI answer visibility instead of one-off screenshots.

### Quick start

1. **Try the demo first.** The prefilled input has **Demo mode** on: it returns clearly labeled sample answers without any API key, and nothing is charged. Press **Start** and open the **Output** tab to see the Answers table and the Run summary.
2. **For real measurements**, turn Demo mode off, enter your **brand** and **prompts**, and paste an **Anthropic API key** under **API keys** (`{"anthropicApiKey": "sk-ant-..."}`). Use your own key, or your client's if you run this for a client. Anthropic bills that account directly for the model and web search usage, so the Actor never spends your money or the developer's.
3. Press **Start**. A small real run (3 prompts, about 3 answers) costs a few cents at Anthropic plus the Actor fee.

For trends, save it as a Task and add a Schedule (see "Scheduling and trend tracking").

### How to get API keys (bring your own key)

1. Create an account and an API key in the [Claude Console](https://console.anthropic.com/) and add billing credit.
2. In the Console, under Settings > Capabilities, check that **web search** is enabled (an organization admin controls this). Without it, runs fail with a clear message, or you can turn off "Use web search".
3. Paste the key into the **API keys** field. Apify stores secret input encrypted; the Actor never logs the key and never saves it in results or history.

Anthropic bills you directly for tokens and web search ($10 per 1,000 searches, plus tokens). This Actor charges its own per-answer fee on top.

### Input

| Field | What it does | Default |
|---|---|---|
| `demoMode` | Return labeled sample answers with no API call and no charge (items carry `is_sample_data: true`) | off (on in the prefilled example) |
| `brand` (required) | Brand to track | |
| `brandAliases` | Other names, product names and domains (`hubspot.com` also detects when your site is cited) | none |
| `competitors` | Up to 10 `{ "name", "aliases" }` objects | none |
| `prompts` (required unless the generator is on) | Up to 50 questions. Do not include your brand name | |
| `promptGenerator` | `{ enabled, category, country, count }`: Claude writes customer questions for a category; they are added to your prompts and returned in the summary and in the `GENERATED_PROMPTS` record | off |
| `models` | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-opus-5-5` | Haiku 5.5 |
| `apiKeys` | `{ "anthropicApiKey": "..." }` (secret) | |
| `useWebSearch` | Let Claude search the web and cite sources | on |
| `maxSearchesPerQuery` | Cap on searches per answer (cost control) | 3 |
| `samplesPerPrompt` | Repeat each prompt 1 to 5 times | 1 |
| `country`, `language` | Approximate user location for search; answer language | none |
| `analyzeSentiment` | Classify how the brand is described (extra small Haiku call) | on |
| `maxQueries` | Hard cap on answers in the run (prompts x models x samples) | 30 |
| `maxSpendUsd` | Stop when estimated Anthropic spend would pass this | none |
| `alertOnChange`, `alertThresholdPoints`, `webhookUrl` | Webhook alerts (https only) | off, 10 points |
| `storeFullAnswers` | Keep full answers (off = 200-character excerpts) | on |
| `brandNegativeContext` | Words that signal a different meaning of your brand name | none |

Before any answer is requested, the Actor logs the number of answers and an estimated Anthropic cost. If the plan is larger than `maxQueries` or `maxSpendUsd`, it runs only up to the cap and says so in the summary.

#### Example input

```json
{
  "brand": "HubSpot",
  "brandAliases": ["hubspot.com"],
  "competitors": [{ "name": "Salesforce", "aliases": ["salesforce.com"] }],
  "prompts": [
    "What is the best CRM for a small business?",
    "Which CRM should a startup use?"
  ],
  "apiKeys": { "anthropicApiKey": "sk-ant-..." },
  "samplesPerPrompt": 3,
  "country": "US"
}
```

### Output

Two record types are written to the dataset: **answer** (one per prompt x model x sample) and **summary** (one per run, also stored as the `SUMMARY` record).

#### Sample data (illustrative, not a real run)

Answer item, abbreviated:

```json
{
  "record_type": "answer",
  "status": "ok",
  "prompt": "What is the best CRM for a small business?",
  "model": "claude-haiku-5-5",
  "sample_index": 1,
  "brand_mentioned": true,
  "brand_mention_count": 2,
  "brand_first_position": 112,
  "brand_rank_in_list": 2,
  "competitors_mentioned": [{ "name": "Salesforce", "mentions": 1, "first_position": 198, "rank_in_list": 3 }],
  "sentiment": "positive",
  "sentiment_reason": "Praised for a generous free tier.",
  "citations": [{ "url": "https://www.hubspot.com/products/crm", "domain": "hubspot.com", "title": "Free CRM software | HubSpot", "cited_text": "..." }],
  "brand_domain_cited": true,
  "web_search_used": true,
  "estimated_cost_usd": 0.0221
}
```

Summary, abbreviated:

```json
{
  "record_type": "summary",
  "brand": "HubSpot",
  "successful_queries": 6,
  "mention_rate": 0.67,
  "mention_rate_margin_of_error_pts": 37.7,
  "share_of_voice": 0.5,
  "top_cited_domains": [{ "domain": "hubspot.com", "count": 4 }],
  "prompts_where_brand_missing": ["Which CRM should a startup use?"],
  "change_vs_previous_run": { "has_previous_run": true, "mention_rate_delta_pts": -16.7, "mention_rate_change_likely_noise": true },
  "caveats": ["..."]
}
```

#### Field dictionary (answers)

| Field | Meaning |
|---|---|
| `status` | `ok` or `error`. Errors are never charged |
| `brand_mentioned`, `brand_mention_count` | Counted mentions of the brand or its aliases. Possible false positives are not counted |
| `brand_first_position` | 1-based character offset of the first counted mention in `answer_text`. Lower = earlier |
| `brand_rank_in_list` | Position of the first list item (numbered or bulleted, outermost level) whose title mentions the brand. `null` if the answer has no list or the brand is not in it |
| `possible_false_positive`, `false_positive_reasons` | Some matches looked like a different meaning (a lowercase common word, or one of your `brandNegativeContext` words nearby) |
| `competitors_mentioned` | Name, mentions, first position and list rank for each competitor found |
| `sentiment`, `sentiment_reason` | `positive`, `neutral`, `negative`, `mixed`, or `null` when not classified |
| `citations` | Sources Claude cited: URL, domain, title, up to 150 characters of cited text |
| `sources_consulted` | Search results Claude received, cited or not |
| `brand_domain_cited`, `cited_competitor_domains` | Whether your domain, and which competitor domains, were cited |
| `tokens_used`, `estimated_cost_usd` | Usage reported by Anthropic and the cost at list prices (tokens + searches + sentiment call) |

### How scoring works

- **Mention rate**: answers that mention the brand divided by successful answers.
- **Average position**: mean of `brand_first_position` over answers that mention the brand. It is a character offset, so it only compares like with like (same prompts, same settings).
- **Rank in list**: where the brand appears in a ranked or bulleted list, when the answer has one.
- **Share of voice**: brand mentions divided by brand plus tracked-competitor mentions. Empty when no competitors are tracked.
- **Sentiment**: a small Haiku call reads the passages around the brand mention and picks one label. It is a rough classification, not a verdict.
- **Margin of error**: a 95% margin for the overall mention rate from the number of answers. Changes smaller than it are probably noise.

### Scheduling and trend tracking

Save your input as a Task and add a Schedule, for example weekly on Monday at 08:00. Each successful, complete run is added to a history keyed by brand and prompt set, and the summary shows the change since the previous run: mention rate, position, share of voice, prompts where you were lost or gained, new and lost cited domains and new competitor domains.

- Keep the same prompts and settings to compare runs. If the model, web search, country or language change, the summary says the comparison is indicative only.
- Runs that stop early (a cap or an error) are not added to the history.
- If you use the prompt generator, copy the generated questions into `prompts` so the next runs use the same set.

### Alerts and webhooks

Turn on `alertOnChange`, set a `webhookUrl` and a threshold in percentage points. A JSON message is sent when the mention rate moves by more than the threshold, when the brand disappears from a prompt where it appeared before, or when a new competitor domain starts being cited. The payload has the events, headline numbers and the caveat text. It works with Slack (via a workflow or a Make/n8n step), Make, n8n and Google Sheets scripts. A failing webhook never fails the run.

### Pricing

Pay per event, with no start fee:

| Event | When | Draft price |
|---|---|---|
| `ai-query` | Each successful answer analyzed (you also pay Anthropic through your own key) | $0.02 |
| `prompt-generation` | Each generated batch of questions | $0.02 |

Failed answers, duplicates, cancelled runs and demo mode are not charged, and the run summary is free. You also pay Anthropic directly for the model and web search usage behind each answer.

Examples (Claude Haiku 5.5, about two searches per answer; Anthropic costs are estimates based on list prices):

| Run | Actor fee | Anthropic cost (est.) |
|---|---|---|
| Try it: 3 prompts x 1 sample = 3 answers | $0.06 | about $0.07 |
| 20 prompts x 3 samples = 60 answers | $1.20 | about $1.30 |
| 20 prompts x 3 samples x Sonnet 5.5 = 60 answers | $1.20 | about $3.70 |

Web search is the largest part of the Anthropic cost at $10 per 1,000 searches. Lower `maxSearchesPerQuery` or turn off web search to reduce it. Set `maxQueries`, `maxSpendUsd` or a maximum charge per run for hard limits: the Actor stops cleanly when one is reached.

### Read this first: what the numbers mean

- The Actor measures **visibility in API-delivered Claude answers with the selected settings** (model, web search, country, language). The Claude app and website can behave differently because of personalization, conversation history, product features and model versions.
- It does **not** measure rankings in any product you use in a browser, and results must not be described as what users of an AI app see.
- AI answers vary from run to run. Each run is a sample. The summary reports sample sizes and a margin of error, and adds a warning when the sample is small. Do not treat one answer, or a change within the margin of error, as a stable truth.
- Mention detection is lexical. Brand names that are common words can produce false positives; flagged matches are listed but not counted, and `brandNegativeContext` helps. Review flagged items.
- Sentiment is a rough automated label.
- If web search is off, answers come from the model's built-in knowledge and have no citations.

### Limitations

- Claude is the only provider in this version.
- Web search must be enabled for the Anthropic organization the key belongs to, and its API tier sets rate limits. Large runs are paced (3 requests in parallel) and retried on rate limits.
- The Actor stops dispatching new answers when a cap is reached; requests already in flight can still finish, so Anthropic may bill you for up to two answers that were not saved or charged by this Actor.
- History is stored in your Apify account (named store `ai-search-visibility-history`), up to the last 52 runs per brand and prompt set.

### FAQ

#### Do I need an API key?

Yes, for real measurements. The Actor never uses a key of its own: you (or your client) supply an Anthropic key, Anthropic bills that account directly for tokens and web search, and this Actor's fee covers only the analysis. Agencies can create a key in each client's Anthropic account and run the Actor per client, so costs land on the client. Demo mode needs no key but returns sample data only.

#### Why is my brand missing from some answers?

Claude may not mention it for that prompt, with those settings, at that moment. Run more samples to see how often it appears. The summary lists the prompts where the brand is missing and where a competitor leads.

#### Can I compare Claude, ChatGPT and Gemini?

Not in this version. It measures Claude only.

#### What does "possible false positive" mean?

A match of your brand name that looked like a different meaning (for example a lowercase common word), or that sits near one of your `brandNegativeContext` words. It is listed but not counted.

#### How many samples do I need?

More is steadier. With 3 to 5 samples per prompt and 10 or more prompts, the margin of error in the summary becomes useful. With one answer per prompt, treat results as a first look.

#### What happens if Claude or my key fails?

The run reports a clear error, nothing is charged for failed answers, and results gathered so far are kept. A rejected key, a retired model or a reached spend limit stop the run immediately.

#### Is my API key stored?

The key is an encrypted secret input. It is never logged, and never written to results, summaries or history.

### Legal note

This Actor queries AI providers through their official APIs using keys supplied by the user. Results reflect API responses at the time of the run and may differ from what individual users see. Users are responsible for complying with each provider's terms. This Actor is not affiliated with or endorsed by Anthropic.

# Actor input Schema

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

The brand to track, for example "HubSpot".

## `demoMode` (type: `boolean`):

Returns clearly labeled SAMPLE answers without calling any AI provider, so you can see the output format for free. Nothing is charged and nothing is saved to the trend history. Turn it off and add your API key for real measurements.

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

Other names, product names and domains that count as your brand, for example "HubSpot CRM" or "hubspot.com". Domains are also used to detect when your website is cited.

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

Up to 10 competitors as { "name": ..., "aliases": \[...] }. Used for share of voice and for cited competitor domains.

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

Up to 50 questions your customers ask AI tools. Do not include your brand name in them: you want to see whether Claude brings it up.

## `promptGenerator` (type: `object`):

Let Claude write realistic customer questions for a category: { "enabled": true, "category": "project management software", "country": "United States", "count": 5 }. The generated questions are added to your prompts and returned in the summary (and in the GENERATED_PROMPTS record) so you can reuse them. Billed as a separate event.

## `models` (type: `array`):

Which Claude models answer the prompts. Haiku 5.5 is the cheapest; Sonnet 5.5 and Opus 5.5 cost more per answer.

## `apiKeys` (type: `object`):

Required unless Demo mode is on. Use your own or your client's Anthropic key: { "anthropicApiKey": "sk-ant-..." } (create one at console.anthropic.com). Anthropic bills that account directly for model and web search usage. The key is stored encrypted by Apify, is never logged and is never saved in results or history.

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

Let Claude search the web. This is how Claude answers most current questions and how it cites sources. Turn it off to measure only what the model knows without searching (no citations). Anthropic charges $10 per 1,000 searches on top of tokens.

## `maxSearchesPerQuery` (type: `integer`):

Upper limit on web searches Claude may run for one answer. Lower values are cheaper.

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

How many times each prompt is asked of each model. Answers vary, so 3 to 5 samples give a more reliable mention rate than 1.

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

Two-letter country code used as the approximate user location for web search, for example US or GB.

## `language` (type: `string`):

Language the answers should be written in, for example English or German.

## `analyzeSentiment` (type: `boolean`):

Classify how each answer describes the brand (positive, neutral, negative, mixed) with a small extra call to Haiku 5.5.

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

Maximum number of answers requested in this run (prompts x models x samples). The run stops cleanly at this number. Sentiment and prompt-generation calls are extra small calls and are not counted here, but are included in the spend estimate.

## `maxSpendUsd` (type: `number`):

Stops the run when the estimated Anthropic spend would pass this amount. Spend is tracked from the usage Anthropic reports for each answer.

## `alertOnChange` (type: `boolean`):

Send a webhook when the mention rate moves by more than the threshold, when the brand disappears from a prompt where it appeared before, or when a new competitor domain starts being cited. Needs a webhook URL and a previous run.

## `alertThresholdPoints` (type: `integer`):

Mention-rate change that triggers an alert.

## `webhookUrl` (type: `string`):

https address that receives the alert as a JSON POST (Slack, Make, n8n, Zapier, Google Sheets scripts). A failing webhook never fails the run.

## `storeFullAnswers` (type: `boolean`):

Keep the complete answer text in the results. Turn off to keep only metrics and a 200-character excerpt.

## `brandNegativeContext` (type: `array`):

For brand names that are also ordinary words (for example Apple or Notion): words that, when they appear near a match, mark it as a possible false positive, such as "fruit", "pie" or "orchard". Flagged matches are listed but not counted.

## Actor input object example

```json
{
  "brand": "HubSpot",
  "demoMode": true,
  "brandAliases": [
    "hubspot.com"
  ],
  "competitors": [
    {
      "name": "Salesforce",
      "aliases": [
        "salesforce.com"
      ]
    }
  ],
  "prompts": [
    "What is the best CRM for a small business?",
    "Which CRM should a startup use?",
    "What are good alternatives to Salesforce for small teams?"
  ],
  "promptGenerator": {
    "enabled": false,
    "category": "",
    "country": "",
    "count": 5
  },
  "models": [
    "claude-haiku-5-5"
  ],
  "useWebSearch": true,
  "maxSearchesPerQuery": 3,
  "samplesPerPrompt": 1,
  "analyzeSentiment": true,
  "maxQueries": 3,
  "alertOnChange": false,
  "alertThresholdPoints": 10,
  "storeFullAnswers": true
}
```

# Actor output Schema

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

One row per prompt x model x sample.

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

Mention rate, share of voice, cited domains, changes since the last run and caveats.

## `status` (type: `string`):

Status, stop reason and error counts.

# 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": "HubSpot",
    "demoMode": true,
    "brandAliases": [
        "hubspot.com"
    ],
    "competitors": [
        {
            "name": "Salesforce",
            "aliases": [
                "salesforce.com"
            ]
        }
    ],
    "prompts": [
        "What is the best CRM for a small business?",
        "Which CRM should a startup use?",
        "What are good alternatives to Salesforce for small teams?"
    ],
    "promptGenerator": {
        "enabled": false,
        "category": "",
        "country": "",
        "count": 5
    },
    "maxQueries": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("taiw/claude-search-scraper").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": "HubSpot",
    "demoMode": True,
    "brandAliases": ["hubspot.com"],
    "competitors": [{
            "name": "Salesforce",
            "aliases": ["salesforce.com"],
        }],
    "prompts": [
        "What is the best CRM for a small business?",
        "Which CRM should a startup use?",
        "What are good alternatives to Salesforce for small teams?",
    ],
    "promptGenerator": {
        "enabled": False,
        "category": "",
        "country": "",
        "count": 5,
    },
    "maxQueries": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("taiw/claude-search-scraper").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": "HubSpot",
  "demoMode": true,
  "brandAliases": [
    "hubspot.com"
  ],
  "competitors": [
    {
      "name": "Salesforce",
      "aliases": [
        "salesforce.com"
      ]
    }
  ],
  "prompts": [
    "What is the best CRM for a small business?",
    "Which CRM should a startup use?",
    "What are good alternatives to Salesforce for small teams?"
  ],
  "promptGenerator": {
    "enabled": false,
    "category": "",
    "country": "",
    "count": 5
  },
  "maxQueries": 3
}' |
apify call taiw/claude-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,taiw/claude-search-scraper"
        }
    }
}
```

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/GXPfeNjqKXBzKfjPy/builds/09xAVdHivlo80pt5l/openapi.json
