# Brave Search API | Web, Image & Video Results (`clearpath/brave-search-api`) Actor

Extract structured web, image, and video search results from Brave Search. Up to 100 web results, 200 images, and 60 videos per query. Filter by 38 countries, time period, and safety level.

- **URL**: https://apify.com/clearpath/brave-search-api.md
- **Developed by:** [ClearPath](https://apify.com/clearpath) (community)
- **Categories:** SEO tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 62 total users, 8 monthly users, 59.5% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.29 / 1,000 scraped search results

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?

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

[![Web. News. Discussions. One search. Up to 200 web results. Business contacts, images and videos.](https://api.apify.com/v2/key-value-stores/pJ7iaZsTFhR3k9tjV/records/brave-search-api-readme-hero-v1.png)](https://console.apify.com/actors/VHU8FUyEga22BNETx/input)

From **Clearpath**, creators of [Google AI Overview](https://apify.com/clearpath/google-ai-overview), [SpyFu Intelligence](https://apify.com/clearpath/spyfu-scraper) and [Google Ads Transparency](https://apify.com/clearpath/google-ads-transparency-scraper). Search results, competitor research and advertising data from the same team.

### Why choose this actor?

- **Get more than a list of links.** Export up to **200 web results** alongside available news, discussions, knowledge panels and FAQ answers. Discussion records can include the forum, score and top comment; news records include the publisher and headline.
- **Find business contacts in the same search.** Local results can include phone numbers, full addresses, ratings, opening hours and coordinates. Search by business type and city to find useful contact details alongside the web results.
- **Add images and videos without changing tools.** Enable both options to collect image URLs and dimensions, plus video creators, durations and view counts where available. Filter your search by country and recency, then export JSON, CSV or Excel.

<a href="https://console.apify.com/actors/VHU8FUyEga22BNETx/input"><img src="https://api.apify.com/v2/key-value-stores/pJ7iaZsTFhR3k9tjV/records/brave-search-api-readme-cta-v1.svg" width="252" height="48" alt="Try your search query" /></a>

#### Try a search with all result types enabled

```json
{
  "query": "coffee shops in Berlin",
  "maxResults": 5,
  "country": "de",
  "includeExtras": true,
  "includeLocations": true,
  "includeImages": true,
  "includeVideos": true
}
```

[Open actor input](https://console.apify.com/actors/VHU8FUyEga22BNETx/input) and replace the query with your topic or city. This example requests five web results plus available extra sections, images and videos. Increase `maxResults` to **200** for broader web coverage. Result types and counts depend on what Brave returns.

Free Apify accounts get five lifetime runs, capped at 20 total records per run. Full exports require a paying Apify account. Web results carry the main result charge; every exported record also carries a small dataset-item charge. See pricing below.

<table>
<tr>
<td style="background:#FF5500;color:#191512;padding:10px 14px;font-size:13px;font-weight:700;border-radius:4px 4px 0 0">Clearpath · Search &amp; Advertising Intelligence</td>
</tr>
<tr>
<td style="padding:6px;border:1px solid #EBCAB1;border-top:none;border-radius:0 0 4px 4px;background:#FFF0E5">
<span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFE0CA"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-VHU8FUyEga22BNETx-irbNgcPHFQ-brave-search-api-logo.png" width="20" height="20" alt="" style="vertical-align:middle"/>&nbsp;&nbsp;<a href="https://apify.com/clearpath/brave-search-api" style="color:#422716;text-decoration:none;font-weight:700;font-size:13px">Brave Search</a></span><br><span style="color:#633E25;font-size:12px;white-space:nowrap">You are here</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF0E5"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-fVz6tfmTCAkBxvBbF-0Uk5X3JrAZ-dataforseo-scraper-logo.png" width="20" height="20" alt="" style="vertical-align:middle"/>&nbsp;&nbsp;<a href="https://apify.com/clearpath/dataforseo" style="color:#422716;text-decoration:none;font-weight:700;font-size:13px">DataForSEO</a></span><br><span style="color:#633E25;font-size:12px;white-space:nowrap">Keyword volume &amp; backlinks</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF0E5"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-oK9eSdSqGJk9kJUQf-XcZUFyzJxs-google-ai-summary-scraper-logo.png" width="20" height="20" alt="" style="vertical-align:middle"/>&nbsp;&nbsp;<a href="https://apify.com/clearpath/google-ai-overview" style="color:#422716;text-decoration:none;font-weight:700;font-size:13px">AI Overview</a></span><br><span style="color:#633E25;font-size:12px;white-space:nowrap">Answers & citations</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF0E5"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-7Fs85gfq1XtijG7IC-y9u1RUdU14-spyfu-logo.png" width="20" height="20" alt="" style="vertical-align:middle"/>&nbsp;&nbsp;<a href="https://apify.com/clearpath/spyfu-scraper" style="color:#422716;text-decoration:none;font-weight:700;font-size:13px">SpyFu</a></span><br><span style="color:#633E25;font-size:12px;white-space:nowrap">Keywords & ad history</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF0E5"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-94IAdoWZXpv3cHXzD-V6dJa2yC7K-google-ads-transparency-scraper.png" width="20" height="20" alt="" style="vertical-align:middle"/>&nbsp;&nbsp;<a href="https://apify.com/clearpath/google-ads-transparency-scraper" style="color:#422716;text-decoration:none;font-weight:700;font-size:13px">Google Ads</a></span><br><span style="color:#633E25;font-size:12px;white-space:nowrap">Creatives & advertisers</span></span>
</td>
</tr>
</table>

#### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
clearpath/brave-search-api on Apify. Call: ApifyClient("TOKEN").actor("clearpath/brave-search-api").call(run_input={...}), then client.dataset(run["defaultDatasetId"]).list_items().items for results. Key inputs: query (string, required), maxResults (integer, default 100), country (string, default "us"). Full actor spec (input schema with all params/enums/defaults, output dataset fields, README): GET https://api.apify.com/v2/acts/clearpath~brave-search-api/builds/default (Bearer TOKEN) → inputSchema, actorDefinition.storages.dataset, readme. Get token: https://console.apify.com/account/integrations
```

### Quick Start

#### Basic web search

```json
{
    "query": "best restaurants in Berlin"
}
```

#### With image and video results

```json
{
    "query": "golden gate bridge",
    "includeImages": true,
    "includeVideos": true
}
```

#### German results from the past week

```json
{
    "query": "Nachrichten",
    "country": "de",
    "timeFilter": "pw",
    "maxResults": 50
}
```

### Input Parameters

| Parameter | Type | Description | Default |
|-----------|------|-------------|---------|
| `query` | string | Search term. Works exactly like the Brave Search box. | *required* |
| `includeImages` | boolean | Fetch image results alongside web results. Up to 200 images per query. | `false` |
| `includeVideos` | boolean | Fetch video results alongside web results. Up to ~60 videos per query. | `false` |
| `maxResults` | integer | Max web results to return (1-200). Web results carry the main charge; all exported records also carry a dataset-item charge. | `100` |
| `country` | string | 2-letter country code. Controls both result region and language. 39 country settings. | `us` |
| `timeFilter` | string | Filter by recency: past day, week, month, or year. | Any time |
| `safesearch` | string | Content safety filter: off, moderate, or strict. | `off` |

### Output

Each result includes a `type` field so you can filter by result type in your pipeline. Web results are paginated up to `maxResults`. All other sections (discussions, news, locations, etc.) are extracted automatically from the first page of results.

#### Result types

| Type | Description | Key fields |
|------|-------------|------------|
| `web` | Standard search links | `title`, `url`, `description`, `age`, `page_age`, `language`, `subtype`, `hostname`, `favicon`, `thumbnail` |
| `discussion` | Reddit, GitHub, forum posts | `title`, `url`, `description`, `forum_name`, `score`, `top_comment`, `hostname` |
| `infobox` | Knowledge panel / Q\&A sidebar | `title`, `url`, `question`, `answer_text`, `answer_author`, `answer_upvotes`, `suggested_answers`, `attributes`, `providers` |
| `video_cluster` | Inline videos from web search | `title`, `url`, `duration`, `views`, `creator`, `publisher`, `thumbnail` |
| `news` | News cluster | `title`, `url`, `description`, `age`, `source_name`, `source_logo`, `thumbnail` |
| `faq` | FAQ schema results | `title`, `url`, `question`, `answer`, `hostname` |
| `rich` | Weather, calculator, stock, currency, etc. | `rich_type`, `data` (full structured data), `provider` |
| `location` | Local businesses with contact data | `title`, `url`, `address`, `phone`, `rating`, `reviews_count`, `price_range`, `categories`, `coordinates`, `opening_hours`, `thumbnail` |
| `image` | Dedicated image results (toggle) | `title`, `url`, `image_url`, `width`, `height`, `source`, `thumbnail` |
| `video` | Dedicated video results (toggle) | `title`, `url`, `duration`, `views`, `creator`, `publisher`, `thumbnail` |
| `search_metadata` | Query context | `original_query`, `country`, `city`, `coordinates`, `related_queries` |

#### Output example

Query: `"best coffee shops in berlin"` — 340 results (5 web, 9 discussions, 100 locations, 200 images, 18 videos, and more)

```json
[
  {
    "type": "web",
    "position": 1,
    "title": "Berlin | Brian's Coffee Spot",
    "url": "https://www.brian-coffee-spot.com/the-coffee-spot-guide-to/europe/berlin/",
    "description": "When talking of speciality coffee in Berlin, you can't avoid The Barn...",
    "age": "August 7, 2022",
    "page_age": "2022-08-07T03:07:47",
    "language": "en",
    "subtype": "generic",
    "hostname": "www.brian-coffee-spot.com",
    "thumbnail": "https://imgs.search.brave.com/..."
  },
  // ... 4 more web results

  {
    "type": "discussion",
    "position": 1,
    "title": "Coffee Shops in Berlin",
    "url": "https://www.reddit.com/r/Coffee/comments/7ahwkw/...",
    "description": "Go to the Barn, they have some great coffee.",
    "forum_name": "r/Coffee",
    "score": "3",
    "top_comment": "Go to the Barn, they have some great coffee."
  },
  // ... 8 more discussions

  {
    "type": "infobox",
    "title": "Best coffee in Berlin",
    "url": "https://www.reddit.com/r/askberliners/comments/...",
    "question": "Best coffee in Berlin",
    "answer_text": "Bonanza is a bit too pretentious for me, but worth checking out. Ben Rahim also has some interesting options.",
    "answer_author": "32452353",
    "answer_upvotes": 5,
    "suggested_answers": [
      { "text": "My favorite is DoubleEye, and if you walk down Goltz- and Akazienstraße there's a bunch more...", "author": "senfengel", "upvotes": 3 }
    ]
  },

  {
    "type": "video_cluster",
    "position": 1,
    "title": "3 of the best cafés for coffee and cake in Berlin",
    "url": "https://www.youtube.com/watch?v=4Hz-8xItLSs",
    "duration": "07:30",
    "views": 595,
    "creator": "Helen Edwards",
    "publisher": "YouTube"
  },
  // ... 5 more inline videos

  {
    "type": "location",
    "position": 1,
    "title": "Rausch Schokoladenhaus",
    "url": "https://rausch.de/schokoladenhaus",
    "address": "Charlottenstraße 60, 10117 Berlin, Germany",
    "phone": "+4930757880",
    "rating": 4.6,
    "reviews_count": 2630,
    "price_range": "$$ - $$$",
    "coordinates": { "lat": 52.512053, "lng": 13.3912058 },
    "opening_hours": {
      "Tuesday": "10:00-20:00",
      "Wednesday": "10:00-20:00",
      "Thursday": "10:00-20:00",
      "Friday": "10:00-20:00",
      "Saturday": "10:00-20:00",
      "Sunday": "12:00-20:00"
    },
    "thumbnail": "https://imgs.search.brave.com/..."
  },
  // ... 99 more locations with contact data

  {
    "type": "image",
    "position": 1,
    "title": "Concierge Coffee is one of The 15 Best Coffee Shops in Berlin.",
    "url": "https://foursquare.com/top-places/berlin/best-coffee-shops",
    "source": "foursquare.com",
    "image_url": "https://fastly.4sqi.net/img/general/699x268/...",
    "width": 699,
    "height": 268,
    "thumbnail": "https://imgs.search.brave.com/..."
  },
  // ... 199 more images

  {
    "type": "video",
    "position": 1,
    "title": "I found the BEST coffee shop in Berlin",
    "url": "https://www.youtube.com/watch?v=xCOplUM1mGY",
    "duration": "08:36",
    "creator": "pourtherecord",
    "publisher": "YouTube",
    "tags": ["coffee shops berlin"]
  },
  // ... 17 more videos

  {
    "type": "search_metadata",
    "original_query": "best coffee shops in berlin",
    "country": "us",
    "is_geolocal": true,
    "related_queries": [
      "best coffee in berlin mitte",
      "specialty coffee berlin",
      "berlin coffee roasters",
      "unusual cafes in berlin",
      "bonanza coffee berlin",
      "the barn berlin"
    ]
  }
]
```

***

### Pricing — Pay Per Event (PPE)

Web results carry the primary search-result charge. Every exported record, including bonus sections, images and videos, also carries a **$0.00001 dataset-item charge**.

| Charge | Price |
|---|---:|
| Web result, Free plan | $0.00299 |
| Web result, Bronze plan | $0.00279 |
| Web result, Silver plan | $0.00249 |
| Web result, Gold / Platinum / Diamond | $0.00229 |
| Exported dataset record, any type | $0.00001 |

Images, videos, discussions, news and locations have no additional **web-result** charge. Their dataset-item charge still applies.

***

### How Brave Search Results Work

#### Country controls language

The `country` parameter is the main lever for result language. Set `country` to `de` for German results, `fr` for French, `es` for Spanish. No separate language setting needed.

#### Result counts

| Type | Results per query | Notes |
|------|-------------------|-------|
| Web | ~20 per page, up to 200 | Automatic pagination based on `maxResults` |
| Discussions | Up to ~10 | Reddit, GitHub, forums |
| News | Up to ~8 | News cluster from first page |
| Locations | Up to ~30+ | Local businesses with address, phone, rating, hours |
| Infobox | 0-1 | Knowledge panel / Q\&A sidebar |
| Video cluster | Up to ~6 | Inline videos from web search |
| FAQ | Up to ~4 | FAQ schema answers |
| Rich | 0-1 | Weather, calculator, stock, currency widgets |
| Images (toggle) | Up to 200 | Single batch, no pagination |
| Videos (toggle) | ~60 max | 2 pages fetched automatically |

#### Time filtering

Use `timeFilter` to get recent results only. Works with web results. Useful for monitoring news, trending topics, or recent content.

***

### API Integration

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("your_token")
run = client.actor("clearpath/brave-search-api").call(run_input={
    "query": "machine learning trends 2026",
    "maxResults": 50,
    "includeImages": True
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["type"] == "web":
        print(f'{item["title"]} — {item["url"]}')
    elif item["type"] == "discussion":
        print(f'[{item["forum_name"]}] {item["title"]} (score: {item["score"]})')
    elif item["type"] == "location":
        print(f'{item["title"]} — {item.get("rating", "N/A")} stars')
    elif item["type"] == "news":
        print(f'[{item["source_name"]}] {item["title"]}')
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'your_token' });
const run = await client.actor('clearpath/brave-search-api').call({
    query: 'machine learning trends 2026',
    maxResults: 50,
    includeImages: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const webResults = items.filter(i => i.type === 'web');
const discussions = items.filter(i => i.type === 'discussion');
const news = items.filter(i => i.type === 'news');
const locations = items.filter(i => i.type === 'location');
```

***

### Advanced Usage

#### Multi-language research

Fetch results in different languages by changing the country code:

```json
{
    "query": "artificial intelligence",
    "country": "jp",
    "maxResults": 30
}
```

#### Strict safe search for family-friendly content

```json
{
    "query": "educational games for kids",
    "safesearch": "strict",
    "includeImages": true
}
```

#### Recent news monitoring

```json
{
    "query": "startup funding",
    "timeFilter": "pd",
    "maxResults": 50
}
```

***

### Data Export

- **JSON** — Structured data for programmatic use
- **CSV** — Spreadsheet-ready format
- **Excel** — Direct download from Apify Console

***

### Use with AI Assistants (OpenClaw, Claude, etc.)

Connect this actor to AI assistants via [Apify's MCP server](https://mcp.apify.com/). Ask your assistant to search the web using Brave.

#### Setup

1. Go to [mcp.apify.com](https://mcp.apify.com/) and add `clearpath/brave-search-api` to your MCP server
2. Connect the MCP server to your AI assistant ([OpenClaw](https://docs.openclaw.ai/), Claude Desktop, Cursor, etc.)

#### OpenClaw example

Add Apify's MCP server to `~/.openclaw/openclaw.json`:

```json5
{
  "provider": {
    "mcpServers": {
      "apify": {
        "command": "npx",
        "args": ["-y", "@apify/actors-mcp-server"],
        "env": {
          "APIFY_TOKEN": "your-apify-token"
        }
      }
    }
  }
}
```

Then message your OpenClaw bot on Telegram, WhatsApp, or Discord:

> "Search Brave for the latest AI research papers from this week"

> "Find images of modern architecture in Tokyo using Brave Search"

> "Get me 50 search results about renewable energy trends in Germany"

The assistant calls the Brave Search API, gets structured results, and responds with titles, URLs, and descriptions.

***

### Automation

- **Scheduled runs** — Monitor search trends daily or weekly
- **Webhooks** — Get notified when new results are ready
- **API** — Integrate search results into your data pipeline

***

### FAQ

**Q: How many results can I get per run?**
A: Up to 200 web results, 200 images, and ~60 videos per query. Every query also returns discussions, news, locations, knowledge panels, and other sections automatically. Web results are controlled by `maxResults`, images and videos return all available results when toggled on. Web results carry the main charge; all exported records also carry a dataset-item charge.

**Q: Does this need a Brave account?**
A: No. No account, login, or API key required.

**Q: How fresh is the data?**
A: Results are fetched live from Brave Search. Use `timeFilter` set to "Past day" for the most recent content.

**Q: Can I search in languages other than English?**
A: Yes. Set `country` to the target country code. For example, `de` for German, `fr` for French, `es` for Spanish. Brave returns results in the corresponding language.

**Q: What result types do I get?**
A: Every query returns web links plus any available discussions, news, locations, knowledge panels, FAQ answers, inline videos, and rich widgets (weather, stocks, etc.). Enable `includeImages` or `includeVideos` for dedicated image/video results on top of that. Each result has a `type` field for easy filtering.

**Q: Is there a free tier?**
A: Yes. Free users get 5 lifetime runs with up to 20 results each. Upgrade for unlimited usage.

**Q: How is pricing calculated?**
A: Web results cost $0.00229–$0.00299 each depending on your Apify plan. Every exported record also costs $0.00001, including bonus sections, images and videos. See the pricing table above.

**Q: Can I filter by date?**
A: Yes. Use `timeFilter` with values: past day, past week, past month, or past year.

***

### Support

- **Email**: max@mapa.slmail.me
- **Bugs**: Issues tab
- **Features**: Email or issues

### Legal Compliance

Extracts publicly available search results from Brave Search. Users must comply with applicable data protection regulations (GDPR, CCPA).

***

*Structured search results from Brave — web links, discussions, news, locations, knowledge panels, images, videos, and more in one query.*

# Actor input Schema

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

Enter any search term, just like you would on Brave Search.

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

Maximum number of web search results to return (1–200).<br>This only controls web links. Other sections (discussions, news, locations, etc.) are always returned in full.

## `includeExtras` (type: `boolean`):

Include discussions (Reddit, forums), news clusters, knowledge panels, FAQ answers, inline videos, and rich widgets (weather, stocks, currency) alongside web results.<br><br><b>Free</b> — bonus sections are included at no extra cost. Disable to get web links only.

## `includeLocations` (type: `boolean`):

Include local business results when Brave detects a location-relevant query (e.g. "restaurants in Berlin").<br><br>Each location includes address, phone number, rating, reviews, price range, opening hours, and coordinates. Can return 30+ results for local queries.<br><br><b>Free</b> — locations are included at no extra cost.

## `includeImages` (type: `boolean`):

Fetch dedicated image results alongside web results. Returns up to 200 images per query.<br><br><b>Free</b> — you only pay for web results, images are included at no extra cost.

## `includeVideos` (type: `boolean`):

Fetch dedicated video results alongside web results. Returns up to ~60 videos per query.<br><br><b>Free</b> — you only pay for web results, videos are included at no extra cost.

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

Controls both the result region and language.<br>For example, <code>de</code> returns German-language results, <code>fr</code> returns French.

## `timeFilter` (type: `string`):

Only return results published within the selected time period.

## `safesearch` (type: `string`):

Content safety filter. <b>Moderate</b> is the default.

## Actor input object example

```json
{
  "query": "best restaurants in Berlin",
  "maxResults": 100,
  "includeExtras": true,
  "includeLocations": true,
  "includeImages": false,
  "includeVideos": false,
  "country": "us",
  "timeFilter": "",
  "safesearch": "off"
}
```

# Actor output Schema

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

No description

# 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": "web scraping",
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("clearpath/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 = {
    "query": "web scraping",
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("clearpath/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 '{
  "query": "web scraping",
  "maxResults": 100
}' |
apify call clearpath/brave-search-api --silent --output-dataset

```

## MCP server setup

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