Searches and reads the CBETA Chinese Buddhist canon (Taisho, Xuzangjing, Jiaxing and 20+ collections) and looks up Buddhist monks, authors, translators, places and dates in the DILA authority database.
Ships in cbeta-api. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Two free web services run by the Dharma Drum Institute of Liberal Arts (DILA, 法鼓文理學院), no key needed:
Together they let an agent go from a name in a table to a person ID, from the ID to that person's works in the canon, and from the ID to Wikidata.
Base URLs (checked 2026-11-09):
https://cbdata.dila.edu.tw/stable/ # CBETA API 4.6
https://authority.dila.edu.tw/webwidget/getAuthorityData.php # DILA authority
The old host api.cbetaonline.cn no longer resolves. Older blog posts and code still use it.
Person search goes through id=. The authority API has no term or q parameter for persons. Put either an ID or a name in id:
getAuthorityData.php?type=person&id=A000759 → one record
getAuthorityData.php?type=person&id=空海 → every person whose name or other names contain 空海 (7 records)
The answer is {"data1": {...}, "data2": {...}}. "Not found" comes back in two shapes: null or {"data1": ""}. The content type is text/html even though the body is JSON.
Variant characters break name search. Japanese forms often differ from those in CBETA. 師錬 finds nothing, 師鍊 finds 虎關師鍊 (A000919). When a name fails, call search/variants first:
https://cbdata.dila.edu.tw/stable/search/variants?q=師錬 → 師鍊 (75 hits), 師煉 (2 hits)
Then search the authority database again with the variant. "Not found" is not "does not exist".
Query length limit: every CBETA search q must be 40 characters or fewer, or the API returns an error.
Errors come as HTTP 200 with {"success": false, "error": "..."} (the message is in Chinese, e.g. 缺少必要參數).
Line IDs (linehead) are the stable address of a line: T08n0235_p0748c17 = Taishō vol. 8, no. 235, page 748, column c, line 17. The standard citation form is CBETA, T08, no. 235, p. 748c17. Cite with these, not with page numbers of the HTML.
Creator IDs in CBETA are DILA person IDs. creators_with_id looks like 鳩摩羅什(A001583). Use works?creator_id=A001583 to list someone's works.
scripts/cbeta_api.py (standard library only; rate limit, retries, User-Agent, UTF-8).
from scripts.cbeta_api import CBETAAPI
api = CBETAAPI()
# Persons (DILA authority)
people = api.person("空海") # list of records; [] if none
print(api.summarize_person(people[0])) # name, ID, dates, school, other names, note
api.person("A000919") # by ID
api.wikidata_for_person("A000759") # [{'qid': 'Q222227', 'label': '空海'}]
api.place("嵩山") # lat/long and modern district
api.date(when="+0835-04-26") # Chinese calendar for a CE date
# Variant characters, when a name or term finds nothing
api.search_variants("師錬") # [{'q': '師鍊', 'hits': 75}, ...]
# Works
api.work("T0235") # metadata: title, byline, creators_with_id, time_from/to, places
api.works_by_creator(creator_id="A000919") # 元亨釋書 B0173, 八海含藏 B0179
api.works_by_creator(name="空海") # name contains 空海
api.works_by_time(dynasty="唐")
api.toc("T0001")
# Text
api.goto("CBETA, T08, no. 235, p. 748c17") # → work, juan, linehead
api.lines("T08n0235_p0748c17", after=3) # line text with collation notes
api.juan_text("T0251", 1) # plain text of one fascicle (reading copy)
CBETAAPI.cite(api.work("T0235"), "0748c17") # 'CBETA, T08, no. 235, p. 748c17'
# Search
api.search("如是我聞", canon="T", order="time_from+")
api.search_all_in_one('"法鼓" NEAR/7 "迦葉"') # with KWIC snippets
api.search_kwic("T0235", 1, "如是我聞") # hits inside one fascicle, with line numbers
api.search_title("心經")
api.search_similar("一切有為法如夢幻泡影") # find a loose quotation
api.search_simplified("金刚经")
Command line (good for a quick check):
python3 scripts/cbeta_api.py person 虎關師鍊
python3 scripts/cbeta_api.py works-by A000919
python3 scripts/cbeta_api.py variants 師錬
python3 scripts/cbeta_api.py goto "CBETA, T08, no. 235, p. 748c17"
python3 scripts/cbeta_api.py wikidata A000759
python3 scripts/cbeta_api.py search 元亨釋書
person(name). If several records come back, compare dates, dynasty/country (日本, 唐…) and note with your source. Show the candidates to the user if more than one fits.search_variants(name), then person(variant). Also try a shorter name: DILA often stores the dharma name only (師鍊, not 虎關師鍊; 周信, not 義堂周信). The longer name is usually in names.works_by_creator(creator_id=...) for works in the canon, and wikidata_for_person(...) for the Wikidata item.https://authority.dila.edu.tw/person/?fromInner=<ID> or the CBETA reader https://cbetaonline.dila.edu.tw/<linehead>.Coverage: DILA is a Buddhist database. Lay scholars (for example the Confucian 林羅山) are usually not in it. For them use jbdb-api, cbdb-local or wikidata-search.
juan_text() is a reading copy; quote from lines() so the notes and line numbers stay with the text.lines() returns notes (e.g. 〔長安〕-【宋】: the Song edition lacks 長安).time_from/time_to on a work are the CE years of composition or translation, often a range. bornDateBegin/diedDateBegin on persons are ISO strings or unknown.references/api_reference.md — endpoints, parameters, response fields, quirks.scripts/cbeta_api.py — the client and command line.Report a problem. This skill is part of the public repository kltng/humanities-skills. If it fails (an API changed, a script errors, or these instructions are wrong), report it as a GitHub issue:
gh issue list --repo kltng/humanities-skills --state all --search "cbeta-api"gh issue create --repo kltng/humanities-skills --label bug --title "[cbeta-api] <short summary>" --body "<details>". Without gh, give the user this link: https://github.com/kltng/humanities-skills/issues/new?template=skill-problem.ymlCredit the source. The texts come from CBETA, the Chinese Buddhist Electronic Text Association (財團法人佛教電子佛典基金會), https://www.cbeta.org. CBETA Online and this API are built and kept running by the Dharma Drum Institute of Liberal Arts (DILA, 法鼓文理學院). Unless a text says otherwise, CBETA releases its database under CC BY-NC-SA 4.0 International (版權宣告): non-profit use only, credit CBETA, and share derived work under the same licence. A copy you pass on must keep CBETA's notice and the version of the data. Some modern works (for example those of 印順, 呂澂, 太虛 and 演培) are not under this licence; check the notice of the work. Cite passages with the CBETA line reference, for example CBETA, T08, no. 235, p. 748c17, and give the CBETA version or the date you used it. The API asks callers to send a Referer header so that use can be counted; the client does this. The person, place and time look-ups come from the DILA Authority Database (https://authority.dila.edu.tw/), sponsored by the Hao-Ran Foundation; credit it by name with the authority ID. Its time data is under CC BY-SA 2.5 Taiwan.
Cite. If this skill helped work that is published, please cite it, together with the source credited above:
Tang, Kwok-leong. humanities-skills: cbeta-api (version ). GitHub, . https://github.com/kltng/humanities-skills
When you help a user write up results that relied on this skill, remind them once about this citation and the credit above.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cbeta, buddhist-canon, dila-authority, taisho, chinese-buddhism, sutra-search
/cbeta-api:cbeta-apifrom cbeta-api
npx claudepluginhub kltng/humanities-skills --plugin cbeta-apiOther plugins' skills for the same job