/translatelove

A Free and Open Source Machine Translation API

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

A Free and Open Source Machine Translation API

Translate.love is a free and open source machine translation API developed for translating any variety of text and documents in over 30 different languages. It provides a free-to-use API for real-time development and integration with applications in need of translation services. This project seeks to make translation services easy to access for anyone by providing a FOSS alternative.

API Examples

Simple

Request:

const res = await fetch("https://translate.love/translate", {
  method: "POST",
  body: JSON.stringify({
    q: "Hello!",
    source: "en",
    target: "es"
  }),
  headers: { "Content-Type": "application/json" }
});

console.log(await res.json());

Response:

{
    "translatedText": "¡Hola!"
}

Auto Detect Language

Request:

const res = await fetch("https://translate.love/translate", {
  method: "POST",
  body: JSON.stringify({
    q: "Ciao!",
    source: "auto",
    target: "en"
  }),
  headers: { "Content-Type": "application/json" }
});

console.log(await res.json());

Response:

{
    "detectedLanguage": {
        "confidence": 83,
        "language": "it"
    },
    "translatedText": "Bye!"
}

HTML (beta)

Request:

const res = await fetch("https://translate.love/translate", {
  method: "POST",
  body: JSON.stringify({
    q: '<p class="green">Hello!</p>',
    source: "en",
    target: "es",
    format: "html"
  }),
  headers: { "Content-Type": "application/json" }
});

console.log(await res.json());

Response:

{
    "translatedText": "<p class=\"green\">¡Hola!</p>"
}

Supported Languages

English, Arabic, Azerbaijani, Catalan, Chinese, Czech, Danish, Dutch, Esperanto, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Irish, Italian, Japanese, Korean, Persian, Polish, Portuguese, Russian, Slovak, Spanish, Swedish, Turkish, Ukranian

Credit

This translation API was only made possible through the LibreTranslate project. Please support their efforts here.