Translation API, powered by Google Translate. With the API, you have the flexibility to choose between a comprehensive response, including alternate writing styles and alternative translations, or a simple output for quick and efficient language conversion.
Both endpoints expect the same payload, but the Translate returns a comprehensive result with synonyms and alternate writings, while Translate minified returns only the translated result.
Key | Type | Description | Is required | Example |
---|---|---|---|---|
input | String | The text you want to translate. | Yes | “input”: “Hello” |
outputLanguage | String | The language you want to translate to. | Yes | “outputLanguage”: “fr” |
inputLanguage | String | The language of the input, if not set, the API will get the language automatically. | No | “inputLanguage”: “en” |
{
"input": "Hello",
"outputLanguage": "fr"
}
“input”: “Hello” The word Hello will be translated.
“outputLanguage”: “fr” The output language.
{
"input": "Hello",
"inputLanguage": "en",
"outputLanguage": "fr"
}
“input”: “Hello” The word Hello will be translated.
“inputLanguage”: “en” We tell the translator, that the language of the input is english, useful if you have a word that exists in multiple languages.
“outputLanguage”: “fr” The output language.
You will receive a simple translation of your input in your desired output language.
In case of an error, the boolean hasError will be true and the array errors will contain the error messages.
Key | Type | Description | Example |
---|---|---|---|
input | String | Your input sentence or word. | “input”: “Hello” |
output | String | The translated sentence or word. | “output”: “Bonjour” |
hasError | Boolean | Boolean to check for errors. | false |
errors | Array | An array of error messages. | “errors”: [“Input (input) must be set”, “Output-language (outputLanguage) must be set”] |
{
"input": "Hello",
"output": "Bonjour",
"hasError": false,
"errors": []
}
{
"input": "",
"output": "",
"hasError": true,
"errors": [
"Input (input) must be set",
"Output-language (outputLanguage) must be set"
]
}
You will receive a translation of your input in your desired output language including alternatives and synonyms.
In case of an error, the boolean hasError will be true and the array errors will contain the error messages.
Key | Type | Description | Example |
---|---|---|---|
input | String | Your input sentence or word. | “input”: “Hello” |
inputLanguage | String | The language of your input. | “inputLanguage”: “en” |
inputDefinition | String | The definition of your input, only filled if a single word is provided. | “inputDefinition”: “used as a greeting or to begin a phone conversation.” |
inputAlternatives | Array[string] | Alternatives to your provided input. | “inputAlternatives”: [“good day”, “high day”] |
inputSynonyms | Array[string] | Possible synonyms to your provided input. | “inputSynonyms”: [“good day”, “high day”] |
output | String | The translated sentence or word. | “output”: “Bonjour” |
outputAlternatives | Array[String] | Alternatives to the output. | “outputAlternatives”: [“Salut”,“Bon sang”] |
outputLanguage | String | The language of the output. | “outputLanguage”: “fr” |
outputSynonyms | Array | Synonyms for the output language. | “outputLanguage”: “fr” |
outputSynonyms.inputs | Array[String] | Possible synonym inputs. | “inputs”: [“Hello!”, “Hi!” “Good morning!”] |
outputSynonyms.output | String | Output of the synonym inputs. | “output”: “Bonjour!” |
hasError | Boolean | Boolean to check for errors. | false |
errors | Array | An array of error messages. | “errors”: [“Input (input) must be set”, “Output-language (outputLanguage) must be set”] |
{
"input": "Hello",
"inputLanguage": "en",
"inputDefinition": "used as a greeting or to begin a phone conversation.",
"inputAlternatives": [],
"inputSynonyms": [],
"output": "Bonjour",
"outputAlternatives": [
"Salut",
"Bon sang"
],
"outputLanguage": "fr",
"outputSynonyms": [
{
"inputs": [
"Hello!",
"Hi!",
"Good morning!",
"Good afternoon!",
"How do you do?",
"Hallo!"
],
"output": "Bonjour!"
},
{
"inputs": [
"Hi!",
"Hello!",
"Salute!",
"All the best!",
"Hallo!",
"Hullo!"
],
"output": "Salut!"
},
{
"inputs": [
"Hallo!",
"Hello!",
"Hullo!",
"Why!"
],
"output": "Tiens!"
},
{
"inputs": [
"Hello!",
"Hullo!",
"Hallo!"
],
"output": "Allô!"
}
],
"hasError": false,
"errors": []
}
{
"input": "",
"inputLanguage": "auto",
"inputAlternatives": [],
"inputDefinition": "",
"inputSynonyms": [],
"output": "",
"outputAlternatives": [],
"outputLanguage": "",
"outputSynonyms": [],
"hasError": true,
"errors": [
"Input (input) must be set",
"Output-language (outputLanguage) must be set"
]
}