← Back to translator

Kabyle Translation Hub — API Docs

Base URL: http://boffire-kabyle-multi-translate.hf.space

POST/api/translate

Translate English text using MarianMT, LibreTranslate variants, or both. Also accepts GET for quick testing.

Request body (JSON):

FieldTypeRequiredDescription
textstringyesEnglish text to translate
enginesarraynoSubset of ["marian", "libre"]. Defaults to both.
variantsarraynoSubset of LibreTranslate variant codes (see /api/variants). Defaults to all.

Example (curl):

curl -X POST "http://boffire-kabyle-multi-translate.hf.space/api/translate" \
  -H "Content-Type: application/json" \
  -d '{"text": "Good morning", "engines": ["marian", "libre"]}'

Example (GET, quick testing):

curl "http://boffire-kabyle-multi-translate.hf.space/api/translate?text=Good+morning&engines=marian,libre"

Example (JavaScript fetch, from a browser):

const res = await fetch("http://boffire-kabyle-multi-translate.hf.space/api/translate", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ text: "Good morning", engines: ["marian", "libre"] })
});
const data = await res.json();
console.log(data);

Example response:

{
  "source_text": "Good morning",
  "marian": ["Azul igerrzen", "Ssbeh yelhan", "Aseb yelhan"],
  "libre": {
    "Taqbaylit (Standard)": {"code": "kab", "success": true, "text": "Tifawin"},
    "Taqbaylit (51000)": {"code": "kab_comp2", "success": true, "text": "Azul"}
  }
}

GET/api/variants

Returns the full list of supported LibreTranslate Kabyle variant names and codes.

curl "http://boffire-kabyle-multi-translate.hf.space/api/variants"

GET/health

Basic health check. Returns whether the MarianMT model has been loaded into memory yet.

curl "http://boffire-kabyle-multi-translate.hf.space/health"

CORS

All /api/* routes send permissive CORS headers, so you can call this API directly from browser-based JavaScript (fetch, axios, etc.) on any origin — no proxy needed.