重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
brave-search by ratacat/claude-skills
npx skills add https://github.com/ratacat/claude-skills --skill brave-search使用 Brave 注重隐私的搜索 API 搜索网页、图片和新闻。同时通过 OpenAI SDK 兼容性支持带有引用的 AI 基础答案。
需要 API 密钥。 请访问 https://api-dashboard.search.brave.com 获取。
export BRAVE_API_KEY="your-api-key"
免费套餐:每月 2,000 次查询。专业版套餐解锁本地 POI 搜索和 AI 基础功能。
广泛并发,快速响应。 此 API 支持高并发——高达每秒 50 个请求。无需保留:
并行执行搜索。 需要研究 10 个不同主题?同时发起 10 次搜索。在单条消息中使用多个 Bash 工具调用。
使用子代理处理大量结果。 当预期有大量上下文(许多结果、额外摘要、研究模式)时,派遣一个子代理来运行搜索并综合发现。这样可以保留您的主上下文窗口。
批量处理相关查询。 搜索竞争对手、替代方案或主题的多个方面?一次性全部运行。
digraph parallel_search { rankdir=LR; node [shape=box];
task [label="Research task"];
q1 [label="Query 1"];
q2 [label="Query 2"];
q3 [label="Query 3"];
subagent [label="Subagent\n(preserves context)"];
synthesize [label="Synthesized\nfindings"];
task -> q1;
task -> q2;
task -> q3;
q1 -> subagent [style=dashed];
q2 -> subagent [style=dashed];
q3 -> subagent [style=dashed];
subagent -> synthesize;
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
}
何时使用子代理:
何时直接搜索:
| 任务 | 命令 |
|---|---|
| 网页搜索 | brave-search web "query" |
| 图片搜索 | brave-search images "query" |
| 新闻搜索 | brave-search news "query" |
| AI 答案 | brave-search ai "question" |
| 建议 | brave-search suggest "partial query" |
| 检查密钥 | brave-search check-key |
| API | 端点 | 套餐 |
|---|---|---|
| 网页搜索 | /res/v1/web/search | 免费 |
| 图片搜索 | /res/v1/images/search | 免费 |
| 新闻搜索 | /res/v1/news/search | 免费 |
| 建议 | /res/v1/suggest/search | 免费 |
| AI 基础 | /res/v1/chat/completions | AI 基础 |
| 本地 POI | /res/v1/local/pois | 专业版 |
| 摘要器 | /res/v1/summarizer/search | 专业版 |
# 基本搜索
brave-search web "python async tutorial" --count 10
# 按新鲜度筛选 (pd=24h, pw=7d, pm=31d, py=365d)
brave-search web "latest news" --freshness pd
# 按国家和语言筛选
brave-search web "local restaurants" --country US --lang en
# 安全搜索 (off, moderate, strict)
brave-search web "query" --safesearch strict
# 获取额外摘要
brave-search web "query" --extra-snippets
# 筛选结果类型 (web, news, videos, images, discussions)
brave-search web "query" --filter web,news
# 基本图片搜索
brave-search images "mountain sunset"
# 带安全搜索
brave-search images "landscape" --safesearch strict --count 20
# 近期新闻
brave-search news "AI developments" --count 10
# 带新鲜度筛选的新闻
brave-search news "election results" --freshness pd
# 获取带引用的 AI 答案
brave-search ai "What is the tallest building in the world?"
# 启用深度研究(多次搜索,速度较慢)
brave-search ai "Compare React and Vue in 2024" --research
digraph brave_search {
rankdir=TB;
node [shape=box];
need [label="What do you need?" shape=diamond];
web [label="Web Search\nbrave.py web"];
images [label="Image Search\nbrave.py images"];
news [label="News Search\nbrave.py news"];
ai [label="AI Answer\nbrave.py ai"];
results [label="Parse JSON results"];
cite [label="Include citations\nfor AI answers"];
need -> web [label="web pages"];
need -> images [label="images"];
need -> news [label="recent news"];
need -> ai [label="cited answer"];
web -> results;
images -> results;
news -> results;
ai -> cite;
}
{
"web": {
"results": [
{
"title": "Page Title",
"url": "https://example.com",
"description": "Snippet from the page...",
"extra_snippets": ["Additional context..."]
}
]
},
"query": {
"original": "search query",
"altered": "modified query if spellchecked"
}
}
返回 OpenAI 兼容格式,并带有内联引用:
The tallest building is the Burj Khalifa[1] at 828 meters...
[1] https://source-url.com
| 选项 | 值 | 描述 |
|---|---|---|
--count | 1-20 (网页), 1-200 (图片) | 结果数量 |
--country | US, GB, DE, FR 等 | 搜索区域 |
--lang | en, de, fr, es 等 | 搜索语言 |
--safesearch | off, moderate, strict | 成人内容过滤器 |
--freshness | pd, pw, pm, py | 时间过滤器 |
--json | flag | 输出原始 JSON |
| 错误 | 原因 | 解决方法 |
|---|---|---|
| 401 未授权 | 无效/缺失 API 密钥 | 检查 BRAVE_API_KEY |
| 429 速率限制 | 请求过多 | 等待或升级套餐 |
| 422 验证错误 | 无效参数 | 检查参数值 |
X-RateLimit-Remaining| 错误 | 解决方法 |
|---|---|
| 未设置 API 密钥 | export BRAVE_API_KEY="..." |
| 套餐对应的端点错误 | 在仪表板检查订阅 |
| 结果过多 | 网页搜索最多 20 条,使用 offset 进行分页 |
| 无 AI 基础功能 | 需要 AI 基础订阅 |
每周安装量
65
代码仓库
GitHub 星标数
29
首次出现
2026年1月24日
安全审计
安装于
opencode51
openclaw50
gemini-cli50
codex49
cursor48
github-copilot47
Search the web, images, and news using Brave's privacy-focused Search API. Also supports AI Grounding for cited answers via OpenAI SDK compatibility.
API Key required. Get one at https://api-dashboard.search.brave.com
export BRAVE_API_KEY="your-api-key"
Free tier: 2,000 queries/month. Pro plans unlock Local POI search and AI Grounding.
Go wide, go fast. This API supports high concurrency—up to 50 requests/second. Don't hold back:
Fire searches in parallel. Need to research 10 different topics? Launch 10 searches simultaneously. Use multiple Bash tool calls in a single message.
Use subagents for heavy results. When expecting lots of context (many results, extra snippets, research mode), dispatch a subagent to run the search and synthesize findings. This preserves your main context window.
Batch related queries. Searching for competitors, alternatives, or multiple aspects of a topic? Run them all at once.
digraph parallel_search { rankdir=LR; node [shape=box];
task [label="Research task"];
q1 [label="Query 1"];
q2 [label="Query 2"];
q3 [label="Query 3"];
subagent [label="Subagent\n(preserves context)"];
synthesize [label="Synthesized\nfindings"];
task -> q1;
task -> q2;
task -> q3;
q1 -> subagent [style=dashed];
q2 -> subagent [style=dashed];
q3 -> subagent [style=dashed];
subagent -> synthesize;
}
When to use subagents:
When to search directly:
| Task | Command |
|---|---|
| Web search | brave-search web "query" |
| Image search | brave-search images "query" |
| News search | brave-search news "query" |
| AI answer | brave-search ai "question" |
| Suggestions | brave-search suggest "partial query" |
| Check key | brave-search check-key |
| API | Endpoint | Plan |
|---|---|---|
| Web Search | /res/v1/web/search | Free |
| Image Search | /res/v1/images/search | Free |
| News Search | /res/v1/news/search | Free |
| Suggest | /res/v1/suggest/search | Free |
| AI Grounding | /res/v1/chat/completions |
# Basic search
brave-search web "python async tutorial" --count 10
# Filter by freshness (pd=24h, pw=7d, pm=31d, py=365d)
brave-search web "latest news" --freshness pd
# Filter by country and language
brave-search web "local restaurants" --country US --lang en
# Safe search (off, moderate, strict)
brave-search web "query" --safesearch strict
# Get extra snippets
brave-search web "query" --extra-snippets
# Filter result types (web, news, videos, images, discussions)
brave-search web "query" --filter web,news
# Basic image search
brave-search images "mountain sunset"
# With safe search
brave-search images "landscape" --safesearch strict --count 20
# Recent news
brave-search news "AI developments" --count 10
# News with freshness filter
brave-search news "election results" --freshness pd
# Get an AI answer with citations
brave-search ai "What is the tallest building in the world?"
# Enable deep research (multiple searches, slower)
brave-search ai "Compare React and Vue in 2024" --research
digraph brave_search {
rankdir=TB;
node [shape=box];
need [label="What do you need?" shape=diamond];
web [label="Web Search\nbrave.py web"];
images [label="Image Search\nbrave.py images"];
news [label="News Search\nbrave.py news"];
ai [label="AI Answer\nbrave.py ai"];
results [label="Parse JSON results"];
cite [label="Include citations\nfor AI answers"];
need -> web [label="web pages"];
need -> images [label="images"];
need -> news [label="recent news"];
need -> ai [label="cited answer"];
web -> results;
images -> results;
news -> results;
ai -> cite;
}
{
"web": {
"results": [
{
"title": "Page Title",
"url": "https://example.com",
"description": "Snippet from the page...",
"extra_snippets": ["Additional context..."]
}
]
},
"query": {
"original": "search query",
"altered": "modified query if spellchecked"
}
}
Returns OpenAI-compatible format with inline citations:
The tallest building is the Burj Khalifa[1] at 828 meters...
[1] https://source-url.com
| Option | Values | Description |
|---|---|---|
--count | 1-20 (web), 1-200 (images) | Number of results |
--country | US, GB, DE, FR, etc. | Search region |
--lang | en, de, fr, es, etc. | Search language |
--safesearch | off, moderate, strict | Adult content filter |
--freshness | pd, pw, pm, py | Time filter |
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid/missing API key | Check BRAVE_API_KEY |
| 429 Rate Limited | Too many requests | Wait or upgrade plan |
| 422 Validation | Invalid parameters | Check parameter values |
X-RateLimit-Remaining| Mistake | Fix |
|---|---|
| API key not set | export BRAVE_API_KEY="..." |
| Wrong endpoint for plan | Check subscription at dashboard |
| Too many results | Web max is 20, use offset for pagination |
| No AI grounding | Requires AI Grounding subscription |
Weekly Installs
65
Repository
GitHub Stars
29
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode51
openclaw50
gemini-cli50
codex49
cursor48
github-copilot47
飞书视频会议CLI工具:lark-vc技能详解,高效搜索与管理会议记录与纪要
47,500 周安装
SOP创建器 - 将非结构化流程转化为清晰标准操作程序,五年级阅读水平撰写
203 周安装
n8n工作流生成器 - 自动化业务工作流,提升电子邮件、电子表格处理效率
202 周安装
竞争分析工具 Compete:竞争对手发现、SWOT分析与市场策略制定
45 周安装
Railway 域名管理教程 - 添加、查看、移除自定义域名和 Railway 域名
207 周安装
Payload CMS 开发指南:基于 Next.js 的 TypeScript 原生 CMS 配置与实战
208 周安装
Git提交工作流优化工具 - 遵循Conventional Commits规范,提升代码审查效率
208 周安装
| AI Grounding |
| Local POI | /res/v1/local/pois | Pro |
| Summarizer | /res/v1/summarizer/search | Pro |
--json | flag | Output raw JSON |