🔍 百度搜索
id: investment-advisor-zhang/openclaw-cn
by acceleratel · published 2026-04-01
$ claw add gh:acceleratel/acceleratel-investment-advisor-zhang-openclaw-cn---
id: investment-advisor-zhang/openclaw-cn
owner_id: investment-advisor-zhang
name: 百度搜索
description: 通过百度 AI 搜索 API 进行网页搜索,获取实时信息和搜索结果。
version: 1.0.1
icon: "\U0001F50D"
author: 财富顾问
metadata:
clawdbot:
emoji: "\U0001F50D"
requires:
bins:
- uv
env:
- BAIDU_API_KEY
primaryEnv: BAIDU_API_KEY
install:
- id: brew
kind: brew
formula: uv
bins:
- uv
label: Install uv via Homebrew
---
# 🔍 百度搜索
*Search the web with Baidu AI*
通过百度 AI 搜索 API 进行网页搜索,获取中文互联网的实时信息。
Setup
cd {baseDir}
echo "BAIDU_API_KEY=your-api-key" > .env
uv venv && uv pip install -e ".[dev]"
uv run --env-file .env uvicorn baidu_search.main:app --host 127.0.0.1 --port 8001需要在 `.env` 或环境变量中设置 `BAIDU_API_KEY`。
获取 API Key
1. 访问 [百度智能云控制台](https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application)
2. 创建应用获取 API Key
Quick Start
1. **检查服务:** `curl http://127.0.0.1:8001/ping`
2. **搜索网页:**
curl -X POST http://127.0.0.1:8001/search \
-H "Content-Type: application/json" \
-d '{
"query": "北京有哪些旅游景区",
"top_k": 10
}'3. **带时间过滤的搜索:**
curl -X POST http://127.0.0.1:8001/search \
-H "Content-Type: application/json" \
-d '{
"query": "最新科技新闻",
"top_k": 5,
"recency_filter": "week"
}'4. **限定网站搜索:**
curl -X POST http://127.0.0.1:8001/search \
-H "Content-Type: application/json" \
-d '{
"query": "天气预报",
"top_k": 5,
"site_filter": ["www.weather.com.cn"]
}'API 参数
| 参数 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| `query` | string | 必填 | 搜索关键词 |
| `top_k` | int | 10 | 返回结果数量 (1-20) |
| `recency_filter` | string | null | 时间过滤: `day`, `week`, `month`, `year` |
| `site_filter` | list | null | 限定搜索的网站列表 |
Response Format
{
"results": [
{
"title": "北京十大必去景点",
"url": "https://example.com/beijing-attractions",
"snippet": "北京作为中国的首都,拥有众多著名景点...",
"site_name": "旅游网"
}
],
"total": 10
}Conversation Flow
1. 用户提问需要搜索的内容
2. 判断是否需要时间过滤(如"最新"、"今天"等)
3. 调用搜索 API 获取结果
4. 整理并展示相关信息
5. 可根据需要深入查看某个结果
使用场景
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...