Official Baidu Search

v1.0.0

通过百度 AI 搜索 API 进行网页搜索,获取实时信息和搜索结果。

0· 153·6 current·6 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (Baidu AI web search) match the code and runtime requirements. The package implements a FastAPI service that posts to Baidu's qianfan.baidubce.com search endpoint and returns parsed results. BAIDU_API_KEY is the only credential requested and is appropriate for this purpose.
Instruction Scope
SKILL.md instructs running a local FastAPI service, setting BAIDU_API_KEY, and using the uv tool to create a venv and run the server. The code logs queries and calls only the Baidu API URL; it does not reference or exfiltrate unrelated files or credentials. It does reference an optional OPENAPI_SERVER_URL env var (used only for OpenAPI servers list) which is not declared as required — that's a minor omission but not harmful.
Install Mechanism
Install uses a Homebrew formula 'uv' which matches the SKILL.md usage of the uv CLI. Homebrew is a standard install path; the formula name 'uv' is uncommon but is consistent with the provided runtime commands. No downloads from untrusted URLs or archive extraction are present; Python dependencies are standard (fastapi, httpx, uvicorn).
Credentials
Only BAIDU_API_KEY is required and declared as the primary credential. No unrelated secrets or multiple external credentials are requested. The code reads BAIDU_API_KEY (and optionally OPENAPI_SERVER_URL) only.
Persistence & Privilege
The skill does not request 'always: true' or other elevated, persistent privileges. It is user-invocable and can be invoked autonomously by the agent (platform default), which is expected for a callable integration.
Assessment
This skill appears to implement a straightforward Baidu AI search proxy. Before installing: (1) ensure you trust the source and the Homebrew 'uv' formula you will install; (2) keep your BAIDU_API_KEY secret — the running service uses it to call Baidu and will include it in Authorization headers; (3) the local server logs queries (check logger config if you worry about logging sensitive queries); (4) OPENAPI_SERVER_URL is optional and not declared as required; you can leave it unset. If you want extra caution, run the service in an isolated environment (container or dedicated VM) and review network traffic to confirm requests only go to Baidu endpoints.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🔍 Clawdis
Binsuv
EnvBAIDU_API_KEY
Primary envBAIDU_API_KEY

Install

Install uv via Homebrew
Bins: uv
brew install uv
latestvk974na380scmt7dx6hkhfp5s4s835crn
153downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

🔍 百度搜索

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. 访问 百度智能云控制台
  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
  }'
  1. 带时间过滤的搜索:
curl -X POST http://127.0.0.1:8001/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "最新科技新闻",
    "top_k": 5,
    "recency_filter": "week"
  }'
  1. 限定网站搜索:
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 参数

参数类型默认值说明
querystring必填搜索关键词
top_kint10返回结果数量 (1-20)
recency_filterstringnull时间过滤: day, week, month, year
site_filterlistnull限定搜索的网站列表

Response Format

{
  "results": [
    {
      "title": "北京十大必去景点",
      "url": "https://example.com/beijing-attractions",
      "snippet": "北京作为中国的首都,拥有众多著名景点...",
      "site_name": "旅游网"
    }
  ],
  "total": 10
}

Conversation Flow

  1. 用户提问需要搜索的内容
  2. 判断是否需要时间过滤(如"最新"、"今天"等)
  3. 调用搜索 API 获取结果
  4. 整理并展示相关信息
  5. 可根据需要深入查看某个结果

使用场景

  • 查询实时信息(新闻、天气、股票等)
  • 搜索中文互联网内容
  • 获取特定网站的信息
  • 时效性要求高的查询

Comments

Loading comments...