home / skills / steipete / agent-scripts / brave-search

brave-search skill

/skills/brave-search

This skill helps you search the web and extract article content using Brave Search API for accurate, fast references.

npx playbooks add skill steipete/agent-scripts --skill brave-search

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
1.2 KB
---
name: brave-search
description: Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content. Lightweight, no browser required.
---

# Brave Search

Headless web search and content extraction using Brave Search. No browser required.

## Setup

Run once before first use:

```bash
cd ~/Projects/agent-scripts/skills/brave-search
npm ci
```

Needs env: `BRAVE_API_KEY`.

## Search

```bash
./search.js "query"                    # Basic search (5 results)
./search.js "query" -n 10              # More results
./search.js "query" --content          # Include page content as markdown
./search.js "query" -n 3 --content     # Combined
```

## Extract Page Content

```bash
./content.js https://example.com/article
```

Fetches a URL and extracts readable content as markdown.

## Output Format

```
--- Result 1 ---
Title: Page Title
Link: https://example.com/page
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

Overview

This skill provides headless web search and content extraction using the Brave Search API. It performs lightweight queries and can fetch readable page content as Markdown without launching a browser. Use it to integrate fast web lookups into agents or scripts that need documentation, facts, or page extracts.

How this skill works

The skill sends queries to the Brave Search API and returns a list of results with titles, links, and snippets. When requested, it fetches a target URL and extracts readable content, returning it as Markdown. It requires a BRAVE_API_KEY environment variable and runs as a small TypeScript/Node.js utility.

When to use it

  • Looking up documentation, API references, or developer guides quickly
  • Verifying facts or gathering recent web information for an agent
  • Extracting readable article content from a specific URL as Markdown
  • Adding web search capability to scripts without a full browser
  • Collecting multiple concise search results for downstream processing

Best practices

  • Set BRAVE_API_KEY in the environment before running any commands
  • Limit result counts for faster responses (default is 5; increase as needed)
  • Use the --content flag only when you need full page extracts to save time
  • Validate extracted Markdown for large pages before downstream use
  • Respect site robots and content licenses when storing or redistributing content

Example use cases

  • An agent that answers programming questions by searching docs and returning snippets
  • A script that compiles recent articles on a topic into Markdown for summarization
  • Quick fact-checking within a message handler without spinning up a browser
  • Batch extraction of content from a set of known URLs for offline analysis

FAQ

What do I need to run this skill?

Install dependencies with npm ci in the skill folder and set BRAVE_API_KEY in your environment.

Can it fetch full page content?

Yes. Use the --content flag or call the content extraction command with a URL to get readable Markdown.