---
name: brave-api-search
description: Real-time web search and AI-powered answers using the official Brave Search API. Use for searching documentation, facts, current events, or any web content. Supports AI grounded answers with citations. Requires BRAVE_SEARCH_API_KEY and BRAVE_ANSWERS_API_KEY.
license: MIT
metadata:
  author: Broedkrummen
  version: 1.0.0
---

# Brave API Search

Real-time web search and AI-powered answers using the official Brave Search API. Two tools:
- `brave_search` — web results with titles, URLs, descriptions, optional AI summary
- `brave_answers` — AI-grounded answers with inline citations powered by live web search

## Setup

Set your Brave API keys as environment variables:

```bash
export BRAVE_SEARCH_API_KEY=your_key_here
export BRAVE_ANSWERS_API_KEY=your_key_here
```

Get your keys at: https://api-dashboard.search.brave.com

Both keys can be the same if your plan supports both Search and AI Answers endpoints.

## When to Use This Skill

**Use `brave_search` when:**
- Searching for current information, news, or recent events
- Looking up documentation or technical references
- Need ranked results with URLs to follow up on
- Want an AI summary of search results

**Use `brave_answers` when:**
- Need a synthesized answer with cited sources
- Researching topics that benefit from multiple sources
- Want AI-grounded responses with inline citations
- Deep research mode needed (multi-search)

**Don't use this skill for:**
- Questions already answered from context or memory
- Tasks that don't require external information

## Tools

### brave_search

Web search returning ranked results with titles, URLs, and descriptions.

```
brave_search(query="latest Node.js release", count=5)
brave_search(query="TypeScript generics", extra_snippets=true)
brave_search(query="current weather Copenhagen", freshness="pd")
brave_search(query="React Server Components", summary=true)
```

**Parameters:**
- `query` (required) — Search query, supports operators: `site:`, `"exact phrase"`, `-exclude`
- `count` — Results to return (1-20, default: 10)
- `country` — 2-letter country code (default: `us`)
- `freshness` — Date filter: `pd` (24h), `pw` (7 days), `pm` (31 days), `py` (1 year)
- `extra_snippets` — Include up to 5 extra text excerpts per result (default: false)
- `summary` — Fetch Brave AI summarizer result (default: false)

**Returns:** Formatted list of results with title, URL, description, and optional AI summary.

### brave_answers

AI-powered answers grounded in live web search with inline citations.

```
brave_answers(query="How does React Server Components work?")
brave_answers(query="Compare Postgres vs MySQL for OLAP", enable_research=true)
brave_answers(query="Latest Python release notes", enable_citations=true)
```

**Parameters:**
- `query` (required) — Question or topic to research
- `enable_citations` — Include inline source citations (default: true)
- `enable_research` — Multi-search deep research mode (default: false)
- `country` — Target country for search context (default: `us`)

**Returns:** AI answer with cited sources extracted from the response, plus token usage.

## Rate Limits

| Plan | QPS | Monthly |
|------|-----|---------|
| Free Search | 1 | 2,000 |
| Paid Search | 20 | Pay-per-use ($5/1k) |
| Paid Answers | 2 | $4/1k searches |

## API vs Web Scraping

This skill uses the **official Brave Search API** — not web scraping. Benefits:
- Reliable, structured JSON responses
- Rate limit headers and proper error messages
- Access to AI summarizer and AI answers endpoints
- Terms of service compliant
