Skip to content

About

Bocha Web Search provider plugin for OpenClaw — Chinese-first web search with direct China mainland access

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@chaojihao/openclaw-plugin-bocha

English | 简体中文

CI

Bocha Web Search provider plugin for OpenClaw. Adds bocha as a selectable provider for the built-in web_search tool.

Not using OpenClaw? A standalone ClawHub skill (clawhub.ai/helloworldtang/skills/bocha) teaches any agent to call the Bocha API directly with the same conventions.

Why

  • Chinese-first search quality — Bocha's index is strong on Chinese-language content, which matters for queries Brave/Tavily/Exa handle poorly.
  • Direct mainland-China access — api.bocha.cn needs no proxy, unlike most Western search APIs.
  • Cheap — metered per successful search (see pricing).

Install

openclaw plugins install @chaojihao/openclaw-plugin-bocha

Then set your API key (get one at https://open.bocha.cn, free tier available):

openclaw config set plugins.entries.bocha.enabled true
# Option A (recommended, persistent): store the key in OpenClaw config
openclaw config set plugins.entries.bocha.config.webSearch.apiKey sk-...
# or interactively: openclaw configure --section web
# Option B: environment variable — must reach the Gateway process itself
# (on macOS a shell export or `launchctl setenv` does not survive a reboot,
#  hence Option A; the config entry also takes priority over the env var)
BOCHA_API_KEY=sk-...

Select the provider:

openclaw config set tools.web.search.provider bocha

Don't forget: tools.web.search.enabled is off by default — without it the web_search tool never shows up:

openclaw config set tools.web.search.enabled true

Tool parameters

Exposed through the standard web_search tool:

Parameter Type Default Description
query string required Search query; natural language supported
count integer 10 Results to return (1–50)
freshness string noLimit oneDay / oneWeek / oneMonth / oneYear / noLimit
summary boolean false Include Bocha's AI-generated page summaries

Configuration

Path (in openclaw.json) Env var Purpose
plugins.entries.bocha.config.webSearch.apiKey BOCHA_API_KEY Bocha API key
plugins.entries.bocha.config.webSearch.baseUrl BOCHA_BASE_URL API base override (proxies)
tools.web.search.timeoutSeconds — Request timeout (default 30s)
tools.web.search.cacheTtlMinutes — Result cache TTL (default 10min)

Untrusted content: every title/snippet/summary is wrapped in per-request boundary markers before it reaches the agent, mirroring OpenClaw's bundled search providers.

Compatibility

  • OpenClaw >= 2026.9.6 (developed and tested against 2026.9.6; plugin APIs are experimental — pin and test your host version).
  • Node 24.16+ / 26.1+.

Development

pnpm install
pnpm test        # vitest, no network needed
pnpm lint && pnpm typecheck
pnpm build       # emits dist/ (required for installation)

License

MIT. Not affiliated with Bocha AI or the OpenClaw Foundation.

About

Bocha Web Search provider plugin for OpenClaw — Chinese-first web search with direct China mainland access

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages