当前位置: 首页 > Skill >

bocha-skill

bocha-skill

1.0.0 2026.11.23 浏览:118
获取Skill文件查看使用说明
作者:许川许可证:
本文目录展开

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

  • Visit https://open.bocha.cn/pricing for current pricing
  • New users typically get free credits to start
  • Pay-as-you-go based on search volume

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

  • 🔗 博查AI开放平台
  • 🔗 API Documentation
  • 🔗 OpenClaw Docs
  • 🔗 ClawdHub

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.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • Bocha Search Skill for OpenClaw
    • Overview
    • Requirements
    • Configuration
      • Step 1: Get API Key
      • Step 2: Configure OpenClaw
    • Usage
    • Features
    • API Parameters
      • Example Tool Call
    • Response Format
      • Sample Response Structure
    • Error Handling
    • Pricing
    • Technical Details
      • API Endpoint
      • Script Location
    • Comparison with Other Search Tools
    • Best Practices
    • Troubleshooting
      • No results returned
      • Slow response
      • API errors
    • Links
    • License
  • 项目或源文件

相关 Skill

更多
SearXNG Search engine For OpenClaw by Upsurge.ae SearXNG Search engine For OpenClaw by Upsurge.ae 智能体专用私密情报雷达。解决Brave/Google API的高成本与隐私泄露问题,实现本地数据聚合与零泄露绝对数据主权。
Indexnow Pro Indexnow Pro Instant search engine notification via IndexNow protocol. Ping Bing, Yandex, and IndexNow API to index new or updated pages within minutes instead of days. S...
Chinese Search Chinese Search 中文搜索增强,整合必应中国、搜狗微信等中文搜索引擎(MVP v1.0)
Web Search via SearXNG Web Search via SearXNG Search the web using SearXNG meta-search engine. Use when the user wants to search the web, find current information, look up facts, news, or any query that...
Search Engine Search Engine 设计并构建任意搜索引擎,具备强大的索引、检索逻辑、相关性控制及评估工作流,适用于生产系统。