3.4K ·GitHub
What is this?
A high-performance API service for Chinese classical poetry written in Go, exposing both REST and GraphQL endpoints over a dataset of nearly 400,000 poems spanning Tang poetry, Song lyrics, Yuan qu and more.
Is this a library I embed, or a standalone server I deploy?
It's a standalone server you deploy yourself (via Docker or a Go build), not a library you import into your own code.
How do I get it running?
Clone the repo with Git submodules to pull in the poetry data, then run it with Docker Compose (recommended, config in docker-compose.yml) or build/run it via the included Makefile.
Do I need to fetch the poetry data separately?
Yes, the actual poems live in a separate submodule repo (a fixed-typo fork of chinese-poetry), so you must clone with submodules or run a submodule update if you already cloned without them.
Is there anything limiting how much I can query it?
Yes, it has built-in per-IP rate limiting specifically to prevent abuse of the public API.
Does the Docker image work on ARM servers, or only x86?
The Docker image is multi-arch, supporting both amd64 and arm64.
How big is the poetry dataset?
Roughly 400,000 entries, including 82,744 seven-character jueju, 68,696 seven-character lushi, 21,347 Song ci, 10,904 Yuan qu, plus the Book of Songs, Chu Ci and more.
What kinds of search does the API support?
Full-text search by default (?q=月), plus dedicated title, content, and author search modes via the type parameter.
Can I get results in both Simplified and Traditional Chinese?
Yes, every endpoint accepts a lang parameter (zh-Hans or zh-Hant) to switch between Simplified and Traditional Chinese, both stored in the same database.
How fast is the Simplified/Traditional conversion?
The conversion is optimized for concurrency and runs at about 300ns per operation, using the gocc library.
What are similar projects?
tyk, zincsearch, typesense, pansou, reaction, dgraph, cube, claude-relay-service
Which topics is it in?
rate-limiting, full-text-search, arm64, chinese-language, graphql, dataset, search, i18n, docker-compose, rest-api, backend, gplv3