← 返回 Skills 市场
ypw757

bocha-skill

作者 ypw757 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
2378
总下载
1
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install bocha-skill
功能描述
Search the web using Bocha AI Search API (博查AI搜索) - a Chinese search engine optimized for Chinese content. Requires BOCHA_API_KEY. Supports web pages, images, and news with high-quality summaries.
使用说明 (SKILL.md)

Bocha Search Skill for OpenClaw

🔍 博查AI搜索 - 专为中文内容优化的智能搜索工具

Overview

This skill provides web search capabilities through the Bocha AI Search API (博查AI搜索). It's particularly effective for:

  • ✅ Chinese language searches (中文搜索)
  • ✅ Domestic Chinese content (国内内容)
  • ✅ News and current events (新闻资讯)
  • ✅ Encyclopedia and knowledge queries (百科知识)
  • ✅ High-quality AI-generated summaries (AI智能摘要)

Requirements

  • API Key: You need a Bocha API key from https://open.bocha.cn/
  • Node.js: Required to run the search script
  • Environment Variable: Set BOCHA_API_KEY or configure via OpenClaw settings

Configuration

Step 1: Get API Key

  1. Visit 博查AI开放平台
  2. Register an account (注册账号)
  3. Create an application and get your API KEY
  4. Recharge if needed (充值以获得搜索额度)

Step 2: Configure OpenClaw

Add to ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "bocha-search": {
        "enabled": true,
        "apiKey": "your-bocha-api-key-here",
        "env": {
          "BOCHA_API_KEY": "your-bocha-api-key-here"
        }
      }
    }
  }
}

Or set environment variable:

export BOCHA_API_KEY="your-bocha-api-key-here"

Usage

Once configured, you can use this skill by asking in Chinese or English:

"搜索北京今天的天气"
"用博查查找人工智能的最新进展"
"bocha search: 量子计算发展趋势"
"查找特朗普的最新新闻"

The skill will automatically route Chinese queries or explicit "bocha" / "博查" / "search" requests to this search provider.

Features

Feature Description
Chinese Optimized Better results for Chinese language queries
High-Quality Summaries AI-generated article summaries (when summary: true)
Multi-Modal Returns web pages, images, and related content
Time Filtering Filter results by time range (day/week/month/year)
Fast Response Typically returns results within 1-2 seconds
Rich Metadata Includes publish date, site name, favicon, etc.

API Parameters

When calling the underlying tool directly:

Parameter Type Required Default Description
query string ✅ Yes - Search query (supports Chinese and English)
count number No 10 Number of results (1-50)
freshness string No "noLimit" Time filter: "oneDay", "oneWeek", "oneMonth", "oneYear", "noLimit"
summary boolean No true Whether to include AI-generated summaries

Example Tool Call

// Search for recent AI news in Chinese
{
  "query": "人工智能最新进展",
  "count": 10,
  "freshness": "oneWeek",
  "summary": true
}

// Search for Trump news
{
  "query": "特朗普 Trump 最新新闻",
  "count": 5,
  "freshness": "oneDay"
}

Response Format

The API returns structured data including:

  • Web Pages: Title, URL, snippet, summary, site name, publish date
  • Images: Thumbnail URL, full image URL, dimensions
  • Total Matches: Estimated total number of matching results
  • Related Queries: Suggested related search terms

Sample Response Structure

{
  "_type": "SearchResponse",
  "queryContext": {
    "originalQuery": "search term"
  },
  "webPages": {
    "totalEstimatedMatches": 1908646,
    "value": [
      {
        "name": "Article Title",
        "url": "https://example.com/article",
        "snippet": "Short description...",
        "summary": "Full AI-generated summary...",
        "siteName": "Example Site",
        "datePublished": "2026-01-30T07:19:14+08:00"
      }
    ]
  },
  "images": {
    "value": [...]
  }
}

Error Handling

Common errors and solutions:

Error Cause Solution
BOCHA_API_KEY is required API key not configured Add API key to config or environment
Invalid API KEY Wrong API key Check your API key at https://open.bocha.cn/
Insufficient balance Out of credits Recharge your account
Rate limit exceeded Too many requests Wait before making more requests

Pricing

Technical Details

API Endpoint

  • URL: https://api.bocha.cn/v1/web-search
  • Method: POST
  • Auth: Bearer token in Authorization header

Script Location

skills/bocha-search/
├── SKILL.md              # This file
├── README.md             # Full documentation
├── LICENSE               # MIT License
└── scripts/
    ├── package.json      # Node.js config
    ├── tool.json         # OpenClaw tool definition
    └── bocha_search.js   # Main search script ⬅️ Entry point

Comparison with Other Search Tools

Feature Bocha Search Brave Search Perplexity
Chinese Content ⭐⭐⭐ Excellent ⭐⭐ Good ⭐⭐ Good
Speed ⭐⭐⭐ Fast ⭐⭐⭐ Fast ⭐⭐ Moderate
Summaries ⭐⭐⭐ AI-powered ❌ No ⭐⭐⭐ AI-powered
Images ⭐⭐⭐ Included ⭐⭐ Separate ⭐ Limited
Pricing 💰 Affordable 🆓 Free tier 💰 Moderate

Best Practices

  1. Use Chinese queries for better Chinese content results
  2. Enable summaries (summary: true) for better context
  3. Set appropriate freshness based on your needs:
    • Breaking news: "oneDay"
    • Recent developments: "oneWeek"
    • General research: "noLimit"
  4. Start with count=10, increase if needed (max 50)
  5. Handle rate limits gracefully in production use

Troubleshooting

No results returned

  • Try different keywords or synonyms
  • Remove time restrictions (freshness: "noLimit")
  • Check if your query is too specific

Slow response

  • Reduce count parameter
  • Disable summaries if not needed (summary: false)
  • Check network connectivity to api.bocha.cn

API errors

  • Verify API key is correct and active
  • Check account balance at https://open.bocha.cn/
  • Ensure you're not exceeding rate limits

Links

License

MIT License - See LICENSE file for details


Note: This skill is specifically designed for OpenClaw and uses the official Bocha AI Search API. It is not affiliated with or endorsed by Bocha AI.

安全使用建议
This skill appears to be a straightforward Bocha API search wrapper, but take these precautions before installing or running any included scripts: - Do not assume the API key shown in PUBLISH.md is safe to use; treat it as a leaked/example key. Replace it with your own key and verify the example key is invalid before trusting the repository. - Inspect publish.sh before running it: it will install a global npm package (clawdhub) and run clawdhub publish which performs network operations and may require you to supply a publish token. Only run it if you intend to publish and you trust the destination. - Verify the API endpoint you want to use. The code calls https://api.bocha.cn/v1/web-search while some docs reference other domains (api.bocha-ai.com, open.bocha.cn). Confirm with Bocha's official docs which endpoint is correct to avoid misrouting credentials. - Because the skill reads only BOCHA_API_KEY, avoid providing other credentials. Store the key in your environment or OpenClaw config and do not hardcode it into files that may be published. - If you plan to publish this skill publicly, remove/redact any example keys from documentation and rotate any real keys that may have been accidentally committed. If the repository owner can confirm the example key in PUBLISH.md is not valid and fix the inconsistent endpoint references, my confidence would rise and the skill would look benign.
功能分析
Type: OpenClaw Skill Name: bocha-skill Version: 1.0.0 The skill is designed to perform web searches using the Bocha AI Search API. The `scripts/bocha_search.js` file correctly retrieves the `BOCHA_API_KEY` from environment variables and makes a standard HTTPS POST request to `https://api.bocha.cn/v1/web-search`. There is no evidence of data exfiltration, malicious execution, persistence mechanisms, or prompt injection attempts against the AI agent in any of the analyzed files. The `publish.sh` script and markdown files (`SKILL.md`, `README.md`, `PUBLISH.md`, `QUICK_PUBLISH.md`) contain instructions for developers and users, which are aligned with publishing and using the skill, without any malicious intent.
能力评估
Purpose & Capability
Name, description, declared primaryEnv (BOCHA_API_KEY), required binary (node), tool.json, and the node script all align with a simple web-search skill that calls the Bocha API. The code only calls a Bocha endpoint and formats results.
Instruction Scope
Runtime instructions (SKILL.md) stay within the search skill scope: they ask for BOCHA_API_KEY, describe how to configure OpenClaw, and show usage examples. However, documentation files contain a number of minor inconsistencies (different Bocha domain strings appear in README vs script) and the PUBLISH.md file includes an apparent example API key in a test command, which is concerning because it encourages copying/sharing credentials.
Install Mechanism
This is instruction-only from the platform perspective (no platform install spec). The repo includes a small standalone Node.js script with no external dependencies. The publish.sh installs the 'clawdhub' CLI (npm -g) if missing and automates publishing — this is a convenience but will run package manager and network operations if executed, so users should inspect and consent before running it.
Credentials
Only BOCHA_API_KEY is required, which is proportionate. However, PUBLISH.md contains a concrete-looking API key string used in a test command. Including an example secret in repository/docs is a red flag: it could be a leftover real key, or encourage users to copy/paste a key into public forums. The skill otherwise does not request unrelated credentials.
Persistence & Privilege
The skill does not request always: true and does not modify other skills or system-wide config. SKILL.md shows how to add the API key to OpenClaw config, which is standard. publish.sh interacts with ClawdHub but only for publishing and requires user interaction.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bocha-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bocha-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
bocha-skill 1.0.0 - Initial release of bocha-search skill for OpenClaw. - Enables Chinese-optimized web, image, and news search using the Bocha AI Search API. - Supports high-quality AI-generated summaries, time filtering, and multi-modal results. - Requires BOCHA_API_KEY and Node.js; full setup and error handling instructions included. - Designed for superior Chinese-language and domestic content search.
元数据
Slug bocha-skill
版本 1.0.0
许可证
累计安装 4
当前安装数 4
历史版本数 1
常见问题

bocha-skill 是什么?

Search the web using Bocha AI Search API (博查AI搜索) - a Chinese search engine optimized for Chinese content. Requires BOCHA_API_KEY. Supports web pages, images, and news with high-quality summaries. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2378 次。

如何安装 bocha-skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bocha-skill」即可一键安装,无需额外配置。

bocha-skill 是免费的吗?

是的,bocha-skill 完全免费(开源免费),可自由下载、安装和使用。

bocha-skill 支持哪些平台?

bocha-skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 bocha-skill?

由 ypw757(@ypw757)开发并维护,当前版本 v1.0.0。

💬 留言讨论