Google Translate API

FREEMIUM
By Patrick | Updated 7 days ago | Translation
Popularity

7 / 10

Latency

413ms

Service Level

100%

Health Check

100%

README

Table of content

  • 1 Introduction
  • 2 Request-Body
    • 2.1 Request-Body Table
    • 2.2 Basic request
    • 2.3 Advanced request
  • 3 Response-Body minified
    • 3.1 Response-Body Table
    • 3.2 Example responses
      • 3.2.1 Successful example responses
      • 3.2.2 Failed example response
  • 4 Response-Body
    • 4.1 Response-Body Table
    • 4.2 Example responses
      • 4.2.1 Successful example responses
      • 4.2.2 Failed example response

1 Introduction

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.

2 Request-Body

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.

2.1 Request-Body Table

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”

2.10 Basic request

Example

{
    "input": "Hello",
    "outputLanguage": "fr"
}

Description

“input”: “Hello” The word Hello will be translated.

“outputLanguage”: “fr” The output language.

2.11 Advanced request

Example

{
    "input": "Hello",
    "inputLanguage": "en",
    "outputLanguage": "fr"
}

Description

“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.

3 Response-Body minified

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.

3.1 Response-Body Table

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”]

3.2 Example response

3.2.1 Successful example response

{
  "input": "Hello",
  "output": "Bonjour",
  "hasError": false,
  "errors": []
}

3.2.2 Failed example response

{
  "input": "",
  "output": "",
  "hasError": true,
  "errors": [
    "Input (input) must be set",
    "Output-language (outputLanguage) must be set"
  ]
}

4 Response-Body

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.

4.1 Response-Body Table

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”]

4.2 Example response

4.2.1 Successful example response

{
  "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": []
}

4.2.2 Failed example response

{
  "input": "",
  "inputLanguage": "auto",
  "inputAlternatives": [],
  "inputDefinition": "",
  "inputSynonyms": [],
  "output": "",
  "outputAlternatives": [],
  "outputLanguage": "",
  "outputSynonyms": [],
  "hasError": true,
  "errors": [
    "Input (input) must be set",
    "Output-language (outputLanguage) must be set"
  ]
}
Followers: 1
API Creator:
Rapid account: Patrick
Patrick
Pat92
Log In to Rate API
Rating: 5 - Votes: 1