← Back to Skills Marketplace
leohuang8688

Auto Search using Google Baidu

by ClawMem.com · GitHub ↗ · v1.5.0 · MIT-0
cross-platform ⚠ suspicious
225
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install google-baidu-search
Description
Auto-select the best search engine—Google for international or English queries and Baidu for Chinese queries—for unified web search results.
README (SKILL.md)

🔍 Google & Baidu Smart Search

智能双搜索引擎 - 自动选择最佳搜索引擎

Version 1.0.0 License: MIT Python 3.10+


🔐 Required Environment Variables

⚠️ This skill requires at least one search engine:

Variable Description Required
GOOGLE_API_KEY Google Custom Search API key ⚠️ Optional*
GOOGLE_CX Google Custom Search Engine ID ⚠️ Optional*
BAIDU_API_KEY Baidu Search API key ⚠️ Optional*

*At least one search engine must be configured. Recommended: configure both for best results.

Setup:

# Google (get from https://console.cloud.google.com/)
export GOOGLE_API_KEY="your_google_api_key"
export GOOGLE_CX="your_search_engine_id"

# Baidu (get from https://ai.baidu.com/)
export BAIDU_API_KEY="your_baidu_api_key"

# Or use .env file
cp .env.example .env
# Edit .env and add your API keys

✨ Features

  • 🤖 Smart Engine Selection - Auto-select best engine based on query
  • 🇨🇳 Chinese Queries → Use Baidu automatically
  • 🌐 English/International → Use Google automatically
  • 🔍 Dual Engine Support - Configure both Google and Baidu
  • 📊 Unified API - Simple, consistent interface
  • 🚀 Easy Integration - OpenClaw compatible

🚀 Quick Start

Installation

cd ~/.openclaw/workspace/skills/google-baidu-search

# Install dependencies
pip3 install -r requirements.txt

Configuration

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

# Edit .env and add your API keys
nano .env

Basic Usage

from src.search import search_web

# Auto-select engine (recommended)
result = search_web("人工智能 2026")  # Auto-selects Baidu
print(result)

result = search_web("AI trends 2026")  # Auto-selects Google
print(result)

# Manual engine selection
result = search_web("AI trends", engine='google', count=10)
result = search_web("人工智能", engine='baidu', count=10)
result = search_web("AI", engine='both', count=10)

CLI Usage

# Auto-select engine (recommended)
python3 src/search.py "人工智能 2026"           # Auto: Baidu
python3 src/search.py "AI trends 2026"          # Auto: Google

# Manual engine selection
python3 src/search.py "AI trends" google 10     # Force Google
python3 src/search.py "人工智能" baidu 10       # Force Baidu
python3 src/search.py "AI" both 10              # Search both

🤖 Smart Engine Selection

How It Works

The smart search engine automatically selects the best search engine based on:

  1. Language Detection

    • Chinese characters → Baidu
    • English/Other → Google
  2. Keyword Detection

    • China-related keywords (中国,北京,上海,etc.) → Baidu
    • International keywords → Google

Examples

Query Auto-Selected Engine Reason
"人工智能 2026" Baidu Contains Chinese characters
"AI trends 2026" Google English query
"北京美食" Baidu China-related keyword
"New York restaurants" Google International query
"中文搜索" Baidu Chinese keyword
"machine learning" Google English query

📖 API Usage

Python API

from src.search import SmartSearch, search_web

# Method 1: Simple search (auto-select)
result = search_web("人工智能 2026")
print(result)

# Method 2: Smart Search client
searcher = SmartSearch()

# Auto-select engine
results = searcher.search("人工智能 2026", engine='auto')

# Force specific engine
results = searcher.search("AI trends", engine='google')
results = searcher.search("人工智能", engine='baidu')

# Search both engines
results = searcher.search("AI", engine='both')

# Check available engines
engines = searcher.get_available_engines()
print(f"Available engines: {engines}")

# Process results
for result in results:
    print(f"Title: {result['title']}")
    print(f"URL: {result['url']}")
    print(f"Source: {result['source']}")
    print(f"Engine: {result['engine']}")
    print()

⚙️ Configuration

Get Google API Credentials

  1. Get API Key:

  2. Get Search Engine ID (CX):

Get Baidu API Key

  1. Visit https://ai.baidu.com/
  2. Create an account or login
  3. Go to Console → Applications
  4. Create a new application
  5. Get your API Key

📁 Project Structure

google-baidu-search/
├── src/
│   └── search.py           # Main search client with smart selection
├── .env.example            # Environment variables template
├── requirements.txt        # Python dependencies
├── SKILL.md                # This file
└── README.md               # Documentation

🎯 Use Cases

1. News Search

# Chinese news (auto-selects Baidu)
result = search_web("最新科技新闻 2026")

# Global news (auto-selects Google)
result = search_web("latest tech news 2026")

2. Research

# Chinese academic (auto-selects Baidu)
result = search_web("机器学习论文")

# International academic (auto-selects Google)
result = search_web("machine learning papers")

3. Product Search

# Chinese products (auto-selects Baidu)
result = search_web("智能手机评测")

# Global products (auto-selects Google)
result = search_web("smartphone reviews 2026")

4. Local Search

# China local (auto-selects Baidu)
result = search_web("北京美食推荐")

# International local (auto-selects Google)
result = search_web("best restaurants New York")

📝 Response Format

Search Result Structure

{
  "title": "Page Title",
  "url": "https://example.com/page",
  "snippet": "Page description snippet",
  "display_link": "example.com",
  "source": "Google" or "Baidu",
  "engine": "google" or "baidu"
}

Example Output

🔍 Search Results for: 人工智能 2026

Engine: Baidu (Auto-selected)
Available engines: google, baidu
Found 10 results:

1. **2026 年人工智能发展趋势** [Baidu]
   URL: https://example.com/ai-trends-2026
   人工智能领域在 2026 年将继续快速发展...

2. **AI 技术应用前景** [Baidu]
   URL: https://example.com/ai-applications
   AI 技术在各行业的应用前景广阔...

⚠️ Limitations

Google Custom Search

  • API Quotas: Free tier: 100 queries/day
  • Results Limit: Maximum 10 results per query
  • API Key Required: Must have valid Google API key
  • Search Engine Required: Must create Custom Search Engine

Baidu Search

  • 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

💰 Pricing

Google Custom Search

  • Free Tier: 100 queries/day
  • Paid Tier: $5 per 1000 queries
  • Suitable for development and production use

Baidu Search

  • Free Tier: Available with limits
  • Paid Tier: Contact Baidu for pricing
  • Suitable for development and production use

📞 Support


📄 License

MIT License - See LICENSE file for details.


Happy Searching! 🔍


Last Updated: 2026-03-19
Version: 1.0.0
Author: PocketAI for Leo
Contact: [email protected]

Usage Guidance
This skill's code matches its description (auto-select Google/Baidu) and uses only standard Python libraries and network calls to the search APIs, which is normal. Before installing: 1) Verify the package source (no homepage provided and owner is anonymous). 2) Inspect SKILL.md/README for hidden characters (the pre-scan detected unicode control chars) and remove any unexpected control characters. 3) Confirm you are comfortable providing GOOGLE_API_KEY + GOOGLE_CX and/or BAIDU_API_KEY; treat those as sensitive and store them in a secure place. 4) Run the code in an isolated environment (sandbox/container) first and review network calls (e.g., via proxy) to ensure endpoints are only Google/Baidu. 5) Ask the publisher to correct the registry metadata to list the required env vars; the omission reduces transparency. If any of the above checks fail (unknown remote endpoints, extra network destinations, hidden control characters, or inability to verify the publisher), do not install in a production environment.
Capability Analysis
Type: OpenClaw Skill Name: google-baidu-search Version: 1.5.0 The skill bundle provides a legitimate search integration for Google and Baidu with automatic engine selection based on query language. The code in src/search.py uses standard Python libraries (requests, python-dotenv) to communicate with official API endpoints (googleapis.com and baidubce.com) and contains no evidence of data exfiltration, malicious execution, or prompt injection. All behaviors are consistent with the stated purpose of the skill.
Capability Assessment
Purpose & Capability
The skill claims to auto-select Google or Baidu and the included Python code implements that behavior and calls the expected APIs. However the registry metadata declares no required environment variables while the SKILL.md and src/search.py clearly expect GOOGLE_API_KEY + GOOGLE_CX and/or BAIDU_API_KEY. That metadata mismatch is an incoherence that should be resolved before trusting the package.
Instruction Scope
SKILL.md instructs installing dependencies, copying a .env and supplying API keys, and running the provided Python CLI/API. The instructions and code only access local .env and environment variables, and make network requests to search endpoints (Google and Baidu). There are no instructions to read unrelated system files or exfiltrate arbitrary data. However SKILL.md contained a detected 'unicode-control-chars' injection signal (see scan findings) which could be an attempt to influence LLM behavior or be an artifact — inspect the file for hidden characters.
Install Mechanism
There is no binary-download install spec; it's an instruction-only skill with a Python file and a simple requirements.txt (requests, python-dotenv). Installing with pip from the included requirements is standard and low-risk compared to remote downloads or arbitrary extracted archives.
Credentials
Requesting GOOGLE_API_KEY, GOOGLE_CX and BAIDU_API_KEY is proportionate to the stated functionality (calling those search APIs). The code requires at least one engine's credentials. The problem is the registry metadata omitted declaring these required env vars — this mismatch reduces transparency and is a risk if users assume no secrets are needed.
Persistence & Privilege
The skill does not request elevated or persistent platform privileges (always is false). It does not modify other skills or global configs. It will read a local .env file if present; consider that a local secret surface but not a platform privilege escalation.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install google-baidu-search
  3. After installation, invoke the skill by name or use /google-baidu-search
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.5.0
- Added .env.example file to provide an environment variables template for easy setup. - Users can now quickly create a .env configuration by copying and editing the example file. - No changes to functionality or usage—just improved setup documentation.
v1.0.0
Google & Baidu Smart Search - v1.0.0 - Initial release with automatic smart selection between Google and Baidu search engines based on query language and keywords. - Supports both Chinese and international queries with unified API and CLI. - Allows manual engine selection or searching both engines at once. - Requires API keys for Google and/or Baidu; works if at least one is configured. - Easy integration with Python and OpenClaw frameworks.
Metadata
Slug google-baidu-search
Version 1.5.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Auto Search using Google Baidu?

Auto-select the best search engine—Google for international or English queries and Baidu for Chinese queries—for unified web search results. It is an AI Agent Skill for Claude Code / OpenClaw, with 225 downloads so far.

How do I install Auto Search using Google Baidu?

Run "/install google-baidu-search" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Auto Search using Google Baidu free?

Yes, Auto Search using Google Baidu is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Auto Search using Google Baidu support?

Auto Search using Google Baidu is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Auto Search using Google Baidu?

It is built and maintained by ClawMem.com (@leohuang8688); the current version is v1.5.0.

💬 Comments