# Brave Search API (`visita/brave-search-api`) Actor

The fastest, cheapest, and most privacy-focused way to scrape search engine results (SERPs). A robust alternative to Google Search API. Brave Search Scraper allows you to extract real-time search results from the Brave Search engine without worrying about CAPTCHA's or complex anti-bot systems.

- **URL**: https://apify.com/visita/brave-search-api.md
- **Developed by:** [Visita Intelligence](https://apify.com/visita) (community)
- **Categories:** SEO tools, News, Videos
- **Stats:** 84 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Search Scraper (BYOK Edition)

**The fastest, cheapest, and most privacy-focused way to scrape search engine results (SERPs). Bring your own Brave API Key.**

***

### What is Brave Search Scraper?

**Brave Search Scraper** allows you to extract real-time search results from the [Brave Search](https://search.brave.com/) engine using your own API credentials.

This actor is designed to be a **low-cost utility**. Instead of paying markup fees for search data, you simply provide your own Brave API Key. This means you pay the direct provider rate (or use their Free Tier) and only pay for the Apify Compute units used to run this scraper.

#### Why use this actor?

- 💸 **Cheapest Option:** No per-result markup. You pay Brave directly (Free tier offers ~2,000 queries/month for free).
- 🚀 **Fast & Lightweight:** Uses the native API, so it runs in seconds, minimizing Apify Compute costs.
- 🛡️ **Private:** 100% anonymous scraping. No tracking, no CAPTCHAs, and no IP bans.
- 🌍 **Localized:** Get accurate results for specific regions (e.g., **South Africa 🇿🇦**, USA 🇺🇸, UK 🇬🇧).

#### What data can you extract?

| Data Type | Description |
| :--- | :--- |
| **🌐 Web Search** | Standard organic search results with titles, descriptions, and URLs. |
| **📰 News** | Real-time news articles with publication dates and provider names. |
| **🎥 Videos** | Video results including **Duration**, **View Counts**, and **Thumbnails**. |
| **🖼️ Images** | Image search results with direct thumbnail links. |
| **🥽 Goggles** | Custom re-ranking using Brave Goggles (e.g., "Tech Blogs only"). |
| **💡 Suggestions** | **Auto-complete keywords** for SEO research and content planning. |
| **✍️ Spellcheck** | Grammar and spelling corrections for raw text. |

***

### 💸 Pricing (BYOK Model)

This Actor follows a **Bring Your Own Key** model to keep costs as low as possible.

1. **Apify Fee:** You pay only for the **Compute Units** (runtime) required to run the scraper. Because this actor is lightweight, these costs are negligible.
2. **Brave API Fee:** You manage your own subscription with Brave.
   - **Free Tier:** Brave offers a generous free tier (usually 2,000 queries/month).
   - **Paid Tier:** If you need high volume, you pay Brave directly (approx $3.00 per 1,000 queries).

***

### 🚀 The Intelligence Ecosystem

This scraper is the **Data Ingestion Layer** for our advanced intelligence actors. You can use the raw data from this actor to power:

- **Brand Sentiment Analyzer:** (Coming Soon) Pipe these search results into our sentiment actor to analyze public perception of a brand or topic.
- **Deep Research Agent:** (Coming Soon) Aggregate news and web results to generate comprehensive market reports.
- **Competitor Monitor:** Track what is being said about competitors in real-time.

***

### 🎓 How to use

1. **Get a Brave API Key:**
   - Go to [Brave Search API](https://api.search.brave.com/app/keys).
   - Sign up and create a new key (Select "Search API").
2. **Configure the Actor:**
   - Paste your key into the **Brave Search API Key** field.
   - *(Optional)* If you have specific keys for Suggest or Spellcheck, enter them in their respective fields.
   - Enter your search terms (e.g., `best ai automation agencies`).
   - Select your Country (e.g., `🇿🇦 South Africa`).
3. **Run & Export:**
   - Click **Start**.
   - Download your data in JSON, CSV, or Excel format.

***

### ⬇️ Input Configuration

| Field | Description | Example |
| :--- | :--- | :--- |
| **🔑 Brave Search API Key** | **Required.** Primary key for Web, News, Images. | `BSAQP...` |
| **💡 Suggest API Key** | Optional key for Autocomplete. | `BS...` |
| **✍️ Spellcheck API Key** | Optional key for Spellcheck. | `BS...` |
| **🔍 Search Keywords** | The main topic you want to search for. | `solar panel prices` |
| **🔢 Max Results** | Limit the number of items to process. | `50` |
| **📍 Country** | **Crucial for SEO.** Determines where the search "originates" from. | `ZA` (South Africa) |
| **📂 Result Types** | Pick what to scrape. Multi-select allowed. | `Web Pages`, `News` |

***

### ⚖️ Legal & Compliance

This Actor utilizes the **Brave Search API**. By using this Actor, you agree to adhere to Brave's standard Terms of Service:

1. **Transient Use:** Data fetched is generally intended for immediate use (display, reporting, or processing) rather than permanent storage to build a competing search engine.
2. **AI Training:** If using this data to train LLMs, ensure compliance with Brave's specific "Data for AI" policies.
3. **Privacy:** Always respect local data privacy regulations (GDPR, POPIA, CCPA) when processing results containing personal data.

***

### 📞 Support & Feedback

If you have questions about this actor or our **Premium Intelligence Actors**, please reach out via the Issues tab.

- [Report a Bug](https://console.apify.com/actors/YOUR_ACTOR_ID/issues)
- [Request a Feature](https://console.apify.com/actors/YOUR_ACTOR_ID/issues)

# Actor input Schema

## `apiKey` (type: `string`):

Primary key for Web, News, Video, and Image search.

## `apiKeySuggest` (type: `string`):

Specific key for Autocomplete/Suggest. If left empty, the Search Key will be used.

## `apiKeySpellcheck` (type: `string`):

Specific key for Spellcheck. If left empty, the Search Key will be used.

## `mode` (type: `string`):

Select the operation mode.

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

Enter one or more queries to process.

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

The country context.

## `maxResults` (type: `integer`):

Limit results per query.

## `resultFilter` (type: `array`):

Select the type of content to scrape.

## `searchLang` (type: `string`):

The language of the results.

## `freshness` (type: `string`):

Filter results by time.

## `autoCorrect` (type: `boolean`):

If enabled, Brave will automatically correct spelling mistakes (e.g., 'appple' -> 'apple'). Uncheck to search exactly what you typed.

## `safeSearch` (type: `string`):

Filter adult content.

## `extraSnippets` (type: `boolean`):

Fetch up to 5 additional text excerpts per result.

## `goggles` (type: `string`):

URL for a custom Brave Goggle.

## Actor input object example

```json
{
  "apiKey": "YOUR_BRAVE_API_KEY",
  "mode": "search",
  "queries": [
    "best ai automation agencies 2025"
  ],
  "country": "ALL",
  "maxResults": 20,
  "resultFilter": [
    "web"
  ],
  "searchLang": "en",
  "freshness": "",
  "autoCorrect": true,
  "safeSearch": "moderate",
  "extraSnippets": false
}
```

# Actor output Schema

## `overview` (type: `string`):

Main search results including Web, News, Videos, and Images.

## `suggestions` (type: `string`):

Keyword ideas and spellcheck corrections.

## `videos` (type: `string`):

Detailed video metrics like duration and views.

## `raw` (type: `string`):

The complete, unfiltered dataset.

# 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 = {
    "apiKey": "YOUR_BRAVE_API_KEY",
    "queries": [
        "best ai automation agencies 2025"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("visita/brave-search-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 = {
    "apiKey": "YOUR_BRAVE_API_KEY",
    "queries": ["best ai automation agencies 2025"],
}

# Run the Actor and wait for it to finish
run = client.actor("visita/brave-search-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 '{
  "apiKey": "YOUR_BRAVE_API_KEY",
  "queries": [
    "best ai automation agencies 2025"
  ]
}' |
apify call visita/brave-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,visita/brave-search-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/nYHxEQq02YICddTQL/builds/VUHt9nPi6yudcLbRX/openapi.json
