Brave Search 极简国内版

Research
#网络搜索

【极简版省token】使用 Brave API 执行网络搜索。针对国内代理环境做优化。

Install

openclaw skills install @jhc888007/brave-search-vpn

Brave Search

使用 Brave API 在互联网上搜索最新信息。本工具会向 https://api.search.brave.com 发起网络请求。

配置环境变量与凭据

此脚本需要 Brave API 密钥和 VPN 环境才能运行。需要配置 BRAVE_SEARCH_API_KEYHTTP_PROXY_PORT

export BRAVE_SEARCH_API_KEY="your_api_key_here"
export HTTP_PROXY_PORT="your_vpn_port_here"

使用方法

python3 scripts/brave_search.py --q "你的搜索词" [--country CN] [--count 20]
参数名类型必填默认值描述
qstring-搜索关键词(最多50个词)
countrystringCN搜索国家代码,如 CN, US, ALL
search_langstringzh-hans语言偏好,如 zh-hans, en
countint20返回结果数量限制(1-20)
offsetint0分页偏移量(0-9)
safesearchstringmoderate内容过滤:off, moderate, strict
freshnessstring-时间过滤:pd(1天内), pw(1周内), pm(1个月内), py(1年内) , YYYY-MM-DDtoYYYY-MM-DD(一定范围)
text_decorationsbooltrue是否在结果中保留高亮标记
spellcheckbooltrue是否自动纠正拼写
result_filterstring-过滤结果类型,如 web,news,videos
gogglesstring-自定义排序规则(URL 或 内联规则)
extra_snippetsbool/stringfalse是否获取每个结果的额外文本摘要(最多5个)

License

MIT License - Feel free to use and modify.