whatisgithub

What is chinese-poetry-api?

palemoky/chinese-poetry-api — explained in plain English

Analysis updated 2026-05-18

2,109GoAudience · developerComplexity · 2/5Setup · easy

In one sentence

A Go-based API that serves nearly 400,000 classical Chinese poems through REST and GraphQL, with simplified and traditional Chinese support.

Mindmap

mindmap
  root((chinese-poetry-api))
    What it does
      Serve classical poems
      REST API
      GraphQL API
      Language switching
    Tech stack
      Go
      Docker
      GraphQL
    Use cases
      Poetry search app
      Random poem widget
      Study tool
    Audience
      Developers
      Poetry enthusiasts

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Query a large database of classical Chinese poetry through a REST or GraphQL API

USE CASE 2

Build an app or study tool that displays random poems filtered by author or dynasty

USE CASE 3

Search poems by title, content, or author across nearly 400,000 entries

USE CASE 4

Self-host the poetry API using the published Docker image

What is it built with?

GoRESTGraphQLDocker

How does it compare?

palemoky/chinese-poetry-apicompozy/compozynvidia/aistore
Stars2,1092,0251,864
LanguageGoGoGo
Setup difficultyeasymoderatehard
Complexity2/53/55/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Cloning the full dataset requires the git submodules flag, Docker is the fastest way to run it.

So what is it?

chinese-poetry-api is a high performance web service, written in Go, that serves classical Chinese poetry through both a REST API and a GraphQL API. It gives programmatic access to a large collection of nearly 400,000 poems, covering Tang dynasty poems, Song dynasty lyrics, Yuan dynasty verse, and several other classical forms, all sourced from the existing chinese-poetry open dataset. A hosted version of the service is available online, and the project also runs as a Docker container you can deploy yourself. Every endpoint supports switching between simplified and traditional Chinese through a language parameter, since the same underlying data is stored to support both. The REST API includes routes for health checks, overall statistics, listing and searching poems, fetching a random poem with optional filters for author, dynasty, or poetic form, and browsing lists of authors, dynasties, and poem types with their details. Search can be scoped to titles, content, authors, or all fields at once. The GraphQL API exposes the same kind of data through queries for poems, search, and statistics, with paginated results. Setting it up is meant to be quick: running the published Docker image with a single command starts the server, or you can build it from source using the project's Makefile, which includes commands for building, processing the poetry data, and running the server. The poetry data itself is managed as a Git submodule, so cloning the repository with the recurse submodules flag pulls in the full dataset alongside the code. The service includes built in IP-based rate limiting to prevent abuse, and it is designed to run on multiple processor architectures through its container image. The project credits the chinese-poetry dataset as its data source and a library called gocc for simplified to traditional Chinese conversion. It is released under an open source license as indicated in the repository.

Copy-paste prompts

Prompt 1
Walk me through running chinese-poetry-api with docker run and hitting the health check endpoint
Prompt 2
Show me how to search for a poem by title using the REST API
Prompt 3
Explain how to write a GraphQL query that fetches poems in traditional Chinese
Prompt 4
How do I clone this repo including its Git submodule for the poetry data

Frequently asked questions

What is chinese-poetry-api?

A Go-based API that serves nearly 400,000 classical Chinese poems through REST and GraphQL, with simplified and traditional Chinese support.

What language is chinese-poetry-api written in?

Mainly Go. The stack also includes Go, REST, GraphQL.

How hard is chinese-poetry-api to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is chinese-poetry-api for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.