A multilingual REST API for structured dictionary data, built on kaikki.org's pre-processed Wiktionary JSONL exports.
The existing en.wiktionary.org/api/rest_v1/ is English-only and returns HTML blobs. This API serves clean JSON for words across 100+ languages, with support for multiple Wiktionary editions (en, fr, de, …).
Stack: Nitro v3 · SQLite (better-sqlite3) · TypeScript · VitePress docs
packages/
├── api/ # Nitro server — api.wiktapi.dev
└── docs/ # VitePress docs site — wiktapi.dev
vp installvp run @wiktapi/api#dev # http://localhost:3000
vp run @wiktapi/api#buildInteractive API explorer (Scalar) and raw OpenAPI spec are available at /_scalar and /_openapi.json in dev and production.
vp run @wiktapi/docs#dev # http://localhost:5173
vp run @wiktapi/docs#buildData is downloaded from kaikki.org (~monthly) and imported into a local SQLite database.
# 1. Download pre-processed JSONL from kaikki.org
vp run @wiktapi/api#download # English Wiktionary (~2.3 GB compressed)
vp run @wiktapi/api#download -- --editions en,fr,de # multiple editions
# 2. Import into SQLite
vp run @wiktapi/api#import # all data/jsonl/*.jsonl files
vp run @wiktapi/api#import -- --edition en # single edition
vp run @wiktapi/api#import -- --edition en --fresh # drop and recreate table firstThe database is written to packages/api/data/wiktionary.db. Override with the DATA_PATH env var.
All routes are under /v1/. See the interactive explorer for full request/response documentation.
GET /v1/editions
GET /v1/languages
GET /v1/{edition}/word/{word}
GET /v1/{edition}/word/{word}?lang={code}
GET /v1/{edition}/word/{word}/definitions
GET /v1/{edition}/word/{word}/translations
GET /v1/{edition}/word/{word}/pronunciations
GET /v1/{edition}/word/{word}/forms
GET /v1/{edition}/search?q={prefix}
GET /v1/{edition}/search?q={prefix}&lang={code}
| Parameter | Position | Meaning |
|---|---|---|
{edition} |
URL prefix | Which Wiktionary (en, fr, de …). Determines the gloss language. |
?lang= |
Query param | Filters to words belonging to a specific language. Optional. |
Example: GET /v1/en/word/Haus returns every language that has a word spelled "Haus", all with English definitions.
GET /v1/en/word/Haus?lang=de narrows to the German entry only.
cd packages/api
vp run build
DATA_PATH=/var/data/wiktionary.db node .output/server/index.mjsBuild the image (from the repo root):
docker build -t wiktapi .Run, mounting a directory that contains wiktionary.db:
docker run -p 3000:3000 -v /path/to/data:/data wiktapiThe container expects the database at /data/wiktionary.db by default. Override with -e DATA_PATH=... if your file is named or located differently.
To populate the database before the first run, use the data pipeline commands from the Data pipeline section, then point the volume at the directory containing the resulting wiktionary.db.