# 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:** 8 total users, 6 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $12.86 / 1,000 ai mode querieds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

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

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

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

# README

## Brave AI Mode API | Privacy-Search Intelligence & Brave Search AI Answers

Track Brave Search 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

### 🔌 Integrations: Monitor Brave Search AI Answers on a Schedule

A single run answers one query. The real value comes from running the Brave AI Mode API repeatedly and watching how the answers, their cited sources, and the supporting web results shift over time. Wire it into the tools you already use with [Apify integrations](https://docs.apify.com/platform/integrations).

#### Tasks and schedules (the core recipe)

Save one [task](https://docs.apify.com/platform/actors/running/tasks) per thing you monitor: a "brand-watch" task with your brand queries, a "policy-watch" task with topic queries. Then attach one [schedule](https://docs.apify.com/platform/schedules) from the Actor's Actions, then Schedule menu. One schedule can trigger many tasks at once.

Common cron strings:

- `0 7 * * *` runs daily at 7 AM
- `0 */6 * * *` runs every six hours
- `0 9 * * 1` runs every Monday morning

The [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) task is a ready-made starting point for a scheduled brand monitor.

#### n8n

Available as an n8n community node, [n8n-nodes-brave-ai-mode-api](https://www.npmjs.com/package/n8n-nodes-brave-ai-mode-api). A four-step workflow: Schedule Trigger, then the Brave AI Mode API node, then a Filter on `ai_mode_present`, then a Slack or email node so you only get pinged when an answer changes. The n8n integration section below has install steps.

#### Make and Zapier

Connect the same output to thousands of apps with [Make](https://docs.apify.com/platform/integrations/make) and [Zapier](https://docs.apify.com/platform/integrations/zapier): run the Actor, then map the `markdown` and `references` fields into a spreadsheet row, a ticket, or a chat message.

#### Store history in Supabase

Send every run into a database so the answers accumulate into a history you can query. No-code path: an n8n Actor node, then a Supabase node. In Python, run the Actor and bulk-insert the flat rows with `apify-client` and `supabase`:

```python
from apify_client import ApifyClient
from supabase import create_client

apify = ApifyClient("YOUR_APIFY_TOKEN")
db = create_client("YOUR_SUPABASE_URL", "YOUR_SUPABASE_KEY")

run = apify.actor("johnvc/brave-ai-mode-api").call(run_input={
    "queries": ["what is quantum computing", "best privacy search engine"],
    "country": "us",
})

rows = []
for item in apify.dataset(run.default_dataset_id).iterate_items():
    rows.append({
        "query": item.get("query"),
        "ai_mode_present": item.get("ai_mode_present"),
        "markdown": item.get("markdown"),
        "references": item.get("references"),
        "web_results": item.get("web_results"),
    })

db.table("brave_ai_answers").insert(rows).execute()
```

#### MCP and AI agents

Add the Actor to any MCP client through the [Apify MCP server](https://mcp.apify.com/) and let an agent pull Brave's privacy-first answers on demand. From [Claude Code](https://claude.ai/referral/uIlpa7nPLg) (free trial) or Cursor you can ask it to "check what Brave Search AI says about our product across these queries." The MCP section below covers the Brave Search MCP setup and the timing notes.

#### Webhooks

For anything custom, add an [Apify webhook](https://docs.apify.com/platform/integrations/webhooks) on the `ACTOR.RUN.SUCCEEDED` event to push each finished run into your own endpoint.

### 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 call timing (waitSecs)

Brave's AI Mode answers are generated on demand, so a run here commonly takes **45 to 110 seconds**. That is longer than the hosted MCP `call-actor` wait window, where `waitSecs` defaults to 30 and maxes out at 45. If you call this Actor over MCP with the defaults, the tool call can return while the run is still `RUNNING`, with no items yet or only a partial set. The run is healthy: it simply finishes after the wait window has closed, and the full data lands in the dataset a short time later.

Two ways to handle it:

- **Set `waitSecs: 45`** (the maximum) to give the run as long as MCP allows. This covers the faster queries, but a slow answer can still run past 45 seconds.
- **Fire-and-forget, then poll** (the reliable pattern for this Actor): call with `waitSecs: 0` to start the run and get a `runId` and `datasetId` back right away, then read the results from the dataset (for example with the `get-dataset-items` tool) once the run reaches `SUCCEEDED`. Because Brave answers frequently exceed 45 seconds, this is the recommended approach.

An immediate `RUNNING` status, or an empty or partial first response, is expected behavior over MCP, not an error.

#### 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)

### 💸 Pay per run with crypto (x402)

The Brave AI Mode API supports agentic payments via the [x402 protocol](https://docs.apify.com/platform/integrations/x402).
AI agents and MCP clients can pay for runs in USDC (on Base) with no Apify account or API token needed:
point your agent at the [Apify MCP server](https://mcp.apify.com/?tools=actors,docs,johnvc/brave-ai-mode-api) and it can
discover, pay for, and run this Actor autonomously. Read the
[Apify x402 announcement](https://apify.com/change-log/pay-for-apify-actors-with-x402?fpr=9n7kx3) for details.

### 🔗 Related Tools

Track answer engines across the whole search landscape, not just Brave. These related Actors from the same portfolio cover the other AI answer surfaces and privacy engines:

- [Google AI Overview API](https://apify.com/johnvc/Google-AI-Overview-API?fpr=9n7kx3): capture Google's AI Overview answers and their cited sources for the same queries you track on Brave.
- [Bing Copilot AI Answers API](https://apify.com/johnvc/bing-copilot-api?fpr=9n7kx3): monitor Microsoft's Copilot answers for AEO coverage on Bing.
- [Naver AI Overview API](https://apify.com/johnvc/naver-ai-overview-api?fpr=9n7kx3): track AI answers on Korea's largest search engine for Korean-market AEO.
- [DuckDuckGo Scraper](https://apify.com/johnvc/DuckDuckGo-Scraper-for-serp-rankings?fpr=9n7kx3): pull organic results from another privacy-first engine to compare against Brave.

Other Brave AI Actors exist on the Store, but public run statistics tell the story: one widely listed [Brave Search MCP alternative](https://apify.com/clearpath/brave-search-mcp?fpr=9n7kx3) shows a recent run success rate near 40 percent, while this API reports a 100 percent recent success rate and returns clean, consistent JSON on every query.

### 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.

#### Can I schedule the Brave AI Mode API to run automatically?

Yes. Any run can be automated on a [schedule](https://docs.apify.com/platform/schedules). Create a [saved task](https://docs.apify.com/platform/actors/running/tasks) with your queries, then attach a schedule from the Actor's Actions, then Schedule menu. Use cron strings like `0 7 * * *` for daily at 7 AM, `0 */6 * * *` for every six hours, or `0 9 * * 1` for Monday mornings, and remember that one schedule can trigger many tasks at once. The Integrations section above has the full monitoring recipe.

#### Should I use an API or a web scraper for Brave AI answers?

Both describe the same job here. An official search [API](https://en.wikipedia.org/wiki/API) is rate limited, quota bound, and often missing the AI answer entirely, while a [web scraper](https://en.wikipedia.org/wiki/Web_scraping) reads what a real browser sees. This Actor gives you the clean, structured result of a scraper through a simple API endpoint you call yourself, with no separate Brave key and no quota to manage.

#### Can I integrate this Brave Search scraper with other apps?

Yes. The Actor connects to almost any cloud service through [Apify integrations](https://docs.apify.com/platform/integrations): [Make](https://docs.apify.com/platform/integrations/make), [Zapier](https://docs.apify.com/platform/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), Google Sheets, and more. For custom actions, add an [Apify webhook](https://docs.apify.com/platform/integrations/webhooks) on `ACTOR.RUN.SUCCEEDED`. The Integrations section above has copy-paste recipes.

#### Can I use the Brave AI Mode API with the Apify API?

Yes. The Apify API gives you programmatic access to run the Actor, schedule it, and fetch datasets, and the `apify-client` package is available for both Node.js and Python. See the Actor's own [API tab](https://apify.com/johnvc/brave-ai-mode-api/api?fpr=9n7kx3) for ready-made snippets.

#### Can I use Brave Search through an MCP server?

Yes. The Actor can be added as a tool to any MCP client, including Claude, Cursor, and ChatGPT, through the hosted [Apify MCP server](https://mcp.apify.com/). Use the Actor-specific URL `https://mcp.apify.com/?tools=actors,docs,johnvc/brave-ai-mode-api`. From [Claude Code](https://claude.ai/referral/uIlpa7nPLg) (free trial) you can run Brave Search MCP queries directly inside your agent. If a client reports "could not connect to MCP server brave search", re-check the server URL and that the Actor tool is enabled. See the [Apify MCP docs](https://docs.apify.com/platform/integrations/mcp) and the MCP section above for timing notes.

#### Is the Brave Search API free, and do I need an API key?

There is no free public Brave AI Mode endpoint, and you do not need your own Brave Search API key to use this Actor. You pay a small flat fee per query resolved on Apify, and the lookup is handled for you. That is what people are after when they search how to get a Brave Search API key: this Actor removes that step.

#### What makes Brave Search's AI answers unique?

Brave runs an independent index and is privacy-first, so its AI Mode answers and the sources they cite can differ from mainstream engines. You can read more about the engine at [Brave Search](https://search.brave.com/). That independent view is what makes Brave valuable for answer-engine optimization and privacy-aware research.

#### How can I track other AI search and AEO tools?

Answer-engine optimization spans more than one engine. Pair this Actor with the [Google AI Overview API](https://apify.com/johnvc/Google-AI-Overview-API?fpr=9n7kx3), the [Bing Copilot AI Answers API](https://apify.com/johnvc/bing-copilot-api?fpr=9n7kx3), and the [Naver AI Overview API](https://apify.com/johnvc/naver-ai-overview-api?fpr=9n7kx3) to cover Google, Microsoft, and Korean AI answers with the same monitoring workflow. See Related Tools above for the full list.

### n8n integration

Available as an n8n community node, **[n8n-nodes-brave-ai-mode-api](https://www.npmjs.com/package/n8n-nodes-brave-ai-mode-api)**. In n8n: Settings, Community Nodes, install `n8n-nodes-brave-ai-mode-api`, then use it in any workflow (it also works as an AI Agent tool).

### 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: get the ai\_mode\_present flag, answer markdown, and cited references as JSON.
- [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) - A Brave Search API alternative, no Brave key: get the AI Mode answer markdown, an ai\_mode\_present flag, and cited references as JSON.
- [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 answers as a tool in Claude via MCP, no Brave API key.
- [Track sources cited in Brave AI answers](https://apify.com/johnvc/brave-ai-mode-api/examples/track-sources-cited-in-brave-ai-answers?fpr=9n7kx3) - See which sites Brave AI cites for your keywords.
- [Export Brave AI answers to CSV](https://apify.com/johnvc/brave-ai-mode-api/examples/export-brave-ai-answers-to-csv?fpr=9n7kx3) - Export Brave AI answers to CSV for any keywords.
- [Check Brave AI answers for many keywords](https://apify.com/johnvc/brave-ai-mode-api/examples/check-brave-ai-answers-for-many-keywords?fpr=9n7kx3) - Check Brave AI answers across a list of keywords in one run.

***

### 🌐 About Alpha OSINT

This Actor is part of [Alpha OSINT](https://www.alphaosint.com), toolset of financial and operations data sources and APIs.
See the [Brave AI Mode API source page](https://www.alphaosint.com/sources/brave-ai-mode-api/) for related tools and use cases.
For support or requests for this actor, please start a ticket [directly on our support page](https://apify.com/johnvc/brave-ai-mode-api/issues/open?fpr=9n7kx3).

Last Updated: 2026.09.09

# 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(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 '{
  "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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,johnvc/brave-ai-mode-api"
        }
    }
}

```

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/u2azjcqJVle8Jbjyy/builds/alUbct8TMgkz1j5sK/openapi.json
