← 返回
未分类 Key 中文

Baidu Web Search

Perform web searches using Baidu API with a focus on Chinese content, customizable result counts, and easy OpenClaw integration.
使用百度API执行网络搜索,专注中文内容,支持自定义结果数量,轻松集成OpenClaw。
leohuang8688 leohuang8688 来源
未分类 clawhub v2.1.2 1 版本 100000 Key: 需要
★ 0
Stars
📥 539
下载
💾 0
安装
1
版本
#latest

概述

🔍 Baidu Web Search Skill

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


📋 Overview

PropertyValue
-----------------
Namebaidu-web-search
Version1.0.0
AuthorPocketAI for Leo
LicenseMIT
CategorySearch
Required Env VarsBAIDU_API_KEY

🔐 Required Environment Variables

This skill requires the following environment variables:

VariableDescriptionRequiredHow to Get
---------------------------------------------
BAIDU_API_KEYBaidu Search API key✅ Yeshttps://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']}\n")

⚙️ Configuration

Environment Variables

VariableDescriptionRequired
---------------------------------
BAIDU_API_KEYBaidu 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

  • Baidu AI Docs: https://ai.baidu.com/docs
  • API Reference: https://ai.baidu.com/ai-doc/SEARCH

📄 License

MIT License - See LICENSE file for details.


Happy Searching! 🔍


Last Updated: 2026-03-17

Version: 1.0.0

Author: PocketAI for Leo

版本历史

共 1 个版本

  • v2.1.2 当前
    2026-05-02 06:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

knowledge-management

Baidu web search

ide-rea
使用百度AI搜索引擎(BDSE)进行网络搜索。适用于获取实时信息、文档资料或研究课题。
★ 242 📥 106,542
ai-agent

Self Improving Agent

leohuang8688
OpenClaw自改进代理系统,支持从交互、错误及恢复中持续学习,自动优化性能。
★ 0 📥 910
knowledge-management

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 438 📥 104,265