# Brave AI Mode API | Privacy-Search Intelligence (`johnvc/brave-ai-mode-api`) Actor

Track Brave Search's AI Mode answers for any query: get the AI-generated answer, its cited sources, and the supporting web results as structured JSON. Built for privacy-search intelligence, infosec research, and journalism. Pay per query, MCP-ready.

- **URL**: https://apify.com/johnvc/brave-ai-mode-api.md
- **Developed by:** [John](https://apify.com/johnvc) (community)
- **Categories:** AI, SEO tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## Brave AI Mode API | Privacy-Search Intelligence

Track Brave Search's AI Mode answers for any query and get the AI-generated answer, its cited sources, and the supporting web results as structured JSON. Brave is the privacy-first search engine, and its AI Mode answers reflect a different index and a different audience than mainstream search. Use this API to monitor what Brave's AI tells users about your brand, product, or topic, and which sources it cites.

Built for privacy-tech, infosec, and journalism: send one query or many, and get one clean row per query with the answer as markdown, the structured text blocks, the cited references, and the underlying web results.

### What you get

One row per query:

- `ai_mode_present`: whether Brave returned an AI Mode answer
- `markdown`: the full answer as markdown
- `text_blocks`: the structured content blocks (headings, paragraphs, lists)
- `references`: the cited sources, each with index, title, and link
- `web_results`: the supporting web results behind the answer, with title, link, snippet, source, and date
- `related_questions`: follow-up questions Brave associates with the answer

### Use cases

- Monitor what Brave's AI Mode says about your brand or product
- Compare Brave's cited sources against other engines for AEO research
- Track the privacy-search narrative on security, crypto, and policy topics
- Give an AI agent a privacy-first answer plus its sources in one call
- Audit answer drift over time by re-running key queries on a schedule

### Input

| Field | Type | Description |
|-------|------|-------------|
| `query` | string | A single query, e.g. `what is quantum computing`. Provide this, `queries`, or both. |
| `queries` | array of strings | A batch of queries to resolve in one run. Merged with `query` and de-duplicated. |
| `country` | string | Optional two-letter country code, e.g. `us`, `gb`, `de`. Default `us`. |
| `language` | string | Optional two-letter language code, e.g. `en`, `es`, `de`. Default `en`. |

#### Example input

```json
{
  "query": "what is quantum computing",
  "country": "us",
  "language": "en"
}
````

### Sample output

```json
{
  "result_type": "ai_mode",
  "query": "what is quantum computing",
  "country": "us",
  "language": "en",
  "ai_mode_present": true,
  "markdown": "Quantum computing is a type of computation that ...",
  "text_blocks": [
    { "type": "heading", "snippet": "What is quantum computing?" },
    { "type": "paragraph", "snippet": "Quantum computing uses qubits ..." }
  ],
  "references": [
    { "index": 1, "title": "Quantum computing - Wikipedia", "link": "https://en.wikipedia.org/..." }
  ],
  "web_results": [
    { "title": "Quantum computing explained", "link": "https://example.com/...", "snippet": "...", "source": "example.com" }
  ]
}
```

### Pricing

Pay per query: a flat **$0.015 per query** resolved, whether or not an AI Mode answer is shown (the lookup runs either way). No setup fee, no per-run fee. Batch many queries in one run.

### How to get started

1. Open [Brave AI Mode API on the Apify Store](https://apify.com/johnvc/brave-ai-mode-api?fpr=9n7kx3).
2. Enter a `query` (or a `queries` list of brand or topic terms).
3. Run the Actor and read the AI Mode answer, its sources, and web results from the dataset.
4. Export as JSON, CSV, or Excel, or pull it from the API. Schedule it to track changes.

Prefer code? See [johnvc's GitHub for setup guides and code examples](https://github.com/johnisanerd/ApifyPublicData).

### Run from the API

```bash
curl -X POST "https://api.apify.com/v2/acts/johnvc~brave-ai-mode-api/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query":"what is quantum computing","country":"us"}'
```

### 🔌 Use this API from Claude (MCP)

This Actor is compatible with the Model Context Protocol (MCP), so AI agents can call it as a tool. Add it through the hosted Apify MCP server using this Actor-specific URL:

https://mcp.apify.com/?tools=actors,docs,johnvc/brave-ai-mode-api

If you run agents from [Claude Code](https://claude.ai/referral/uIlpa7nPLg) (free trial) or [Claude Cowork](https://claude.ai/referral/uIlpa7nPLg) (free trial), add the Apify MCP server and ask it to "check what Brave AI Mode says about our product across these queries."

Setup walkthrough:

https://www.youtube.com/watch?v=jREWahDGhJM

Apify MCP integration docs: https://docs.apify.com/platform/integrations/mcp

#### MCP setup, step by step

Visual setup guides for each client (source and more assets: [ApifyPublicData on GitHub](https://github.com/johnisanerd/ApifyPublicData)):

**[Claude Cowork Desktop](https://claude.ai/referral/uIlpa7nPLg)** (free trial)

![Apify MCP install screenshot for the Cowork desktop app](https://raw.githubusercontent.com/johnisanerd/ApifyPublicData/main/assets/guides/install_mcp_into_claude_desktop.png)

**[Claude Code](https://claude.ai/referral/uIlpa7nPLg)** (free trial)

![Apify MCP install screenshot for the Code CLI](https://raw.githubusercontent.com/johnisanerd/ApifyPublicData/main/assets/guides/install_mcp_into_claude_code.png)

**Claude (website)**

![Install in Claude website](https://raw.githubusercontent.com/johnisanerd/ApifyPublicData/main/assets/guides/install_mcp_into_claude_ai.png)

**Cursor**

![Install in Cursor](https://raw.githubusercontent.com/johnisanerd/ApifyPublicData/main/assets/guides/install_mcp_into_cursor.png)

**ChatGPT**

![Install in ChatGPT](https://raw.githubusercontent.com/johnisanerd/ApifyPublicData/main/assets/guides/install_mcp_into_ChatGPT.png)

### FAQ

**What is Brave AI Mode?** It is the AI-generated answer Brave Search produces for many queries, with cited sources and supporting web results. This API returns that answer and its sources as structured data.

**Do I get charged if no answer is shown?** Yes, a flat per-query fee, because the lookup runs either way. The row will have `ai_mode_present: false` and a short `note`.

**Why Brave specifically?** Brave is privacy-first and uses an independent index, so its AI answers and cited sources can differ from mainstream engines. That makes it valuable for AEO research and privacy-aware audiences.

**Can I monitor many terms at once?** Yes. Pass a `queries` list; each is resolved independently and returned as its own row.

### Featured Tasks

Ready-to-run examples that show this API solving a specific problem. Each opens its own setup so you can run it on your account in one click.

- [Track Brand Mentions in Brave AI Search Answers](https://apify.com/johnvc/brave-ai-mode-api/examples/track-brand-mentions-in-brave-ai-search-answers?fpr=9n7kx3) - monitor whether your brand appears in Brave's AI Mode answers across a list of queries, with the `ai_mode_present` flag, answer markdown, and cited references.
- [Brave Search API Alternative: AI Answers as JSON](https://apify.com/johnvc/brave-ai-mode-api/examples/brave-search-api-alternative-ai-answers-as-json?fpr=9n7kx3) - get Brave's AI Mode answer and cited references for a query as structured JSON, with no Brave API key.
- [Brave Search AI for Claude via MCP, No API Key](https://apify.com/johnvc/brave-ai-mode-api/examples/brave-search-ai-for-claude-via-mcp-no-api-key?fpr=9n7kx3) - use Brave's AI Mode answer as a tool in Claude through MCP, returning the answer markdown and cited references.

Last Updated: 2026.06.15

# Actor input Schema

## `query` (type: `string`):

Enter a single query to fetch the Brave AI Mode answer for, for example 'what is quantum computing'. Provide this, `queries`, or both. AI Mode answers appear for informational, question-style searches.

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

Provide a list of queries to resolve in one run. Merged with `query` and de-duplicated. Use this for batch monitoring.

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

Set the two-letter country code for the search (e.g. 'us', 'gb', 'de'). Defaults to 'us'.

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

Set the two-letter interface language code (e.g. 'en', 'es', 'de'). Defaults to 'en'.

## Actor input object example

```json
{
  "query": "what is quantum computing",
  "country": "us",
  "language": "en"
}
```

# Actor output Schema

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

All AI Mode rows stored in the default dataset, one item per query.

# 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 = {
    "query": "what is quantum computing",
    "country": "us",
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("johnvc/brave-ai-mode-api").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 = {
    "query": "what is quantum computing",
    "country": "us",
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("johnvc/brave-ai-mode-api").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 '{
  "query": "what is quantum computing",
  "country": "us",
  "language": "en"
}' |
apify call johnvc/brave-ai-mode-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Brave AI Mode API | Privacy-Search Intelligence",
        "description": "Track Brave Search's AI Mode answers for any query: get the AI-generated answer, its cited sources, and the supporting web results as structured JSON. Built for privacy-search intelligence, infosec research, and journalism. Pay per query, MCP-ready.",
        "version": "0.0",
        "x-build-id": "Bgt566R79EX3ZVN5n"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/johnvc~brave-ai-mode-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-johnvc-brave-ai-mode-api",
                "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/johnvc~brave-ai-mode-api/runs": {
            "post": {
                "operationId": "runs-sync-johnvc-brave-ai-mode-api",
                "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/johnvc~brave-ai-mode-api/run-sync": {
            "post": {
                "operationId": "run-sync-johnvc-brave-ai-mode-api",
                "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",
                "properties": {
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Enter a single query to fetch the Brave AI Mode answer for, for example 'what is quantum computing'. Provide this, `queries`, or both. AI Mode answers appear for informational, question-style searches."
                    },
                    "queries": {
                        "title": "Search Queries",
                        "type": "array",
                        "description": "Provide a list of queries to resolve in one run. Merged with `query` and de-duplicated. Use this for batch monitoring.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "country": {
                        "title": "Country Code",
                        "type": "string",
                        "description": "Set the two-letter country code for the search (e.g. 'us', 'gb', 'de'). Defaults to 'us'.",
                        "default": "us"
                    },
                    "language": {
                        "title": "Language Code",
                        "type": "string",
                        "description": "Set the two-letter interface language code (e.g. 'en', 'es', 'de'). Defaults to 'en'.",
                        "default": "en"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
