Google Translate

FREEMIUM
By googlecloud
Updated 4 months ago
Text Analysis
7.6/10
Popularity Score
607ms
Latency
100%
Success Rate

Google Translate API Documentation

Dynamically translate between languages.

View API Details
POSTdetect
POSTtranslate
POSTdetect

Detects the language of text within a request.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
qSTRING
REQUIREDThe input text upon which to perform language detection. Repeat this parameter to perform language detection on multiple text inputs.
Code Snippet
unirest.post("https://google-translate1.p.rapidapi.com/language/translate/v2/detect")
.header("X-RapidAPI-Host", "google-translate1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("q=English is hard, but detectably so")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://google-translate1.p.rapidapi.com/language/translate/v2/detect
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://google-translate1.p.rapidapi.com/language/translate/v2/detect")
.header("X-RapidAPI-Host", "google-translate1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("q=English is hard, but detectably so")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication