API for developers
The dictionary and the conjugator are open: build them into your site, app or bot. Answers are JSON, no key is needed, and requests are allowed from any domain (CORS).
Quick start
curl https://langsite.tail828a5c.ts.net/api/v1/words/anar
curl "https://langsite.tail828a5c.ts.net/api/v1/words?q=casa&lang=en,uk"
curl https://langsite.tail828a5c.ts.net/api/v1/conjugations/parlar
const res = await fetch('https://langsite.tail828a5c.ts.net/api/v1/conjugations/anar');
const { data } = await res.json();
console.log(data.moods.indicatiu.present); // [{person: '1s', form: 'jo vaig'}, …]
Endpoints
GET /words | Search and list words. Parameters: q, lang, topic, level, part_of_speech, variety, page, per_page (up to 100). |
GET /words/{slug} | One word: translations, example, level, topic, regional marks. |
GET /conjugations/{verb} | Every tense and mood of a verb, reflexive ones too (rentar-se). |
GET /verbs?q=par | Verbs starting with these letters (for autocomplete). |
GET /languages | Translation languages and how many words each has. |
GET /dictionary.csv | The whole dictionary as one CSV file, in every language. |
Base address: https://langsite.tail828a5c.ts.net/api/v1.
Full description in OpenAPI format: openapi.json.
Example answer
{
"data": {
"term": "anar",
"language": "ca",
"part_of_speech": "verb",
"level": "A1",
"example": "Vaig a la feina.",
"translations": {
"en": {"translation": "go (on foot, by transport)", "example": "I’m going to work.", "notes": null},
"uk": {…}
},
"conjugation": "https://langsite.tail828a5c.ts.net/api/v1/conjugations/anar",
"url": "…/dictionary/anar"
}
}
Languages
The lang parameter picks the translation languages, e.g. lang=fr,uk; without it you get all of them.
Codes:
uk (Ukrainian), en (English), fr (French), it (Italian), es (Spanish), pl (Polish), de (German), ar (Arabic), zh (Chinese).
Languages without translations yet will appear in the answers as soon as they are added.
Rules
- Up to 120 requests a minute from one address. Beyond that the answer is 429 with a Retry-After header.
- Answers may be cached: they change rarely (Cache-Control: 1 hour).
- Please credit the source with a link to Learn Catalan.
- Errors look like
{"error": {"code": "…", "message": "…"}}.
Data sources
- Regional labels on words come partly from Wiktionary (English and Catalan editions), licensed CC BY-SA 4.0.
- The choice of words and verbs drew on the FrequencyWords list (Hermit Dave) from the OpenSubtitles 2018 corpus, licensed CC BY-SA 4.0.
- Conjugations are built by the verbecc library (LGPL-3.0) from Verbiste and catverbs data with our corrections; that data is under GPL-2.0-or-later.
- Synonyms on the Text page come from the Softcatalà thesaurus (sinonims-cat), licensed CC BY 4.0.
- Unchecked Ukrainian translations of words are derived through English and Spanish from Wiktionary data (kaikki.org), licensed CC BY-SA 4.0.
- Spanish translations of words come from the open Spanish-Catalan dictionary of Apertium (apertium-spa-cat), licensed GPL-2.0.
- Words marked DACCO and the DACCO entries on word pages come from the open Catalan-English dictionary DACCO (Diccionari Obert Català de Codi Obert, editor Dr Linda Oxnard and contributors), licensed LGPL-2.1 (repository) / CC BY-SA 2.5 (PDF).
- If you publish this data, credit these sources too. The API root lists them as well.