Install
openclaw skills install @helloworldtang/bocha博查 Web 搜索(Bocha Web Search)——中文优先、中国大陆直连的联网搜索。适用于中文查询、时效性信息、事实核查与带引用的回答。(Chinese-first web search with direct China mainland access. Use for Chinese-language queries, time-sensitive information, fact-checking, and citation-backed answers.)
openclaw skills install @helloworldtang/bocha通过博查(Bocha)Web Search API 联网搜索。与 Brave / Tavily / Exa 相比的取舍:
api.bocha.cn 无需代理,Western 搜索 API 在中国大陆环境下不可达时用本 skillPOST https://api.bocha.cn/v1/web-search
Authorization: Bearer $BOCHA_API_KEY
Content-Type: application/json
请求体:
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
query | string | 是 | — | 搜索词;保留"最近/今年/上个月"等时间表述,交给引擎改写 |
freshness | string | 否 | noLimit | oneDay / oneWeek / oneMonth / oneYear / noLimit |
summary | boolean | 否 | false | 返回博查 AI 生成的网页原文摘要(更耗 token,确需原文细节再开) |
count | integer | 否 | 10 | 结果数 1–50 |
freshness 选择:明确要"今天/最新"用 oneDay;"最近一周/这个月"用 oneWeek/oneMonth;拿不准就 noLimit 让引擎结合 query 里的时间词自行改写,不要既写 freshness 又在 query 里堆时间词。
结果在 data.webPages.value[],每条含:
name 标题 · url 链接 · snippet 摘要片段summary(仅当请求 summary: true)原文摘要siteName 站点名 · datePublished 发布日期HTTP 200 但 code != 200 时按错误处理,msg 与 log_id 可用于排查。
$BOCHA_API_KEY 只放进 Authorization 头,绝不写进 query、URL、日志或回答| 状态 | 含义 | 处置 |
|---|---|---|
| 401 | key 无效 | 停止重试,提示检查 BOCHA_API_KEY |
| 403 | 余额不足 | 提示到 open.bocha.cn 充值 |
| 429 | 限流 | 等待后重试一次,仍失败则告知用户 |
| 400 | 参数错误 | 检查 query/freshness 取值 |
排查时引用响应中的 log_id。
本 skill 是轻量直调版。若宿主是 OpenClaw,安装 code plugin 可把 bocha 注册为内置 web_search 工具的 provider(含结果缓存与不可信内容包裹):
openclaw plugins install @chaojihao/openclaw-plugin-bocha
openclaw config set tools.web.search.provider bocha
插件页:https://clawhub.ai/chaojihao/plugins/openclaw-plugin-bocha · 源码:https://github.com/helloworldtang/openclaw-plugin-bocha