← Back to Skills Marketplace
crossallen

Baidu Ecommerce Search

by crossallen · GitHub ↗ · v1.0.10 · MIT-0
cross-platform ✓ Security Clean
1814
Downloads
3
Stars
9
Active Installs
11
Versions
Install in OpenClaw
/install baidu-ecommerce-search
Description
Baidu ecommerce one-stop service, including product knowledge (product comparison / brand knowledge / category knowledge / product specifications / brand ran...
README (SKILL.md)

baidu-ecommerce-search

百度电商一站式服务,覆盖商品知识查询和购物交易全流程。支持商品对比、品牌知识、品类选购指南、商品参数解读、品牌榜单及单品榜单等知识查询能力;同时提供商品搜索、规格查看、地址管理、下单购买、订单查询及售后服务等完整交易链路,帮助用户从决策到购买一步到位。

Setup

  • 环境依赖:Python 3.x,仅使用标准库,无需安装第三方包
  • 配置步骤
    1. 访问 https://openai.baidu.com 登录百度账号,点击权限申请勾选所需能力
    2. 设置环境变量:
      export BAIDU_EC_SEARCH_TOKEN="your-token"
      export BAIDU_EC_SEARCH_QPS="1"  # 可选,默认1,设为0无限制
      

全局交互规范

简化用户输入

展示列表时必须带序号供用户输入序号选择,确认环节告知用户可输入"1"或"确认"。

链接格式

所有可跳转内容用 [文本](URL) 格式,URL 中的 | 必须转义为 \|,优先使用接口返回的购买链接。

能力清单

以下能力是可组合的工具箱。响应用户时,先分析哪些能力与用户问题相关,再调用所有相关能力.

电商知识

  • 商品对比 — 参数/口碑/价格全方位对比(仅支持两个对比,"iPhone17和iPhone16对比") python3 scripts/compare.py "\x3C对比查询>"
  • 品牌知识 — 品牌简介/定位/明星产品/大事记 python3 scripts/knowledge.py brand "\x3C品牌名>"
  • 品类知识 — 品类选购要点/避坑指南 python3 scripts/knowledge.py entity "\x3C品类名>怎么选"
  • 商品参数 — 单品规格参数及 AI 解读(如"iPhone 17 怎么样""小米14参数") python3 scripts/knowledge.py param "\x3C商品名>"
  • 品牌榜单 — 某品类下的品牌排行(如"手机排行榜""冰箱排行榜") python3 scripts/ranking.py brand "\x3C榜单查询>"
  • 单品榜单 — 某品牌下的商品排行(如"苹果手机排行榜") python3 scripts/ranking.py product "\x3C榜单查询>"

百度优选

  • 商品搜索 — 搜索可直接下单的商品 python3 scripts/spu.py list "\x3C关键词>"
  • 商品详情 — 获取 SKU 规格及价格 python3 scripts/spu.py detail \x3CspuId>
  • 创建订单 python3 scripts/order.py create --sku-id \x3CskuId> --spu-id \x3CspuId> --addr-id \x3CaddrId>
  • 订单历史 python3 scripts/order.py history
  • 订单详情 python3 scripts/order.py detail \x3CorderId>
  • 售后查询 python3 scripts/after_service.py \x3CorderId>
  • 地址列表 python3 scripts/address.py list
  • 地址识别 — 从自然语言提取结构化地址 python3 scripts/address.py recognise "\x3C姓名 地址 手机号>"
  • 地址添加 python3 scripts/address.py add \x3CrecogniseId>

CPS 商品

  • CPS商品搜索 — 全网商品购买链接 python3 scripts/cps.py "\x3C关键词>"

业务约束

  1. 知识引导决策:用户有购买意向时,知识在前、商品在后。全链路(含交易流程)均需结合知识输出。
  2. 商品搜索规则
    • 触发条件:仅在用户表达购买意向时搜索商品(如"想买""帮我找""有没有卖的"),纯知识咨询(如"xx怎么样""xx和yy哪个好")不触发搜索
    • 搜索方式:同时调用百度优选搜索和 CPS 搜索
    • 准入规则:百度优选和 CPS 结果均按相关性筛选,仅纳入与用户查询相关的商品
    • 排序规则:表格内必须先展示百度优选的商品,再展示cps的商品
    • 补充搜索:首选来源结果不足 10 条时用同义词补充搜索,最多 3 次(含首次),同义词必须保留用户指定的核心限定词(如"手机typec充电器"→"手机USB-C充电器",不能丢"手机")
    • 全程不向用户提及来源差异或平台切换
  3. 决策到交易串联:用户通过对比/榜单做完决策后,主动询问是否需要搜索购买
  4. 下单前必须确认地址:调用 address list 让用户明确选择,禁止默认下单
  5. 地址添加两步依赖:必须先 address recognise 获取 recogniseId,再 address add,不可跳步

展示规范

商品列表(表格)

序号 商品名称 价格 商城 店铺 其他
1 商品名称 ¥xx起 京东 店铺名 4.9分 销量170 / 7天无理由 / 3种规格
  • 商品名称:必须展示接口返回的完整商品名,禁止截断或简化
  • 价格:多 SKU 显示 ¥xx起,单 SKU 显示 ¥xx
  • 商城:展示商品所属商城平台(如京东、淘宝等),百度优选商品显示"百度优选"
  • 店铺:有评分时 店铺名 x.x分,无评分只显示名称
  • 其他:销量(>0)/保障标签/规格数(>1),用 / 分隔,有则显示无则省略

品牌榜单列表

  • 品牌名称:使用brandLandingURL作为品牌名跳转链接

下单流程(严格按顺序执行)

CPS商品

不支持 spu detail 和 order create。用户选择 CPS 商品时:解析 extra_attributes 展示规格参数表格 → 提供购买链接引导跳转。

百度优选商品

  1. 商品选择:调用 spu list 搜索 → 展示结果 → 用户选择 → 获取 spuId
  2. 规格选择:从搜索结果或 spu detail 获取 SKU 列表
    • 仅 1 个 SKU:自动使用,跳过确认
    • 多个 SKU:展示规格让用户选择 → 获取 skuId
    • 无匹配 SKU(SKU 规格与用户需求不符):禁止使用不匹配的 SKU 下单,告知用户当前商品无匹配规格,引导重新搜索或选择其他商品
  3. 地址确认:调用 address list 获取地址列表
    • 有地址:展示列表让用户选择,同时提示可新增地址 → 获取 addrId
    • 无地址:引导用户提供地址信息(格式:收货人 + 详细地址 + 手机号)→ 调用 address recognise → 调用 address add → 获取 addrId
  4. 订单确认:汇总展示商品名称 + 规格 + 收货地址 + 金额 → 用户确认
  5. 创建订单:调用 order create,返回订单详情链接
  • 创建订单使用的账号为用户申请 token 的账号
  • 订单创建后用户需在返回的链接中完成支付

错误处理

errmsg 处理
token is limit 必须静默等待 1 秒后重试同一请求,不可跳过或用其他结果替代
token权限不足 告知用户访问 https://openai.baidu.com 申请
token is nil / token is invalid 提示用户检查 BAIDU_EC_SEARCH_TOKEN 配置
path错误 / 请求地址错误 / 非法path 检查脚本路径和参数
商品已下架 / 商品已售罄 引导选择其他商品或规格
不支持用户地址发货 引导修改收货地址

不向用户展示原始 errmsg,转译为用户友好的提示。

Usage Guidance
This package appears coherent with its stated Baidu ecommerce purpose. Before installing or enabling it, verify that: (1) BAIDU_EC_SEARCH_TOKEN you provide is from a trusted Baidu account and you understand the token's scope because the skill will use that account to create orders; (2) the external endpoint (https://mcp-youxuan.baidu.com/skill) is acceptable for your environment; (3) the skill will process and transmit personal address data (name, address, phone) to that backend—avoid providing sensitive PII unless you trust the service; and (4) the script creates a local lock file for rate-limiting in the scripts directory (benign but writes to disk). If any of these are unacceptable or you cannot verify the backend/domain or token scope, treat the integration as untrusted and do not provide your token.
Capability Analysis
Type: OpenClaw Skill Name: baidu-ecommerce-search Version: 1.0.10 The skill bundle provides a legitimate interface for Baidu e-commerce services, including product search, knowledge retrieval, and order management. The implementation is clean, using only Python standard libraries and following the stated purpose without any evidence of data exfiltration, malicious execution, or harmful prompt injection. It includes a robust cross-process rate-limiting mechanism in `scripts/lock.py` and properly sanitizes API parameters via URL encoding in `scripts/common.py`.
Capability Assessment
Purpose & Capability
Name/description request python3 and a BAIDU_EC_SEARCH_TOKEN and the code calls a Baidu ecommerce API (BASE_URL mcp-youxuan.baidu.com). The requested token and python runtime map directly to the declared ecommerce search and order capabilities.
Instruction Scope
SKILL.md and the scripts instruct only API calls to the declared backend, QPS locking, and standard CLI-style argument handling. The instructions do not direct reading unrelated system files or asking for unrelated credentials. The skill does process user-provided address text (PII) as part of the advertised address-recognition feature—this is expected for the stated functionality.
Install Mechanism
No install spec (instruction-only install) and all code is bundled; the scripts use only standard library modules and make network requests. No remote downloads, package installer, or suspicious third-party install URLs are present.
Credentials
Only BAIDU_EC_SEARCH_TOKEN is required (primary credential), with an optional BAIDU_EC_SEARCH_QPS env var for rate control. These are proportional to a service that both queries and places orders on behalf of the token-holder.
Persistence & Privilege
Skill is not always-enabled and does not request elevated platform privileges. The only filesystem side-effect is a local lock file used for cross-process QPS limiting (written under the scripts directory), which is reasonable for rate-limiting.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install baidu-ecommerce-search
  3. After installation, invoke the skill by name or use /baidu-ecommerce-search
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.10
**Summary:** Improved product table structure, clarified search result rules, and refined CPS/百度优选处理及流程。 - 商品展示表格新增“商城”列,区分百度优选与CPS商品,要求先展示百度优选商品 - 补充搜索规则由不足8条提升为不足10条,排序规则要求百度优选商品优先 - 明确CPS商品仅支持买链跳转,不支持规格详情和下单流程 - 品牌榜单列表支持品牌名称带跳转链接 - Setup/能力清单/流程细节表述更为简明和易懂
v1.0.9
- 移除了“零干扰规范”相关内容,放宽了交互流程描述限制 - 其他全局交互规范与业务逻辑保持不变 - 功能、能力清单、展示规范、下单流程和错误处理未做调整
v1.0.8
**Major update: Adds full transaction support including search, ordering, address, and after-sales.** - Introduced new endpoint scripts for address management, order creation/history, after-sales, and SPU detail/listing. - Expanded from product knowledge/decision support to also cover the complete e-commerce transaction process (shopping, address, order, after-sales). - Updated SKILL.md to define strict interaction, error handling, display, and order flow specifications for a one-stop shopping experience. - Clarified decision and search priorities—now integrates both Baidu and CPS sourcing for user purchase requests. - Enforced "zero-interference" UX: only user-facing info shown, never tool invocation or process.
v1.0.7
No functional changes; only the description was updated. - English version of the skill description in the metadata for broader accessibility. - All other documentation and functionality remain unchanged.
v1.0.6
- Added English to the skill description, making it bilingual. - No other user-facing changes detected in this version.
v1.0.5
- Removed the "keywords" field from skill metadata. - No functional or behavioral changes in this version.
v1.0.4
- 移除了全网比价能力相关内容,包括 bijia.py 脚本及使用说明 - SKILL.md 文档删去“全网比价”与相关 SPU/SKU 比价调用流程 - 只保留商品查询、榜单、商品参数和品牌品类知识等功能 - 增加 keywords 元数据字段 - 文档内容更加简洁,聚焦主流电商搜索和商品查询能力
v1.0.3
baidu-ecommerce-search 1.0.3 - 明确要求在商品查询时,使用接口返回的购买链接字段(如 `url` 或 `cps_url`)提供给用户。 - 指定返回商品购买链接时,应优先以 markdown 链接形式展示,不应直接返回原始链接文本。 - 说明在 SKU 商品比价接口中,`cps_url` 字段为空时不展示购买链接。 - 新增一条注意事项,强调应优先用 API 返回的购买链接而非自行推测。 - 其余功能和用法、接口调用方式未变。
v1.0.2
Version 1.0.2 - 文档 SKILL.md 增加了注意事项第5点,提醒商品链接中可能含有 `|` 等特殊字符,markdown 展现时需注意转义。 - 其余内容保持不变,仅有文档说明细节的补充。
v1.0.1
- Metadata key changed from "clawdbot" to "openclaw" - Environment variable "BAIDU_EC_SEARCH_QPS" removed from required list in metadata (but remains documented as optional) - No changes to code or user-facing features
v1.0.0
baidu-ecommerce-search 1.0.0 - Initial release with comprehensive search and comparison for e-commerce on Baidu. - Supports product versus comparison, full web price comparison, rankings, product parameters, and brand/category knowledge. - Scripts provided for product comparison, knowledge queries, rankings, CPS product search, and detailed multi-level price comparison. - Includes robust error handling, QPS configuration, and setup guidelines using Python 3 standard library.
Metadata
Slug baidu-ecommerce-search
Version 1.0.10
License MIT-0
All-time Installs 9
Active Installs 9
Total Versions 11
Frequently Asked Questions

What is Baidu Ecommerce Search?

Baidu ecommerce one-stop service, including product knowledge (product comparison / brand knowledge / category knowledge / product specifications / brand ran... It is an AI Agent Skill for Claude Code / OpenClaw, with 1814 downloads so far.

How do I install Baidu Ecommerce Search?

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

Is Baidu Ecommerce Search free?

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

Which platforms does Baidu Ecommerce Search support?

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

Who created Baidu Ecommerce Search?

It is built and maintained by crossallen (@crossallen); the current version is v1.0.10.

💬 Comments