TranslaQEDevelopers

Translate text

Translate sentences, post-edit translations you already have, adapt the engine to your terms and read the quality score.

POST /v1/translate translates sentences and answers in the same request. Use it for text you hold in your own system: a product sheet, a support ticket, a string of your app. For whole files, see Translate documents.

Sentences, not texts

The API works sentence by sentence: each item of segments is one sentence, and each one gets its own translation and its own score. Split your text into sentences before sending it, and put the translations back together in the same order.

Limit Value
Sentences per request 50
Characters per sentence 2,000
Characters per request 10,000

The request is all or nothing. If no model gives a valid translation for some sentence, the answer is 422 with the type translation-failed, and errors says which ones (segments.3). Sending the same request again gives the same result: remove or change those sentences.

Make it translate your way

Out of the box the engine gives a good general translation. These fields make it yours:

  • memory_ids: translation memories you have saved. A sentence that is already in a memory comes from there, not from the engine, and close matches guide the translation.
  • glossary_ids: saved glossaries. Their terms are applied, and each segment says which ones in applied_terms.
  • glossary: terms for this request only, without saving them.
  • instructions: style in plain words, up to 2,000 characters: "British English. Formal register. Do not translate product names." They take precedence over glossaries and memories.
  • project_id: a project, to use all its memories and glossaries for this language pair at once.
curl https://api.translaqe.com/v1/translate \
  -H "Authorization: Bearer $TRANSLAQE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_lang": "es",
    "target_lang": "en",
    "segments": ["El preaviso será de 30 días."],
    "memory_ids": ["tm_5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d"],
    "glossary_ids": ["gl_3f9a1c2b7d5e4f60a1b2c3d4e5f60718"],
    "glossary": [{"source": "preaviso", "target": "notice period"}],
    "instructions": "British English. Formal register."
  }'

Memories and glossaries must cover the language pair of the request, and you can name up to 20 of each.

Post-edit a translation you already have

Send a segment as {source, target} instead of a string and the engine corrects what is wrong in your translation and leaves the rest alone. The segment comes back with status: "post_edited", changed (whether anything was touched) and explanation (what was corrected).

{
  "source_lang": "es",
  "target_lang": "en",
  "segments": [
    {
      "source": "Se aplicará la tarifa vigente en el momento del pedido.",
      "target": "It will apply the tariff in force in the moment of the order."
    }
  ]
}

Read each segment

Field What it tells you
target The translation.
score Quality from 0 to 100; null if there is no score.
band fiable (85 or more), revisar (60 to 84), rehacer (under 60) or sin-nota.
origin engine, or memory if it came from one of your memories.
status translated, post_edited, matched (from a memory), repeated (you had already translated it: reused) or untranslatable (nothing to translate).
applied_terms The glossary terms that were applied.
checks What the automatic checks found: a number that differs, a formatting mark missing, a term not applied, a text left untranslated.

A common rule: publish fiable as it is, send revisar to a reviewer and translate rehacer again, or post-edit it.

To translate without scoring, send qe: false. It is a little faster, and every segment comes back with score: null.

Score translations you already have

POST /v1/qe scores translations made by any engine or by people, up to 100 per request, without needing a reference translation. Scoring does not use up characters of your plan.

curl https://api.translaqe.com/v1/qe \
  -H "Authorization: Bearer $TRANSLAQE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_lang": "es",
    "target_lang": "en",
    "items": [
      {
        "source": "Se aplicará la tarifa vigente en el momento del pedido.",
        "target": "It will apply the tariff in force in the moment of the order."
      }
    ]
  }'

Languages

GET /v1/languages lists the languages you can translate from and into. Those with qe: true have validated quality scores; the rest are translated too, with the band sin-nota. Language codes are BCP 47: es, en, pt-BR, zh-Hans.

What counts against your plan

The characters of the source sentences you translate. Scoring with /v1/qe does not count. GET /v1/plan says what you have left; when it is not enough for a request, the answer is 402 with the type quota-exceeded.