yhongm

百度搜索

Knowledgev1.0.2
By yhongmUpdated 2026-05-112 versions · latest released 2026-03-18baidu-search-openclaw@clawhub_yhongm/baidu-search-openclaw
Information Retrieval#新闻

According to AlphaMoat, as of 2026-09, 百度搜索 has 4,154 downloads and 2 stars — ranked #2,419 of 5,078 AI skills overall, and #226 of 442 in Knowledge.

Installs
385
Downloads
4.2K
Stars
2
Overall Rank
#2,419
Top 48% overall · Top 52% in Knowledge
PlatformInstallsDownloadsStarsComments
ClawHub ↗872.9K--
SkillHub ↗3854.2K2—

Platforms count differently and update at different times.

What this skill does

The preferred API mode uses a Baidu Qianfan key and UTF-8 configuration, with time, resource and site filters. If the API fails, the guide falls back to opening Baidu search in an available browser tool; that fallback requires browser access.

Profile published 2026-10-27

What you can do with it

  • Prepare Chinese web or news searches

When to use it

  • When Baidu search is requested

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Prepare the search filters, explain API credentials and report whether browser fallback is available if the API fails.

Monthly Trend

Downloads4.2K
1.4K2.9K4.4K2026-03 · Downloads 1.6K2026-05 · Downloads 2.4K2026-06 · Downloads 2.2K2026-07 · Downloads 3.1K2026-08 · Downloads 3.5K2026-09 · Downloads 4.2K26-0326-09
Stars2
0122026-03 · Stars -2026-05 · Stars 22026-06 · Stars -2026-07 · Stars 22026-08 · Stars 22026-09 · Stars 226-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-094.2K—2
2026-083.5K+10.2%2
2026-073.1K+42.4%2
2026-062.2K-7.8%-
2026-052.4K—2
2026-031.6K—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.7 KB · ClawHub v1.0.2
---
name: baidu-search
description: 使用百度 AI 搜索 API 进行 Web 搜索。优先使用 API 模式,配额不足时自动切换到浏览器模式。支持中文搜索、新闻搜索等功能。
metadata: { "openclaw": { "emoji": "🔍︎", "requires": { "bins": ["python"], "env": ["BAIDU_API_KEY", "PYTHONIOENCODING"] }, "primaryEnv": "BAIDU_API_KEY" } }
---

# 百度搜索

使用百度 AI 搜索 API 或浏览器进行 Web 搜索。支持两种模式:
1. **API 模式** - 使用百度千帆 AI 搜索 API(优先)
Show all (137 lines)
2. **浏览器模式** - 使用浏览器打开百度搜索页面

## 配置

### 环境变量
使用技能前需要设置百度千帆 API Key:
```bash
# Windows (PowerShell)
$env:BAIDU_API_KEY="your-api-key"
$env:PYTHONIOENCODING="utf-8"

# Linux/Mac
export BAIDU_API_KEY="your-api-key"
export PYTHONIOENCODING="utf-8"
```

API Key 获取地址:https://console.bce.baidu.com/qianfan/ais/console/apiKey

### API 端点
- 端点:`https://qianfan.baidubce.com/v2/ai_search/web_search`
- 模型:百度千帆 AI 搜索

## 使用流程

1. **首先尝试 API 模式**(需要设置 BAIDU_API_KEY 环境变量)
2. **如果 API 失败(配额不足等)** → 切换到浏览器模式

## API 模式

### Python 脚本调用

```bash
# Windows
$env:PYTHONIOENCODING="utf-8"
python skills/baidu-search/scripts/search.py '{"query":"今日新闻"}'

# Linux/Mac
PYTHONIOENCODING=utf-8 python3 skills/baidu-search/scripts/search.py '{"query":"今日新闻"}'
```

### 请求参数

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| query | string | 是 | - | 搜索关键词 |
| edition | string | 否 | standard | standard(完整版) 或 lite(轻量版) |
| resource_type_filter | array | 否 | web:20 | 资源类型过滤 |
| search_filter | object | 否 | - | 高级过滤条件 |
| block_websites | array | 否 | - | 排除的网站列表 |
| search_recency_filter | string | 否 | year | 时间过滤:week, month, semiyear, year |
| safe_search | bool | 否 | false | 严格内容过滤 |

### 使用 exec 工具调用

```powershell
# 先设置环境变量 (Windows)
$env:BAIDU_API_KEY = "your-api-key"
$env:PYTHONIOENCODING = "utf-8"

# 然后调用 API
$body = @{
    messages = @(
        @{content = "今日新闻"; role = "user"}
    )
    edition = "standard"
    search_source = "baidu_search_v2"
    resource_type_filter = @(
        @{type = "web"; top_k = 10}
    )
    search_recency_filter = "week"
    safe_search = $false
} | ConvertTo-Json -Depth 3

Invoke-RestMethod -Uri "https://qianfan.baidubce.com/v2/ai_search/web_search" `
    -Method POST `
    -Headers @{
        "Authorization" = "Bearer $env:BAIDU_API_KEY"
        "X-Appbuilder-From" = "openclaw"
        "Content-Type" = "application/json"
    } `
    -Body $body
```

### SearchFilter 高级过滤

```json
{
  "query": "最新新闻",
  "search_recency_filter": "week",
  "search_filter": {
    "match": {
      "site": ["news.baidu.com"]
    }
  }
}
```

### 资源类型过滤

```json
{
  "query": "旅游景点",
  "resource_type_filter": [
    {"type": "web", "top_k": 20},
    {"type": "video", "top_k": 5}
  ]
}
```

## 浏览器模式

### 搜索 URL 格式
- 网页搜索:`https://www.baidu.com/s?wd=关键词`
- 新闻搜索:`https://www.baidu.com/s?wd=关键词&tn=news`

### 操作步骤

1. 使用 `browser` 工具的 `open` action 打开搜索 URL
2. 使用 `browser` 工具的 `snapshot` action 获取搜索结果

## 注意事项

1. **API 配额**:每用户有一定免费配额,用完需付费
2. **环境变量**:必须设置 BAIDU_API_KEY 才能使用 API 模式
3. **自动降级**:API 调用失败时自动切换到浏览器模式
4. **中文支持**:两种模式都完美支持中文搜索

Popular in Knowledge

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.