# Brave Search

> Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content. Lightweight, no browser required.

- Skill: `tkoenig/brave-search` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add tkoenig/brave-search`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tkoenig/brave-search/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: tkoenig (https://skillmd.com/u/tkoenig)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tkoenig/brave-search

---


# Brave Search

Web search and content extraction using the official Brave Search API. No browser required.

## Setup

Requires a Brave Search API account with a free subscription. A credit card is required to create the free subscription (you won't be charged).

1. Create an account at https://api-dashboard.search.brave.com/register
2. Create a "Free AI" subscription
3. Create an API key for the subscription
4. Store the API key in the global fnox configuration. Omit the value so fnox prompts for it without exposing it in shell history or the process list:
   ```bash
   fnox set --global BRAVE_API_KEY
   ```
5. Install dependencies (run once):
   ```bash
   cd {baseDir}
   npm install
   ```

When using this skill, run searches through `fnox exec` so `BRAVE_API_KEY` is injected only into the search process. Do not print, log, or persist the resolved value:

```bash
fnox exec -- {baseDir}/search.js "query"
```

## Search

Prefer these commands first:

```bash
fnox exec -- {baseDir}/search.js "query"                         # Basic search (5 results)
fnox exec -- {baseDir}/search.js "query" -n 10                   # More results (max 20)
fnox exec -- {baseDir}/search.js "query" --content               # Include page content as markdown
fnox exec -- {baseDir}/search.js "query" --freshness pw          # Results from last week
fnox exec -- {baseDir}/search.js "query" --freshness 2024-01-01to2024-06-30  # Date range
fnox exec -- {baseDir}/search.js "query" --country DE            # Results from Germany
fnox exec -- {baseDir}/search.js "query" -n 3 --content          # Combined options
```

Direct invocation also works if `BRAVE_API_KEY` is already exported in the environment.

### Options

- `-n <num>` - Number of results (default: 5, max: 20)
- `--content` - Fetch and include page content as markdown
- `--country <code>` - Two-letter country code (default: US)
- `--freshness <period>` - Filter by time:
  - `pd` - Past day (24 hours)
  - `pw` - Past week
  - `pm` - Past month
  - `py` - Past year
  - `YYYY-MM-DDtoYYYY-MM-DD` - Custom date range

## Extract Page Content

```bash
{baseDir}/content.js https://example.com/article
```

`content.js` does not need `BRAVE_API_KEY`.

Fetches a URL and extracts readable content as markdown.

## Output Format

```
--- Result 1 ---
Title: Page Title
Link: https://example.com/page
Age: 2 days ago
Snippet: Description from search results
Content: (if --content flag used)
  Markdown content extracted from the page...

--- Result 2 ---
...
```

## When to Use

- Searching for documentation or API references
- Looking up facts or current information
- Fetching content from specific URLs
- Any task requiring web search without interactive browsing

