Wikisource APIen.wikisource.org ↗
Access all 81 chapters of James Legge's 1891 Tao Te Ching translation via API. Retrieve individual chapters or the full text with chapter numbers and verbatim content.
What is the Wikisource API?
This API exposes the complete text of James Legge's 1891 translation of the Tao Te Ching (Tâo Teh King) from Wikisource, covering all 81 chapters across 2 endpoints. The get_chapters endpoint returns the full collection as a structured array, while get_chapter retrieves a single chapter by number, each response including the verbatim chapter text, chapter number, translator name, and publication source.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/c0559c61-11e2-4951-9f6e-4269e1acebac/get_chapters' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace en-wikisource-org-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Tao Te Ching API — fetch book metadata and read individual chapters."""
from parse_apis.en_wikisource_org_api import TaoTeChingAPI, InvalidChapterNumber
client = TaoTeChingAPI()
# Fetch the full book to see metadata and chapter listing
book = client.books.get()
print(f"{book.title} — translated by {book.translator}")
print(f"Source: {book.source}")
print(f"Total chapters: {book.total_chapters}")
# Browse the first 3 chapter summaries from the book
for summary in book.chapters[:3]:
print(f" Ch. {summary.chapter}: {summary.text[:60]}...")
# Navigate from a summary to its full detail via .details()
first_summary = book.chapters[0]
full_chapter = first_summary.details()
print(f"\nFull chapter {full_chapter.chapter}: {full_chapter.text[:120]}...")
# Direct point-lookup for a specific chapter by number
ch42 = client.chapters.get(chapter=42)
print(f"\nChapter {ch42.chapter}: {ch42.text[:100]}...")
# Handle an invalid chapter number gracefully
try:
client.chapters.get(chapter=99)
except InvalidChapterNumber as e:
print(f"\nExpected error for chapter 99: {e.message}")
print("\nexercised: books.get / ChapterSummary.details / chapters.get / InvalidChapterNumber")
Returns all 81 chapters of the Tao Te Ching in James Legge's translation. Each chapter includes the chapter number and full verbatim text. Makes a single request to Wikisource's API.
No input parameters required.
{
"type": "object",
"fields": {
"title": "Original title of the work (Tâo Teh King)",
"source": "Publication source and year",
"chapters": "Array of chapter objects each containing chapter number and full text",
"translator": "Translator name (James Legge)",
"total_chapters": "Total number of chapters (always 81)"
},
"sample": {
"data": {
"title": "Tâo Teh King",
"source": "Sacred Books of the East, Vol. 39 (1891)",
"chapters": [
{
"text": "The Tao that can be described is not the enduring and unchanging Tao. The name that can be named is not the enduring and unchanging name.\n(Conceived of as) having no name, it is the Originator of heaven and earth; (conceived of as) having a name, it is the Mother of all things.\nAlways without desire we must be found,\n\nIf its deep mystery we would sound;\n\nBut if desire always within us be,\n\nIts outer fringe is all that we shall see.\nUnder these two aspects, it is really the same; but as development takes place, it receives the different names. Together we call them the Mystery. Where the Mystery is the deepest is the gate of all that is subtle and wonderful.",
"chapter": 1
}
],
"translator": "James Legge",
"total_chapters": 81
},
"status": "success"
}
}About the Wikisource API
Endpoints and Response Fields
The get_chapters endpoint takes no inputs and returns the complete work in a single response. The chapters array contains 81 objects, each with a chapter number and the full verbatim text of that chapter. The top-level response also includes title (Tâo Teh King), source (Sacred Books of the East, Vol. 39, 1891), translator (James Legge), and total_chapters (always 81).
The get_chapter endpoint accepts a single required integer parameter, chapter, in the range 1–81. It returns chapter (the requested number), text (full verbatim chapter text), title, and translator. This is the appropriate endpoint when you need only one section — for example, rendering a specific chapter in a reading app or running text analysis on a single passage.
Source and Translation Notes
The text is Legge's translation as published in the Sacred Books of the East series, Vol. 39 (1891), hosted on Wikisource. The work is in the public domain. The API reflects that edition exactly — the chapter text matches the Wikisource-hosted version, including Legge's original spellings, annotations, and diacritical marks (e.g., Tâo, Teh). No modernized or alternate translations are included in this API.
The Wikisource API is a managed, monitored endpoint for en.wikisource.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when en.wikisource.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official en.wikisource.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a daily chapter reader app that fetches one chapter at a time using
get_chapterwith a rotating chapter number. - Run comparative textual analysis across all 81 chapters by pulling the full
chaptersarray fromget_chapters. - Populate a searchable database of classical philosophical texts with structured chapter-level records.
- Generate embeddings or semantic search indexes over Legge's translation using the verbatim
textfields. - Display chapter-by-chapter reading progress in a philosophy study tool, referencing
total_chaptersto track completion. - Integrate public-domain philosophical texts into an LLM fine-tuning dataset with clean chapter boundaries.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Wikisource have an official developer API?+
What exactly does `get_chapter` return for each chapter?+
get_chapter returns four fields: chapter (the integer you requested), text (the full verbatim chapter text from Legge's translation), title (Tâo Teh King), and translator (James Legge). It does not include footnotes, section headings within a chapter, or the original Chinese text.Does the API include the original Chinese text alongside the English translation?+
text field contains no Chinese characters or romanized Chinese source text. You can fork this API on Parse and revise it to add a parallel Chinese-text field if the Wikisource source page includes that content.