For developers

We provide access to the API for integration translation system in your projects. The system automatically improves with each subsequent query. The cost of using API Multillect is calculated based on the number of characters in a query. Price: $5 per 1000000 symbols.

Text translation is carried out by sending an HTTP request at https://api.multillect.com/translate/json/1.0/<account-id>, where <account-id> — is a unique identifier for a customer account.

Acceptable methods: GET and POST.
Answer type: JSON
Answer encoding: UTF-8

Query options:

Parameter Compulsive Description
method yes Has to be "translate/api/translate"
from no Source language. If this parameter is not present, Multillect attempts to detect the source language automatically. The result of determining the language returns in the "language" in answer.
to yes Target language
text yes Text for translation in UTF-8 (text length must be at least 2 characters)
politeness no Switching formal/informal form of conversation
   
Value
Description
polite Formal
rude Informal
gender_from no Speaker's gender
   
Value Description
male Male
female Female
gender_to no Interlocutor's gender (see gender_from)
sig yes Secret key

List of supported languages:

Language Code
Arabic ar
Chinese zh
English en
Farsi (Persian) fa
French fr
German de
Hindi hi
Japan ja
Korean ko
Polish pl
Russian ru
Spanish es
Turkish tr
Ukrainian uk

Answer

Response is a JSON-object with such properties:

Property Description
result Contains an object with the result of the operation, or "null" in the case of error
 
Property
Description
translated Translation result
language The result of determining the language
politeness Automatically defined form of treatment (polite or impolite). See query parameter "politeness".
error Contains an object that describes the error or "null" if successful
 
Property Description
code Error code
message Error text

Example 1 (translation en->ru)

GET https://api.multillect.com/translate/json/1.0/2711024?method=translate/api/translate&from=en&to=ru&text=test&sig=38f4c080a05411e6a0328c89a5a1fd3

{
    "result": {
        "translated": "тест",
        "language": {
            "code": null
        }
    }
    "error": null,
    "timestamp": 1478019472,
    "id": null
}

Example 2 (language detection)

GET https://api.multillect.com/translate/json/1.0/2711024?method=translate/api/translate&to=ru&text=test&sig=38f4c080a05411e6a0328c89a5a1fd3

{
    "result": {
        "translated": "тест",
        "language": {
            "code": "en"
        }
    }
    "error": null,
    "timestamp": 1478019472,
    "id": null
}

Example 3 (wrong situation)

GET https://api.multillect.com/translate/json/1.0/2711024?method=translate/api/translate&from=en&to=ru&text=&sig=38f4c080a05411e6a0328c89a5a1fd3

{
    "result": null,
    "error": {
        "code": 15,
        "message": "Too short text for translation"
    },
    "timestamp": 1478022138,
    "id": null
}

Example 4 (definition of the treatment form)

GET https://api.multillect.com/translate/json/1.0/2711024?method=translate/api/translate&from=ru&to=en&text=Вы%20великолепны&politeness=&sig=38f4c080a05411e6a0328c89a5a1fd3

{
  "result": {
    "translated": "You are magnificent",
    "language": {
      "code": "ru"
    },
    "politeness": "polite"
  },
  "error": null,
  "timestamp": 1478284482,
  "id": null
}