explaingit

valenovo/baidu-search-skill

13PythonAudience · developerComplexity · 2/5ActiveLicenseSetup · easy

TLDR

Agent Skill that runs Chinese-language web searches through Baidu's AI Search and Baike APIs, then writes a deduplicated research pack a coding agent can cite from.

Mindmap

mindmap
  root((baidu-search-skill))
    Inputs
      Search query
      Baidu API key
      Search mode
    Outputs
      Research pack
      Deduplicated sources
      Run summary
      Error log
    Use Cases
      Cite Chinese web sources
      Lookup Baike entity facts
      Plan multi-angle research
    Tech Stack
      Python
      Baidu AI Search
      Baidu Baike

Things people build with this

USE CASE 1

Give Codex, Claude Code, or Cursor a way to search Chinese-language sources before answering

USE CASE 2

Run a quick Baike lookup for a single entity question via the lookup mode

USE CASE 3

Plan a deep multi-angle research pass with up to twelve search terms and cite source IDs

USE CASE 4

Rotate between multiple Baidu API keys for failover and quota isolation

Tech stack

PythonBaidu AI SearchBaidu Baike

Getting it running

Difficulty · easy Time to first run · 30min

Needs Python 3.10+ and a Baidu AI Search or AppBuilder API key in the BAIDU_AI_SEARCH_API_KEYS env var.

MIT, free to use, modify, and ship in commercial products with attribution.

In plain English

This repository is an Agent Skill that lets a coding agent run Chinese-language web searches through Baidu's official APIs. Baidu is the dominant search engine in mainland China, and its AI Search API plus the Baidu Baike encyclopedia API are the two sources this skill calls. The skill is aimed at agents like Codex, Claude Code, and Cursor that load local skill packs, giving them a way to find Chinese web sources before answering a question. The author is careful about what the project is not. It is not a scraper, not a tool to get around search engine limits, and not a way to fake answers without citations. The job of the skill is to fetch search results, deduplicate URLs, and write a research pack the agent reads before replying, so the agent has a list of sources with IDs it can cite back. Setup is small. You need Python 3.10 or newer and a Baidu AI Search or AppBuilder API key, placed in the BAIDU_AI_SEARCH_API_KEYS environment variable. Multiple keys can be set with comma separation, used for failure switchover and quota isolation rather than splitting one query across keys to dodge limits. The scripts only use the Python standard library. Searches run in four modes. lookup is for simple entity questions and prefers Baike with one or two API calls. fast finds a quick batch of sources from a single search term. normal is the default, plans up to twelve search terms, and stops early when coverage is good enough. deep is for cases where the user asks for broad or multi-angle research and is allowed a higher budget. Each run writes a timestamped folder under runs/ containing the query plan, raw results, deduplicated sources, a research pack file, a run summary, an adaptive trace, and an error log. The README also recommends adding a workspace instruction telling the agent to prefer this skill over a generic web_search tool for Chinese queries and to cite source IDs from the research pack. The project is MIT licensed and notes its limits: top_k caps at 50 per query, full page text is not fetched, and the agent or user still has to judge quality.

Copy-paste prompts

Prompt 1
Install baidu-search-skill into my Claude Code skills folder and set BAIDU_AI_SEARCH_API_KEYS
Prompt 2
Show me what the normal-mode research pack looks like under runs/ after a query
Prompt 3
Add a workspace instruction so my agent prefers this skill over web_search for Chinese queries
Prompt 4
Explain how the four modes lookup, fast, normal, deep differ in API budget and term planning
Prompt 5
Parse the adaptive trace from a deep-mode run and surface which queries returned zero results
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.