aphorisms
v0.1.0
Published
Source-verified bilingual (Korean/English) quotes. Zero dependencies, works offline.
Maintainers
Readme
Most quote APIs repeat the internet's favourite mistakes: Einstein never defined insanity, Gandhi never said "be the change", and Confucius has no idea who you are. aphorisms is a small, carefully curated dataset where each quote is
- bilingual — natural Korean and English side by side, plus the original wording (Latin, Greek, Classical Chinese, French…) when there is one,
- sourced — book, chapter, letter or speech, with a link to a public-domain copy when available,
- graded —
verified,attributedormisattributed, and the misattributions are kept as content, with their real origin explained.
One source of truth, three ways to use it: a free JSON API on Cloudflare Workers, a zero-dependency npm package that works offline, and raw JSON on jsDelivr.
Quick start
# A random quote (misattributed quotes are excluded unless you ask for them)
curl https://aphorisms.zotero-like-api.workers.dev/v1/random
# Quote of the day in Seoul, in Korean
curl "https://aphorisms.zotero-like-api.workers.dev/v1/today?tz=Asia/Seoul&lang=ko"npm install aphorismsimport { random, today } from 'aphorisms';
import * as ko from 'aphorisms/ko';
today({ timeZone: 'Asia/Seoul' }); // same quote for everyone in Seoul today
random({ tag: 'courage', verification: 'verified' });
ko.random()?.text; // e.g. "좋은 사람이란 어떠해야 하는지 더는 논하지 말고, 그런 사람이 되어라."<!-- No build step, no API: just the JSON -->
<script type="module">
const quotes = await fetch('https://cdn.jsdelivr.net/gh/jjh2613/aphorisms@main/dist/quotes.json').then((r) => r.json());
</script>Example response
// GET /v1/quotes/marcus-aurelius-be-a-good-man
{
"id": "marcus-aurelius-be-a-good-man",
"text": {
"ko": "좋은 사람이란 어떠해야 하는지 더는 논하지 말고, 그런 사람이 되어라.",
"en": "Waste no more time arguing what a good man should be. Be one."
},
"language": "grc",
"original": "Μηκέτι ὅλως περὶ τοῦ οἷόν τινα εἶναι τὸν ἀγαθὸν ἄνδρα διαλέγεσθαι, ἀλλὰ εἶναι τοιοῦτον.",
"author": { "id": "marcus-aurelius", "name": { "ko": "마르쿠스 아우렐리우스", "en": "Marcus Aurelius" }, "born": 121, "died": 180 },
"source": { "title": "Meditations", "type": "book", "locator": "Book 10, §16", "url": "https://www.gutenberg.org/ebooks/2680" },
"verification": "verified",
"note": {
"ko": "그리스어 판의 표준 번호 10권 16절이다. Gutenberg 판(카소봉 영역)에서는 같은 문장이 10권 XVIII절에 있다. 영문은 aphorisms의 번역이다.",
"en": "Standard Greek numbering: Book 10, §16. In the Gutenberg copy (Casaubon translation) the same sentence is numbered Book X, XVIII. The English is our own rendering."
},
"tags": ["virtue", "action", "character"]
}With ?lang=ko (or en) the bilingual fields collapse to plain strings: "text": "좋은 사람이란…", "author": { "name": "마르쿠스 아우렐리우스", … }, "note": "…".
Verification levels
| Level | Meaning | Served by default |
| --- | --- | --- |
| ✅ verified | Found in a primary source — the author's own book, letter, speech or a contemporaneous record. source.title and source.locator are always present. | Yes |
| 🟡 attributed | Widely credited and plausible, but no primary source has been located. note says what is known (e.g. earliest appearance). | Yes |
| ❌ misattributed | Commonly credited to author, but they didn't say it. note explains the real origin; source points to it when known. | Only when requested |
Misattributed quotes are deliberately included — "Einstein never said that" is useful information. They are excluded from random, today and list endpoints unless you pass verification=misattributed or verification=all, and GET /v1/quotes/:id always returns them with their grade.
API
Base URL: https://aphorisms.zotero-like-api.workers.dev — no key, no sign-up, CORS enabled (Access-Control-Allow-Origin: *).
| Endpoint | Description | Cache |
| --- | --- | --- |
| GET /v1/random | One random quote | no-store |
| GET /v1/today | Quote of the day — deterministic per calendar date in tz; no repeats until the pool is exhausted | 5 min |
| GET /v1/quotes | Paginated list | 1 h |
| GET /v1/quotes/:id | One quote by id (any grade) | 1 h |
| GET /v1/authors | All authors with quote counts | 1 h |
| GET /v1/authors/:id | An author and all of their quotes (any grade) | 1 h |
| GET /v1/tags | All tags with Korean/English labels and counts | 1 h |
| GET /v1/stats | Totals and grade distribution | 1 h |
Query parameters
| Parameter | Applies to | Example | Notes |
| --- | --- | --- | --- |
| lang | all quote endpoints | ko, en | Flatten bilingual fields to one language. Omit for both. |
| tag | random, today, quotes | courage,hope | Matches any of the comma-separated tags. |
| author | random, today, quotes | seneca,marcus-aurelius | Author ids. |
| verification | random, today, quotes | verified, misattributed, all | Default: verified,attributed. |
| q | random, today, quotes | time | Case-insensitive search in ko/en text and author names. |
| tz | today | Asia/Seoul | IANA time zone. Default UTC. |
| date | today | 2026-01-01 | Quote for a specific date (cached for 1 h). |
| page, limit | quotes | page=2&limit=50 | limit 1–100, default 20. |
Lists return { "data": [...], "meta": { "total", "page", "limit", "pages" } }. Errors return { "error": { "status", "message" } } with status 400 (bad parameter) or 404 (nothing found).
Fair use: the API is free and has no hard rate limit. If you need thousands of requests per minute, please use the npm package or the jsDelivr JSON instead — they're the same data.
npm package
npm install aphorisms # or pnpm add / yarn add / bun addZero dependencies, ESM + CommonJS, full TypeScript types, data bundled (works offline, in browsers, Workers, Deno and Bun).
import { quotes, random, today, getQuote, filter, authors, tags } from 'aphorisms';
random(); // Quote | undefined (verified + attributed)
random({ tag: ['love', 'friendship'] });
random({ verification: 'misattributed' }); // the fakes, with explanations
today(); // UTC calendar date
today({ timeZone: 'Asia/Seoul' });
today({ date: '2026-01-01' });
getQuote('marcus-aurelius-be-a-good-man');
filter({ author: 'seneca', verification: 'verified' });
filter({ q: '시간' });Single-language entry points return flattened LocalizedQuote objects (text: string, author.name: string, note?: string) with the same functions:
import { random, today } from 'aphorisms/ko'; // or 'aphorisms/en'Bring your own data or randomness with the pure helpers: filterQuotes, randomQuote(quotes, { rng }), todayQuote, localize, dateKey, createApi. The raw data is also exported as aphorisms/data.json.
Raw data
Generated files live in dist/ and are mirrored by jsDelivr:
| File | Contents |
| --- | --- |
| quotes.json | All quotes, bilingual |
| quotes.ko.json / quotes.en.json | Flattened per language |
| authors.json | Authors with counts |
| tags.json | Tags with labels and counts |
| stats.json | Totals |
Pin a release for stability: https://cdn.jsdelivr.net/gh/jjh2613/[email protected]/dist/quotes.json. The JSON Schema is at schema/quote.schema.json.
Contributing
The best contribution is one well-sourced quote. You don't need to know TypeScript — each quote is a small YAML file.
Fork the repo and run
pnpm install(Node 20+).Create a file:
pnpm new seneca-shortness-of-life→data/quotes/seneca-shortness-of-life.yaml.Fill it in:
id: seneca-shortness-of-life text: ko: 우리에게 주어진 시간이 짧은 것이 아니라, 우리가 그 많은 시간을 낭비하는 것이다. en: It is not that we have a short time to live, but that we waste a lot of it. language: la original: Non exiguum temporis habemus, sed multum perdidimus. author: id: seneca name: { ko: 세네카, en: Seneca } born: -4 died: 65 source: title: On the Shortness of Life (De Brevitate Vitae) type: essay locator: "1.3" verification: verified tags: [time, life]Run
pnpm validate— it checks the schema, tags, duplicates and that the author block matches other files.Open a pull request. Tell us where you checked the source (a link to the page in Project Gutenberg, Wikisource, Perseus, ctext.org, an archive scan…).
Grading rules of thumb — when in doubt, grade lower:
verifiedonly if you saw the words (or the original-language words) in the primary source yourself. Quote websites, social media and "quote of the day" pages are never sources.attributedif it's widely credited but you couldn't find the original. Say what you found innote.misattributedif there's evidence it's someone else's — explain the real origin innote. These are some of the most valuable contributions.- Write translations yourself (or use public-domain ones). Don't copy from Wikiquote, BrainyQuote or modern copyrighted translations.
Corrections are just as welcome as new quotes — found a better source, a wrong date, an awkward translation? Open an issue or a PR. See CONTRIBUTING.md and the full data guide.
| Field | Required | Description |
| --- | --- | --- |
| id | ✓ | kebab-case, equals the file name, never changes |
| text.ko, text.en | ✓ | The quote in Korean and English |
| language | ✓ | Original language (ISO 639: en, ko, la, grc, lzh, fr, de…) |
| original | | Original wording when language is not ko/en |
| author.id, author.name.ko/en | ✓ | Same block in every file of that author |
| author.born, author.died | | Years; negative = BCE |
| source.title, source.type | verified | type: book, essay, letter, speech, poem, play, diary, scripture, interview, article, collection, film, other |
| source.locator | verified | Chapter, section, letter number, act & scene, page… |
| source.year, source.url | | Year; https link to a public-domain copy |
| verification | ✓ | verified, attributed or misattributed |
| note.ko, note.en | unless verified | How we know |
| tags | ✓ | 1–5 tags from data/tags.yaml |
Development
pnpm install
pnpm validate # check data/quotes/*.yaml
pnpm build # data → dist/, npm package, worker bundle
pnpm test # validator, package and API tests
pnpm dev # local API at http://localhost:8787data/quotes/*.yaml source of truth (one quote per file)
data/tags.yaml allowed tags
schema/ JSON Schema
scripts/ validate, build, new
dist/ generated JSON (committed, served by jsDelivr)
packages/aphorisms/ npm package
apps/worker/ Cloudflare Worker (Hono)Releases: bump packages/aphorisms/package.json, then push a vX.Y.Z tag. CI publishes to npm (with provenance) and deploys the Worker.
License
- Code (everything outside
data/and generated data) — MIT - Data (
data/,dist/, and the data bundled in the npm package) — CC BY 4.0. Attribution: "aphorisms (github.com/jjh2613/aphorisms), CC BY 4.0".
The quotations themselves are from works in the public domain or are short excerpts quoted for reference; translations, notes and curation are by the aphorisms contributors.
