← 返回 Skills 市场
leohuang8688

Baidu Web Search

作者 ClawMem.com · GitHub ↗ · v2.1.2 · MIT-0
cross-platform ⚠ suspicious
220
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install bidu-search
功能描述
Perform web searches using Baidu API with a focus on Chinese content, customizable result counts, and easy OpenClaw integration.
使用说明 (SKILL.md)

🔍 Baidu Web Search Skill

百度网页搜索技能 - 使用百度搜索 API 进行网络搜索


📋 Overview

Property Value
Name baidu-web-search
Version 1.0.0
Author PocketAI for Leo
License MIT
Category Search
Required Env Vars BAIDU_API_KEY

🔐 Required Environment Variables

This skill requires the following environment variables:

Variable Description Required How to Get
BAIDU_API_KEY Baidu Search API key ✅ Yes https://ai.baidu.com/

Configuration:

export BAIDU_API_KEY="your_baidu_api_key"

✨ Features

  • 🔍 Baidu Web Search - 使用百度搜索 API 进行网络搜索
  • 🇨🇳 Chinese Focus - 专注于中文搜索结果
  • 📊 Customizable Results - 可定制返回结果数量
  • 🚀 Easy Integration - 易于集成到 OpenClaw

✨ Features

  • 🔍 Baidu Web Search - 使用百度搜索 API 进行网络搜索
  • 🇨🇳 Chinese Focus - 专注于中文搜索结果
  • 📊 Customizable Results - 可定制返回结果数量
  • 🚀 Easy Integration - 易于集成到 OpenClaw

🚀 Quick Start

Installation

cd ~/.openclaw/workspace/skills
# Already installed at: baidu-web-search/

Configuration

Option 1: Using .env file (Recommended)

# Copy the example .env file
cp .env.example .env

# Edit .env and add your API key
nano .env  # or use your favorite editor

Option 2: Using environment variable

export BAIDU_API_KEY="your_baidu_api_key"

Basic Usage

from src.baidu_search import baidu_search

# Search with default 10 results
result = baidu_search("人工智能 2026")
print(result)

# Search with custom result count
result = baidu_search("新能源汽车", count=5)
print(result)

CLI Usage

# Search with default 10 results
python3 src/baidu_search.py "人工智能 2026"

# Search with custom result count
python3 src/baidu_search.py "新能源汽车" 5

📖 API Usage

Python API

from src.baidu_search import BaiduSearch, baidu_search

# Method 1: Simple search
result = baidu_search("OpenClaw AI", count=10)
print(result)

# Method 2: Using client
searcher = BaiduSearch(api_key="your_api_key")
results = searcher.search("OpenClaw", count=5)

for result in results:
    print(f"Title: {result['title']}")
    print(f"URL: {result['url']}")
    print(f"Snippet: {result['abstract']}\
")

⚙️ Configuration

Environment Variables

Variable Description Required
BAIDU_API_KEY Baidu Search API key ✅ Yes

Getting Baidu API Key

  1. Visit Baidu AI Open Platform
  2. Create an account or login
  3. Go to Console → Applications
  4. Create a new application
  5. Get your API Key

📁 Project Structure

baidu-web-search/
├── src/
│   └── baidu_search.py     # Main search client
├── SKILL.md                 # This file
└── README.md                # Documentation

🎯 Use Cases

1. News Search

result = baidu_search("最新科技新闻 2026")

2. Research

result = baidu_search("人工智能 医疗 应用")

3. Product Search

result = baidu_search("智能手机 评测")

4. Local Search

result = baidu_search("北京 美食 推荐")

📝 Response Format

Search Result Structure

{
  "title": "网页标题",
  "url": "网页链接",
  "abstract": "摘要内容"
}

Example Output

🔍 Baidu Search Results for: 人工智能 2026

Found 10 results:

1. **2026 年人工智能发展趋势**
   URL: https://example.com/ai-trends-2026
   2026 年人工智能领域将呈现以下发展趋势...

2. **人工智能应用场景**
   URL: https://example.com/ai-applications
   人工智能在医疗、金融等领域的应用...

⚠️ Limitations

  • API Rate Limits: Baidu API has rate limits
  • API Key Required: Must have valid Baidu API key
  • Chinese Focus: Best for Chinese language queries
  • Regional Restrictions: May have regional restrictions

📞 Support


📄 License

MIT License - See LICENSE file for details.


Happy Searching! 🔍


Last Updated: 2026-03-17
Version: 1.0.0
Author: PocketAI for Leo

安全使用建议
This skill appears to be a straightforward Baidu search client, but there are two issues you should address before installing: (1) the registry metadata incorrectly omits the required BAIDU_API_KEY — ask the author to declare this credential in the metadata so you know what will be requested; (2) the code auto-loads a .env file from the workspace root, which could cause the skill to read other secrets if a .env exists there. If you proceed, run it in an isolated environment, ensure your workspace .env contains only the Baidu API key (or avoid a shared .env entirely by exporting BAIDU_API_KEY explicitly), and review the code yourself. If you cannot verify the author or update the metadata, treat the package as untrusted and test in a sandboxed container. If you want higher assurance, request the author to remove workspace-wide dotenv loading or to explicitly document and minimize what the .env must contain.
功能分析
Type: OpenClaw Skill Name: bidu-search Version: 2.1.2 The skill provides a straightforward implementation of a Baidu Web Search tool using the official Baidu AI Cloud API. The code in `src/baidu_search.py` correctly handles API authentication via environment variables and performs standard HTTP GET requests to retrieve search results without any signs of data exfiltration, obfuscation, or malicious intent.
能力评估
Purpose & Capability
Name/description match the code: the Python client calls a Baidu Search API and returns results. However, the registry metadata declares no required environment variables or primary credential while SKILL.md and the code both require BAIDU_API_KEY. That mismatch is incoherent: a search skill should declare the API key as a required credential in the metadata.
Instruction Scope
Runtime instructions and code are narrowly scoped to making HTTP requests to a Baidu API and formatting results. The code loads an .env file from the repository/workspace root (Path(__file__).parent.parent / '.env'), which means it can pick up any other secrets stored in that workspace .env unexpectedly. The HTTP outbound traffic appears only to the Baidu API host in the code (no other hidden endpoints).
Install Mechanism
No automated install script is present (instruction-only install). A requirements.txt lists only requests and python-dotenv — standard and proportionate. There are no downloads from arbitrary URLs or extract steps.
Credentials
Functionally the skill only needs a single API key (BAIDU_API_KEY), which is proportionate. But the registry metadata incorrectly lists no required env vars/primary credential, while SKILL.md and code require BAIDU_API_KEY. Additionally, auto-loading a workspace .env risks picking up unrelated secrets present in the environment, which increases the blast radius.
Persistence & Privilege
The skill does not request always:true and does not modify other skills or global agent settings. It runs on demand and has no elevated persistence privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bidu-search
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bidu-search 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.1.2
- Documentation update only: The README.md file was updated. - No changes were made to code or functionality.
v2.1.0
Version 2.1.0 - Added support for loading the Baidu API key from a .env file in addition to environment variables. - Updated installation and configuration instructions in SKILL.md to recommend using a .env file. - requirements.txt and source code updated to support the new configuration method.
v0.1.0
- Clarified required environment variables in the Overview and added a dedicated "Required Environment Variables" section. - Improved documentation on how to obtain and set the `BAIDU_API_KEY`. - Added environment variable details to the property table in the Overview. - Minor formatting and organizational updates for better readability.
v1.0.0
Initial release of Baidu Web Search Skill: - Provides Baidu web search API integration with Chinese-language result focus. - Supports customizable result counts and easy integration with OpenClaw. - Offers simple Python and CLI usage for flexible search. - Requires a Baidu API key via environment variable configuration. - Includes example code, result format documentation, and use cases.
元数据
Slug bidu-search
版本 2.1.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Baidu Web Search 是什么?

Perform web searches using Baidu API with a focus on Chinese content, customizable result counts, and easy OpenClaw integration. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 220 次。

如何安装 Baidu Web Search?

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

Baidu Web Search 是免费的吗?

是的,Baidu Web Search 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Baidu Web Search 支持哪些平台?

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

谁开发了 Baidu Web Search?

由 ClawMem.com(@leohuang8688)开发并维护,当前版本 v2.1.2。

💬 留言讨论