360 Secure SkillHub
360 安全技能中心

baidu baike search

接收用户提供的名词,调用百度百科 API 返回标准化词条释义;支持按标题直接检索,也支持对同名词条先列出候选再由用户选择 ID 获取指定条目。运行需 python3 与 BAIDU_API_KEY 环境变量。

ide-rea
ide-rea
热度 98.90
最近更新 2026-05-11 15:54:46
分类:知识依赖:代码执行 / 第三方 API应用场景:研究 / 概念解释

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add baidu-baike-data
Metadata
name
baidu-baike-data
description
The Baidu Baike Component is a knowledge service tool designed to query authoritative encyclopedia explanations for various nouns. Its core function is given a specific "noun" (object, person, location, concept, event, etc.) provided by the user, it returns a standardized, detailed entry explanation sourced from Baidu Baike.
homepage
https://baike.baidu.com/
metadata
{"openclaw":{"emoji":"📖","requires":{"bins":["python3"],"env":["BAIDU_API_KEY"]},"primaryEnv":"BAIDU_API_KEY"}}

Baidu Baike

Query encyclopedia entries from Baidu Baike.

Two Usage Scenarios

Scenario 1: Direct Search

Get default matching entry for a keyword.

python3 scripts/baidu_baike.py --search_type=lemmaTitle --search_key="keyword"

Scenario 2: Homonym Resolution

When term has multiple entries, list them and select by ID.

# List entries with same name
python3 scripts/baidu_baike.py --search_type=lemmaList --search_key="keyword" --top_k=5

# Get specific entry by ID
python3 scripts/baidu_baike.py --search_type=lemmaId --search_key="entry_id"

API

  • LemmaList: List entries with same title
  • LemmaContent: Get entry details by title or ID

Setup

export BAIDU_API_KEY="your_api_key"

Workflow

  1. Extract noun from query
  2. For ambiguous terms, call LemmaList first
  3. User selects entry from list
  4. Call LemmaContent with selected ID
  5. Return structured data