Translator

API key v1

Translate text between 46 languages.

Machine translation between any two supported languages. Send the text, the source language and the target language; the translated text comes back in data.text.

POST https://api.zactonz.com/translator/

Parameters

NameTypeDescription
keyrequired string

Your API key, repeated as a form field. Kept for existing integrations; the Authorization: Bearer header is the supported way to authenticate.

textrequired string

The text to translate.

from string

Source language code.

Default en
torequired string

Target language code.

Send parameters as application/x-www-form-urlencoded form fields in the request body.

Response

The translation.

FieldTypeDescription
status integer

200 on success, 400 on any failure.

data object
data.from string

Source language code that was used.

data.to string

Target language code.

data.text string

The translated text.

errors array of string

Present on failure only. Human-readable reasons.

Status codes

The outcome is reported in the JSON status field. See Errors & status codes for the general rules.

200 OK

Translated.

400 Rejected

Invalid key, a missing text or to, an unsupported language code, or the translation engine being unavailable. errors lists the reason.

Notes

Language codes are two-letter ISO 639-1 codes. Supported: en vi sq ar az bn bg ca zh zt cs da nl eo et fi fr de el he hi hu id ga it ja ko lv lt ms nb fa pl pt ro ru sk sl es sv tl th tr uk. zt is Traditional Chinese.

On failure the reply has status 400 and an errors array instead of data.