← 返回 Skills 市场
lsall357357

baidu-search

作者 lsall357357 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
312
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install baidu-qianfan-search
功能描述
Comprehensive search API integration for Baidu Qianfan Web Search. Use when Claude needs to perform web searches using Baidu Qianfan's enterprise search API....
使用说明 (SKILL.md)

百度千帆搜索技能 (Baidu Qianfan Search)

重要提示:这是百度千帆搜索API,不是普通的百度网页搜索。 百度千帆搜索是百度智能云千帆平台的企业级搜索API,需要单独申请API Key。

前置要求

1. API Key配置(首次使用前必须配置)

首次使用前必须配置你的百度千帆API Key,方式如下:

方式1:环境变量(推荐)

export BAIDU_QIANFAN_API_KEY="你的百度千帆API Key"

方式2:配置文件

在技能目录创建 .env 文件:

BAIDU_QIANFAN_API_KEY=你的百度千帆API Key

2. 如何获取API Key

  1. 访问 https://cloud.baidu.com/
  2. 登录后进入千帆平台
  3. 创建应用并获取AppBuilder API Key(格式:bce-v3/ALTAK-xxxxx

快速开始

基础搜索

node {baseDir}/scripts/search.mjs "搜索关键词"

指定结果数量

node {baseDir}/scripts/search.mjs "搜索关键词" -n 10

时间范围搜索

# 最近7天
node {baseDir}/scripts/search.mjs "搜索关键词" --time week

# 最近30天
node {baseDir}/scripts/search.mjs "搜索关键词" --time month

# 过去48小时
node {baseDir}/scripts/search.mjs "搜索关键词" --from "now-2d/d" --to "now/d"

完整参数说明

核心参数

参数 简写 说明 默认值
query 无(位置参数) 搜索关键词,建议36个汉字以内 必填
--count -n 返回结果数量 网页默认20,最大50
--edition 搜索版本:standard(完整)或 lite(轻量) standard

时间过滤参数

参数 说明
--time 快速时效过滤:week/month/semiyear/year
--from 起始时间:固定日期YYYY-MM-DD或相对时间(见下方)
--to 结束时间:格式同上

相对时间表达式

  • now/d - 当天
  • now-1w/d - 最近一周
  • now-2d/d - 最近两天
  • now-1M/d - 最近一个月
  • now-3M/d - 最近三个月
  • now-6M/d - 最近六个月
  • now-1y/d - 最近一年

站点过滤参数

参数 说明
--site 指定搜索站点(可重复使用)
--block 屏蔽搜索站点(可重复使用)

资源类型参数

参数 说明
--types 资源类型:web/image/video/aladdin,逗号分隔\x3Cbr>可带数量:web:10,image:5

其他参数

参数 说明
--safe 开启安全搜索
--config query干预配置ID(高级)
--raw 输出原始JSON响应

使用示例

1. 基础网页搜索

node {baseDir}/scripts/search.mjs "北京有哪些旅游景区"

2. 限定站点搜索

node {baseDir}/scripts/search.mjs "北京天气" --site "www.weather.com.cn"
# 多个站点
node {baseDir}/scripts/search.mjs "北京天气" --site "site1.com" --site "site2.com"

3. 时间范围搜索

# 最近7天
node {baseDir}/scripts/search.mjs "人工智能最新进展" --time week

# 固定日期范围
node {baseDir}/scripts/search.mjs "历史事件" --from "2025-01-01" --to "2025-12-31"

4. 多资源类型搜索

# 网页+图片+视频
node {baseDir}/scripts/search.mjs "北京故宫" --types web,image,video

# 仅图片
node {baseDir}/scripts/search.mjs "北京故宫" --types image

# 自定义各类型数量
node {baseDir}/scripts/search.mjs "北京故宫" --types web:10,image:5,video:3

5. 屏蔽特定站点

node {baseDir}/scripts/search.mjs "Python教程" --block "csdn.net" --block "jianshu.com"

6. 安全搜索

node {baseDir}/scripts/search.mjs "敏感内容" --safe

输出格式

默认输出格式:

#1 网页标题
站点: 站点名称
链接: https://example.com
时间: 2025-01-01 12:00:00
摘要: 搜索摘要...
---

使用 --raw 参数输出完整JSON响应。

技能结构

核心文件

  • scripts/search.mjs - 主搜索脚本,处理所有参数和API调用
  • references/api-reference.md - 完整的API参数说明和参考文档

依赖文件

  • package.json - Node.js依赖配置
  • .env - API Key配置文件(用户创建)
  • .gitignore - 忽略敏感文件和依赖

故障排除

Q: 提示401认证失败?

A: 检查API Key是否正确,确认账号已开通百度千帆搜索API服务。

Q: 提示429请求超限?

A: 降低请求频率,或联系百度智能云升级配额。

Q: 提示400参数错误?

A: 检查参数格式,特别是时间格式和站点URL格式。

Q: 没有搜索结果?

A: 检查关键词是否过长(超过72字符),或尝试放宽时间/站点过滤条件。

详细API文档

完整API参数说明、错误码和高级用法请参阅 references/api-reference.md

注意事项

  1. 无硬编码API Key - 技能不包含任何硬编码的API Key,用户必须配置自己的Key
  2. 区分明确 - 这是百度千帆搜索API,不是普通百度搜索
  3. 参数完整 - 支持百度千帆搜索API的所有参数
  4. 社区规范 - 符合OpenClaw技能社区规范,可被其他agent直接使用
安全使用建议
This skill's code and docs implement the Baidu Qianfan search API and only need one secret: BAIDU_QIANFAN_API_KEY. However the registry metadata omitted that required env var — an oversight that should be corrected before trusting the skill. Before installing: (1) confirm the skill's source and owner (no homepage provided); (2) require the maintainer to add BAIDU_QIANFAN_API_KEY to the skill's declared required env/primary credential in the registry; (3) verify the endpoint (qianfan.baidubce.com) is legitimate for your account; (4) store the API key in your platform's secrets manager rather than a plain .env when possible and avoid committing .env to version control; (5) run npm install in an isolated environment and review package.json before executing; and (6) consider rotating the API key after testing. The current issue is metadata inconsistency (not obvious malicious code), but confirm provenance before adding this skill to production agents.
功能分析
Type: OpenClaw Skill Name: baidu-qianfan-search Version: 1.0.0 The skill is a legitimate integration for the Baidu Qianfan Web Search API. The core logic in `scripts/search.mjs` correctly implements the search functionality by sending user-provided queries to the official Baidu endpoint (qianfan.baidubce.com) and uses standard libraries like `commander` and `dotenv` for configuration and argument parsing without any signs of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
The name, description, SKILL.md, scripts/search.mjs and references/api-reference.md all consistently implement a Baidu Qianfan (千帆) enterprise search integration. The code calls the documented endpoint (qianfan.baidubce.com) and uses expected parameters. Declared dependencies (commander, dotenv) are appropriate for a CLI Node tool.
Instruction Scope
SKILL.md instructions stay on-topic: they explain how to provide the API key (env var or .env), how to run the script, and what parameters the search supports. The runtime instructions do not ask for unrelated files or credentials and only reference the skill-local .env file and the search API.
Install Mechanism
There is no install spec (instruction-only skill) and the code is small and readable. package.json lists normal runtime deps; however, because there's no install step in metadata the user or host will need to install Node deps (npm install) before running. No external or obscure download URLs are used.
Credentials
The runtime code and SKILL.md require BAIDU_QIANFAN_API_KEY (via environment or .env), but the registry metadata lists no required env vars or primary credential. This is an inconsistency: the skill legitimately needs a single API key, and that key should be declared in the skill metadata (primaryEnv / requires.env). The missing declaration could lead to runtime failure or mask the fact that a secret will be used by the skill.
Persistence & Privilege
The skill does not request elevated/persistent privileges. always is false, it does not modify other skills or system-wide agent settings, and it only reads a skill-local .env (dotfile) for the API key. It performs outbound HTTPS requests only to the documented Baidu endpoint.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install baidu-qianfan-search
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /baidu-qianfan-search 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of baidu-qianfan-search skill. - Enables comprehensive web, image, and video search via Baidu Qianfan enterprise API (not standard Baidu Search). - Supports advanced filtering: time range, resource type, site inclusion/exclusion, safe search, and custom parameters. - Requires user-supplied Baidu Qianfan API key (setup via environment variable or .env file). - Includes scripts, usage instructions, API parameter reference, and troubleshooting guide.
元数据
Slug baidu-qianfan-search
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

baidu-search 是什么?

Comprehensive search API integration for Baidu Qianfan Web Search. Use when Claude needs to perform web searches using Baidu Qianfan's enterprise search API.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 312 次。

如何安装 baidu-search?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install baidu-qianfan-search」即可一键安装,无需额外配置。

baidu-search 是免费的吗?

是的,baidu-search 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

baidu-search 支持哪些平台?

baidu-search 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 baidu-search?

由 lsall357357(@lsall357357)开发并维护,当前版本 v1.0.0。

💬 留言讨论