mrkeyoor.com_
Fri 14 Aug 16:49 UTC
Dataevaluationupdated 14 Aug 2026

chinese-poetry-api

Chinese Poetry API is a Go service for searching and serving a large collection of classical Chinese poems through REST and GraphQL. Its documentation is in Chinese and no English guide is provided. It packages the source corpus into a queryable service with simplified and traditional Chinese output, author and dynasty browsing, random selections, pagination, and IP rate limits.

Verdict

Chinese Poetry API is an excellent shortcut for prototypes and self-hosted cultural projects that need a real query layer over a huge Chinese corpus. The container story is simple, the API surface is sensible, and current development is healthy. Use it only after sampling the texts you care about, and put a proper gateway in front of it before exposing it publicly.

Setup4/5One Docker command, with an automatic first-start data download
Docs3/5Useful REST and GraphQL examples, but Chinese-only and incomplete
Community3/5Small queue with current maintainer replies and dependency work
Maturity3/5Versioned and deployable, but corpus accuracy needs scrutiny

Who it’s for

Developers building Chinese-language education, reading, search, quiz, or culture applications.
Teams that want a self-hosted REST or GraphQL layer instead of parsing the upstream poetry dataset directly.
Hobbyists who need random poems, author and dynasty indexes, or simplified and traditional Chinese variants.
Go developers willing to inspect Chinese documentation and validate corpus text for their use case.

Who it’s NOT for

Teams that require English setup and API documentation: the repository provides only a Chinese README and Chinese release notes.
Publishers, researchers, or educators who need editorially verified text: an open issue reports many character errors, and the maintainer attributes them to the poetry corpus.
Search products that must combine a keyword with a dynasty filter today: an open request confirms the search endpoint does not accept dynasty or dynastyId.
Public services expecting built-in identity, API keys, TLS, or user-level quotas: the documented controls are IP rate limits, while the sample container exposes a plain HTTP port.
Applications that need the service under a permissive license: the server code is GPL-3.0, so distribution and modification obligations need review.

Setup reality

The Docker path is close to the README's promise: run one image, expose port 1279, and let the startup script download the compressed database automatically. A persistent Docker volume keeps the data, and the image includes a health check. Production still needs a pinned image tag, a reverse proxy for TLS and access control, backups for the downloaded database, and deliberate rate-limit settings. Building from source is more involved because the repository uses a poetry-data Git submodule, CGO with SQLite FTS5, a Makefile data-processing step, and Go tooling. The online demo is useful for evaluation, but the README gives no service-level promise for depending on it.

A proper service around a famous open corpus

Chinese Poetry API turns the large chinese-poetry/chinese-poetry collection into something an application can query without loading and normalizing repository files itself. The v0.6.0 database contains 371,313 works, 13,577 authors, and 11 dynasties. Tang poetry, Song lyrics, Yuan songs, the Book of Songs, the Analects, and other material sit behind one Go server and an SQLite database.

The project is documented in Chinese, with no English README. That is understandable for a Chinese literature service, but it matters to international engineering teams. Endpoint names and code examples are easy to follow, while operational explanations, issue reports, and release notes require Chinese reading or translation. The API content itself is Chinese by design.

The value is straightforward. You can list poems, authors, dynasties, and forms; fetch individual records; search by title, content, or author; or request a random poem. Both simplified and traditional Chinese are stored in the same database and selected with a lang parameter. Applications do not have to perform conversion on every response.

REST and GraphQL cover the useful paths

The REST surface uses conventional /api/v1 routes and page controls. List and random endpoints share filters for author, dynasty, type, and even a required character, which is handy for poetry games such as Feihualing. Unknown query parameters produce a 400 response instead of being silently ignored, and page size is capped at 100. Those small decisions make client mistakes visible.

GraphQL exposes poems, search, authors, and aggregate statistics through a single endpoint. The default configuration keeps schema introspection enabled but disables the browser playground in release mode. A complexity limit and separate request limits provide basic protection. REST users get direct curl examples, while GraphQL users get a few representative queries rather than a complete schema reference. You may need introspection or source reading for less obvious relationships.

Search is useful but not fully composable. The documented modes cover all fields, title, content, and author. An open issue points out that keyword search cannot also filter by dynasty, forcing a client to filter later. The maintainer said they intended to implement the request when time allowed, but it remains open. Do not describe that as shipped or schedule a dependent feature around it.

Docker makes the first run pleasantly small

The recommended command starts the published image on port 1279. On first launch, its startup script downloads the compressed poetry database, so the container does not need a manual data preparation step. Docker Compose adds a named volume, restart policy, and environment file. The image supports amd64 and arm64, includes a health check, and uses a compact Alpine runtime.

That convenience comes with two practical wrinkles. First, deployment depends on downloading a release database. Keep the volume persistent, verify the published checksum if you handle the asset yourself, and avoid letting an unpinned latest image change unexpectedly. Second, the Compose example publishes the port on the host. The service documents no users, API keys, or TLS. Its defenses are IP-based rate limits, with defaults of 10 requests per second and a burst of 20. Put authentication, HTTPS, request logging, and stricter abuse controls in a reverse proxy when the API is not private.

Source builds demand more than the Docker quick start. The repository uses a Git submodule for the corpus, so clones need --recurse-submodules or a separate initialization command. The build uses CGO and SQLite FTS5, while make process-data prepares source data. None of this is unusual, but Docker is clearly the lower-risk route for consumers who do not plan to change ingestion.

Corpus size is not the same as editorial quality

The database is the project's biggest asset and its biggest caveat. It inherits material from the upstream Chinese Poetry dataset, then builds simplified and traditional tables for serving. A large collection is valuable for discovery and experimentation, but it should not be treated as a scholarly critical edition.

An open issue reports multiple wrong characters in search results. The maintainer replied that this is a poetry-quality problem and directed corrections toward a related data repository, with updates intended to flow back upstream. That response is honest, but it leaves consumers responsible for validation. A classroom app, citation tool, or published anthology should compare selected works against an authoritative edition. A random-poem widget has a much lower risk threshold.

Traditional conversion also deserves sampling. Automated conversion is convenient, yet names, historical variants, and literary wording can require context. The README claims very fast conversion, but because v0.6.0 stores both variants, normal API consumers should care more about textual correctness than nanoseconds.

Healthy development, modest support depth

The last push was August 3, 2026, about a month after the v0.6.0 release on July 4. The eight open GitHub items split into three issues and five pull requests. Recent pull requests cover dependency maintenance and cursor pagination, while the maintainer responded directly to the two substantive API and data reports. This is healthy activity for a focused project, though it is not a large support organization.

Documentation gives a strong quick tour but stops early. The README covers Docker, source commands, REST calls, GraphQL examples, search modes, language selection, and corpus composition. It does not document production topology, authentication, backups, error response shapes, schema evolution, or an English path. The config file is readable and exposes connection pools, rate limits, GraphQL controls, and search limits, which partly fills the gap.

Chinese Poetry API is the right starting point when you need a self-hosted Chinese poetry service today and can accept responsibility for text verification. It removes considerable ingestion and API work without becoming a large platform. Keep it behind a gateway, pin the deployment, and curate any poems that reach educational or published output.

Alternatives

ProjectWhat it isPick it when
Chinese Poetry DatasetThe underlying collection of Chinese poems and related classical texts as repository data.pick this instead when you can process static files yourself and do not need a running API.
PoetryDBA REST-oriented poetry database focused on English-language works and authors.pick this instead when your application needs English poetry rather than a Chinese corpus.
PocketBaseA small self-hosted backend that can expose an imported, curated collection through APIs.pick this instead when you need authentication and editable records and can build the poetry schema yourself.

What people are saying

  1. [github-trending] palemoky/chinese-poetry-api

Sources

  1. Chinese Poetry API README
  2. Chinese Poetry API v0.6.0
  3. Poetry text quality issue
  4. Dynasty search filter request
  5. Default service configuration