cbdb-api/SKILL.md
Query the China Biographical Database (CBDB) API to retrieve comprehensive biographical data about historical Chinese figures. Use this skill when searching for information about Chinese historical figures, scholars, officials, or literary figures from the 7th century BCE through the 19th century CE. Applicable for queries about biographical details, social relationships, official positions, or when users mention specific Chinese names or CBDB person IDs.
npx skillsauth add kltng/humanities-skills cbdb-apiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Query the China Biographical Database (~500K historical Chinese figures, 7th c. BCE–19th c. CE).
API endpoint:
https://cbdb.fas.harvard.edu/cbdbapi/person.php
Response structure is deeply nested:
response["Package"]["PersonAuthority"]["PersonInfo"]["Person"]
The Person object contains: BasicInfo, AltNameInfo, AddrInfo, EntryInfo, PostingInfo, SocialAssocInfo, KinshipInfo.
Encoding: Pass Chinese characters as UTF-8 directly — do not URL-encode into hex.
Use scripts/cbdb_api.py for programmatic access (zero dependencies):
from scripts.cbdb_api import CBDBAPI
api = CBDBAPI()
# By name (Chinese or Pinyin)
person = api.query_by_name("蘇軾")
person = api.query_by_name("Wang Anshi")
# By ID (most precise)
person = api.query_by_id(1762)
# Extract structured data
basic = api.get_basic_info(person) # name, dates, dynasty
postings = api.get_postings(person) # official positions
assocs = api.get_social_associations(person) # social network
kinship = api.get_kinship(person) # family relations
alt_names = api.get_alt_names(person) # courtesy name, pen name, etc.
# Formatted summary
print(api.summarize(person))
The script handles rate limiting, retries, and the nested JSON navigation automatically.
Query by Chinese name:
https://cbdb.fas.harvard.edu/cbdbapi/person.php?name=蘇軾&o=json
Query by Pinyin: (URL-encode spaces only)
https://cbdb.fas.harvard.edu/cbdbapi/person.php?name=Wang%20Anshi&o=json
Query by ID: (most precise)
https://cbdb.fas.harvard.edu/cbdbapi/person.php?id=1762&o=json
Priority: ID > Chinese characters > Pinyin (Pinyin may return multiple matches).
Multiple results from Pinyin queries: Check dynasty, dates, or other context to identify the correct person. If ambiguous, present options to the user.
Error response:
{"error": {"code": 404, "message": "Person not found."}}
Try alternative name forms (Chinese vs Pinyin), check spelling, or try courtesy names (字, 號).
BasicInfo fields: PersonId, EngName, ChName, IndexYear, Gender, YearBirth, YearDeath, Dynasty, Notes
AddrInfo in the CHGIS Temporal Gazetteerreferences/api_reference.md — Complete endpoint specs, all parameters, response structure detailsscripts/cbdb_api.py — Python client with rate limiting and structured data extractiondevelopment
Query the China Biographical Database (CBDB) locally via SQLite for biographical data on 656K+ historical Chinese figures from the 7th century BCE through the 19th century CE. Use when searching for Chinese historical figures, scholars, officials, or literary figures — their biographical details, family/kinship networks, official postings, social associations, examination records, or addresses. Runs entirely locally after initial database download (~556 MB). Faster and more flexible than the API version.
development
Interact with a local Zotero 8 desktop application through its HTTP API at localhost:23119. Use this skill whenever the user wants to search, fetch, add, edit, or organize bibliographic items in their Zotero library, import citations (BibTeX, RIS, etc.), attach files, manage collections and tags, or retrieve full-text content from Zotero. Triggers on mentions of Zotero, citation management, reference libraries, bibliographic databases, or local library management. Also use when chaining with other catalog skills (Harvard, LOC, HathiTrust, etc.) to save found records into the user's Zotero library.
development
Search for items and properties on Wikidata and retrieve entity details, claims, and external identifiers. Supports both keyword search (Wikidata Action API) and semantic/hybrid search (Wikidata Vector Database), plus direct entity retrieval (Special:EntityData) and structured querying (WDQS SPARQL).
testing
Query and explore the TGAZ (Temporal Gazetteer) SQLite database of 82,000+ historical Chinese placenames spanning 763 BCE to 1911 CE. Use this skill whenever the user asks about historical Chinese places, administrative geography, dynastic jurisdictions, place name evolution, or wants to query tgaz.db. Also trigger when the user mentions CHGIS, TGAZ, historical gazetteer, Chinese historical GIS, or asks questions like "what was X called in dynasty Y", "what counties existed in year Z", "where was X located", or any spatial/temporal query about Chinese historical geography. This skill is relevant even for casual questions like "tell me about ancient Chang'an" or "Tang dynasty cities near the Yellow River".