Chinese Text Project
App · 9 actions
Explore the Chinese Text Project, the open digital library of pre-modern Chinese writing. Look up a character's pronunciations, strokes and simplified or traditional forms; find classics such as the Analects and the Dao De Jing by title; get a text's author, dynasty and a link to read it on ctext.org; search the dictionary for words, people and places; and list China's dynasties with their dates. No account or API key required.
Actions
| Action | What it does |
|---|---|
| Find texts by title | Find books in the library whose title contains some Chinese characters, traditional or simplified. |
| Get a link to a text | Get the ctext.org page for a book or chapter to share or open, in English or Chinese, optionally with a word or phrase highlighted wherever it appears. |
| Get details of a text | Get what the library knows about a book or one of its chapters: its title, author, dynasty, when it was written, the edition it follows, and a link to read it on ctext.org. |
| Get library statistics | Get the library's running totals: characters of classical text, texts and chapters in its Wiki, scanned pages, parallel passages and more. |
| Identify a ctext.org link | Find out which book or chapter a ctext.org page shows, and get its title and text ID to use in later steps. |
| List Chinese dynasties | List the dynasties and periods of Chinese history with their dates, from the Western Zhou to the Republican era, or just the ones in power in a given year. |
| List the classic texts | List the library's curated classics, such as the Analects, the Mencius, the Dao De Jing and the Art of War, with each one's text ID for later steps. |
| Look up a Chinese character | Get one Chinese character's pronunciations (Mandarin pinyin, zhuyin, Cantonese and the reconstructed Tang-era reading), its radical and stroke counts, and its other forms, such as the simplified or traditional version. |
| Search the dictionary | Find words, people and places in the library's dictionary of classical Chinese by the characters they are written with, such as every person whose name contains 孔. |
Find texts by title
Find books in the library whose title contains some Chinese characters, traditional or simplified. Titles are only in Chinese, so search for 論語 rather than Analects.
Inputs
- Title
titletextRequired - All or part of the title, in Chinese characters.
- Classics only
classics_onlytrue/false - Turn on to leave out texts contributed to the library's Wiki and keep only its curated classics.Default:
false. - How many
limitnumber - The most texts to return, between 1 and 500.From 1 to 500. Default:
25. - Characters
scripttext - Show Chinese in traditional characters, as the library holds it, or converted to simplified characters.One of:
traditional(Traditional characters (as the library holds them)),simplified(Simplified characters). Default:traditional.
Outputs
countnumber- How many texts are returned.
first_text_idtext- The first match's text ID.
first_titletext- The first match's title.
textslist- The matching texts.
total_foundnumber- How many texts matched in all.
Example output
{
"count": 3,
"first_text_id": "ctp:art-of-war",
"first_title": "\u5b6b\u5b50\u5175\u6cd5",
"texts": [
{
"is_core_classic": true,
"text_id": "ctp:art-of-war",
"title": "\u5b6b\u5b50\u5175\u6cd5"
},
{
"is_core_classic": true,
"text_id": "ctp:sunzi-suan-jing",
"title": "\u5b6b\u5b50\u7b97\u7d93"
},
{
"is_core_classic": false,
"text_id": "ctp:wb389011",
"title": "\u5341\u4e00\u5bb6\u6ce8\u5b6b\u5b50"
}
],
"total_found": 30
}Get a link to a text
Get the ctext.org page for a book or chapter to share or open, in English or Chinese, optionally with a word or phrase highlighted wherever it appears.
Inputs
- Text
texttextRequired - Pick a classic from the list, or type any text: its ctext.org link, its title in Chinese (such as 論語), or its text ID from another step (such as ctp:analects or ctp:analects/xue-er for one chapter).
- Highlight
highlighttext - Optional. Chinese characters to highlight on the page, such as 仁.
- Page language
page_languagetext - Which version of the page the link opens.One of:
en(English),zh(Chinese (traditional characters)),zhs(Chinese (simplified characters)). Default:en.
Outputs
highlighttext- The characters highlighted, if any.
page_languagetext- The page language chosen.
text_idtext- The text's ID.
web_linktext- The page on ctext.org.
Example output
{
"highlight": "\u670b",
"page_language": "en",
"text_id": "ctp:analects/xue-er",
"web_link": "https://ctext.org/analects/xue-er?searchu=\u670b"
}Get details of a text
Get what the library knows about a book or one of its chapters: its title, author, dynasty, when it was written, the edition it follows, and a link to read it on ctext.org.
Inputs
- Text
texttextRequired - Pick a classic from the list, or type any text: its ctext.org link, its title in Chinese (such as 論語), or its text ID from another step (such as ctp:analects or ctp:analects/xue-er for one chapter).
- Characters
scripttext - Show Chinese in traditional characters, as the library holds it, or converted to simplified characters.One of:
traditional(Traditional characters (as the library holds them)),simplified(Simplified characters). Default:traditional.
Outputs
authortext- The author, where known.
book_text_idtext- The book's text ID.
book_titletext- The title of the book it belongs to.
dynastytext- The dynasty or span of dynasties it dates from.
dynasty_fromtext- The earliest dynasty it dates from.
dynasty_totext- The latest dynasty it dates from.
editiontext- The printed edition the text follows.
edition_linktext- The edition's scans on ctext.org.
is_chaptertrue/false- True when this is a chapter of a book.
is_core_classictrue/false- True for the library's curated classics.
last_updatedtext- When the library last changed it.
tagslist- The library's labels for it, e.g. TEXTDB for the curated database.
text_idtext- The text's ID.
titletext- The title of this text or chapter.
web_linktext- Where to read it on ctext.org.
writtentext- When it was written, as readable text.
written_from_yearnumber- Earliest year of writing, where known (negative is BC).
written_to_yearnumber- Latest year of writing, where known (negative is BC).
Example output
{
"author": null,
"book_text_id": "ctp:analects",
"book_title": "\u8ad6\u8a9e",
"dynasty": "Spring and Autumn \u2013 Warring States",
"dynasty_from": "Spring and Autumn",
"dynasty_to": "Warring States",
"edition": "\u6b66\u82f1\u6bbf\u5341\u4e09\u7d93\u6ce8\u758f",
"edition_link": "http://ctext.org/library.pl?if=en&res=77721",
"is_chapter": true,
"is_core_classic": true,
"last_updated": "2015-12-07 20:40:31",
"tags": [
"TEXTDB"
],
"text_id": "ctp:analects/xue-er",
"title": "\u5b78\u800c",
"web_link": "https://ctext.org/analects/xue-er",
"written": null,
"written_from_year": null,
"written_to_year": null
}Get library statistics
Get the library's running totals: characters of classical text, texts and chapters in its Wiki, scanned pages, parallel passages and more.
Inputs
None.
Outputs
classical_charactersnumber- Characters of pre-Qin and Han text in the database.
direct_quotationsnumber- Identical quotations found.
later_charactersnumber- Characters of post-Han text in the database.
linked_charactersnumber- Characters linked to a dictionary meaning.
linked_characters_percentnumber- Share of characters linked to a meaning, in percent.
paragraphsnumber- Paragraphs in the database.
parallel_passage_groupsnumber- Groups of parallel passages.
parallel_passagesnumber- Parallel passages in all.
scanned_pagesnumber- Pages of scanned books in the library.
statistics_updatedtext- When the totals were last worked out.
wiki_chaptersnumber- Chapters in the Wiki.
wiki_charactersnumber- Characters in the Wiki.
wiki_textsnumber- Texts in the Wiki.
Example output
{
"classical_characters": 5687102,
"direct_quotations": 3100,
"later_characters": 20385859,
"linked_characters": 451466,
"linked_characters_percent": 7.9,
"paragraphs": 85560,
"parallel_passage_groups": 139634,
"parallel_passages": 480270,
"scanned_pages": 36361785,
"statistics_updated": "2023-04-06 15:55:04",
"wiki_chapters": 524934,
"wiki_characters": 7076266392,
"wiki_texts": 46085
}Identify a ctext.org link
Find out which book or chapter a ctext.org page shows, and get its title and text ID to use in later steps.
Inputs
- Link
urltextRequired - A page on ctext.org showing a text or chapter.
Outputs
book_text_idtext- The book's text ID.
book_titletext- The title of the book it belongs to.
is_core_classictrue/false- True for the library's curated classics.
text_idtext- The text's ID.
titletext- The title of the text or chapter.
Example output
{
"book_text_id": "ctp:mengzi",
"book_title": "\u5b5f\u5b50",
"is_core_classic": true,
"text_id": "ctp:mengzi/liang-hui-wang-i",
"title": "\u6881\u60e0\u738b\u4e0a"
}List Chinese dynasties
List the dynasties and periods of Chinese history with their dates, from the Western Zhou to the Republican era, or just the ones in power in a given year.
Inputs
- In the year
yearnumber - Optional. Only list dynasties in power that year. Use a negative number for BC, e.g. -500 for 500 BC.From -3000 to 2100.
- Names in
name_languagetext - Give the dynasty names in English or Chinese.One of:
en(English),zh(Chinese). Default:en.
Outputs
countnumber- How many dynasties are listed.
dynastieslist- The dynasties, earliest first.
yearnumber- The year asked about, if any.
year_labeltext- That year as readable text.
Example output
{
"count": 3,
"dynasties": [
{
"dynasty_id": 27,
"end_year": -221,
"name": "Zhou",
"period": "1046 BC \u2013 221 BC",
"start_year": -1046
},
{
"dynasty_id": 2,
"end_year": -256,
"name": "Eastern Zhou",
"period": "770 BC \u2013 256 BC",
"start_year": -770
},
{
"dynasty_id": 3,
"end_year": -476,
"name": "Spring and Autumn",
"period": "772 BC \u2013 476 BC",
"start_year": -772
}
],
"year": -500,
"year_label": "500 BC"
}List the classic texts
List the library's curated classics, such as the Analects, the Mencius, the Dao De Jing and the Art of War, with each one's text ID for later steps.
Inputs
- Characters
scripttext - Show Chinese in traditional characters, as the library holds it, or converted to simplified characters.One of:
traditional(Traditional characters (as the library holds them)),simplified(Simplified characters). Default:traditional.
Outputs
countnumber- How many classics there are.
textslist- The classic texts.
Example output
{
"count": 5,
"texts": [
{
"is_core_classic": true,
"text_id": "ctp:mozi",
"title": "\u58a8\u5b50"
},
{
"is_core_classic": true,
"text_id": "ctp:analects",
"title": "\u8ad6\u8a9e"
},
{
"is_core_classic": true,
"text_id": "ctp:mengzi",
"title": "\u5b5f\u5b50"
},
{
"is_core_classic": true,
"text_id": "ctp:hanfeizi",
"title": "\u97d3\u975e\u5b50"
},
{
"is_core_classic": true,
"text_id": "ctp:zhuangzi",
"title": "\u838a\u5b50"
}
]
}Look up a Chinese character
Get one Chinese character's pronunciations (Mandarin pinyin, zhuyin, Cantonese and the reconstructed Tang-era reading), its radical and stroke counts, and its other forms, such as the simplified or traditional version.
Inputs
- Character
charactertextRequired - One Chinese character, traditional or simplified.
Outputs
cantoneselist- Cantonese readings in Jyutping.
charactertext- The character looked up.
dictionary_linktext- The character's page on ctext.org.
middle_chineselist- Reconstructed Tang dynasty readings, where known.
pinyinlist- Mandarin readings in pinyin.
pinyin_texttext- The Mandarin readings as one line.
radicaltext- The radical the character is indexed under.
simplified_formslist- Its simplified forms, if any.
strokes_besides_radicalnumber- How many strokes it has beyond its radical.
total_strokesnumber- How many strokes it is written with.
traditional_formslist- Its traditional forms, if any.
variant_countnumber- How many other forms are listed.
variantslist- Every other form of the character, with how it relates.
zhuyinlist- Mandarin readings in zhuyin (bopomofo).
Example output
{
"cantonese": [
"ji6"
],
"character": "\u7fa9",
"dictionary_link": "https://ctext.org/dictionary.pl?if=en&char=\u7fa9",
"middle_chinese": [
"ngy\u025b\u0300"
],
"pinyin": [
"y\u00ec"
],
"pinyin_text": "y\u00ec",
"radical": "\u7f8a",
"simplified_forms": [
"\u4e49"
],
"strokes_besides_radical": 7,
"total_strokes": 13,
"traditional_forms": [],
"variant_count": 2,
"variants": [
{
"character": "\u4e49",
"relation": "Same meaning",
"relation_code": "kSemanticVariant"
},
{
"character": "\u4e49",
"relation": "Simplified form",
"relation_code": "kSimplifiedVariant"
}
],
"zhuyin": [
"\u3127\u02cb"
]
}Search the dictionary
Find words, people and places in the library's dictionary of classical Chinese by the characters they are written with, such as every person whose name contains 孔.
Inputs
- Characters
wordtextRequired - The Chinese characters to look for.
- Match
matchtext - How the entry has to match the characters.One of:
contains(Contains these characters),starts_with(Starts with these characters),exact(Exactly these characters). Default:contains. - Kinds of entry
entry_typeslist - Optional. Leave empty to include every kind.One or more of:
word(Words and phrases),name(People),place(Places). - How many
limitnumber - The most entries to return, between 1 and 500.From 1 to 500. Default:
50. - Characters used
scripttext - Search and show the dictionary in traditional characters, as it is held, or converted to simplified. Type your characters in the same form.One of:
traditional(Traditional characters (as the library holds them)),simplified(Simplified characters). Default:traditional.
Outputs
countnumber- How many entries are returned.
entrieslist- The matching entries, exact matches and shortest first.
total_foundnumber- How many entries matched in all.
Example output
{
"count": 3,
"entries": [
{
"entry_id": 3871,
"entry_type": "name",
"entry_type_label": "Person",
"headword": "\u5b54"
},
{
"entry_id": 1963,
"entry_type": "name",
"entry_type_label": "Person",
"headword": "\u5b54\u4e18"
},
{
"entry_id": 5179,
"entry_type": "name",
"entry_type_label": "Person",
"headword": "\u5b54\u4f0b"
}
],
"total_found": 14
}