All Projects → matheuss → Google Translate Api

matheuss / Google Translate Api

Licence: mit
A free and unlimited API for Google Translate 💵🚫

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Google Translate Api

Php Google Translate Free
PHP class to use the Google Translator API for free.
Stars: ✭ 182 (-90.88%)
Mutual labels:  api, google, translate
Trino
Trino: Master your translations with command line!
Stars: ✭ 118 (-94.09%)
Mutual labels:  api, google, translate
Google Translate
翻译工具 支持网页翻译和文本翻译
Stars: ✭ 356 (-82.16%)
Mutual labels:  api, google, translate
Google Translate
🈯 A Node.JS library to consume Google Translate API for free.
Stars: ✭ 152 (-92.38%)
Mutual labels:  api, google, translate
Mtrans
Multi-source Translation
Stars: ✭ 711 (-64.38%)
Mutual labels:  api, google, translate
Pi Hole Pivpn On Google Compute Engine Free Tier With Full Tunnel And Split Tunnel Openvpn Configs
Run your own privacy-first ad blocking service in the cloud for free on Google Cloud Services.
Stars: ✭ 1,141 (-42.84%)
Mutual labels:  google, free
Google Translator
Free Google Translator for Dart
Stars: ✭ 68 (-96.59%)
Mutual labels:  google, translate
Google Translate Api Browser
A free and unlimited API for Google Translate
Stars: ✭ 96 (-95.19%)
Mutual labels:  api, translate
Parse Google Docs Json
Authenticates with Google API and parse Google Docs to JSON or Markdown
Stars: ✭ 100 (-94.99%)
Mutual labels:  api, google
Texterify
The localization management system.
Stars: ✭ 37 (-98.15%)
Mutual labels:  api, translate
Searchconsoler
R interface with Google Search Console API v3, including Search Analytics.
Stars: ✭ 99 (-95.04%)
Mutual labels:  api, google
Esp V2
A service proxy that provides API management capabilities using Google Service Infrastructure.
Stars: ✭ 120 (-93.99%)
Mutual labels:  api, google
Google Search
scrape google search results
Stars: ✭ 62 (-96.89%)
Mutual labels:  api, google
Google Analytics Api Symfony
Google Analytics API Symfony Bundle
Stars: ✭ 43 (-97.85%)
Mutual labels:  api, google
Node Google Dfp
A service for integrating with Google DFP over NodeJS
Stars: ✭ 84 (-95.79%)
Mutual labels:  api, google
Intro To Apis Course
Introduction to APIs course
Stars: ✭ 1,009 (-49.45%)
Mutual labels:  api, free
Geeksay
🤓 geeks will ctrl+s the world!
Stars: ✭ 127 (-93.64%)
Mutual labels:  api, translate
Ng Gapi
ng-gapi a Google api module for Angular 6+
Stars: ✭ 126 (-93.69%)
Mutual labels:  api, google
Dynamictranslator
Instant translation application for windows in .NET 🎪
Stars: ✭ 131 (-93.44%)
Mutual labels:  google, translate
Alfred Polyglot
🈚️ Translate text using Google Translate in Alfred
Stars: ✭ 142 (-92.89%)
Mutual labels:  google, translate

google-translate-api Build Status XO code style Coverage Status Known Vulnerabilities

A free and unlimited API for Google Translate 💵🚫

Features

  • Auto language detection
  • Spelling correction
  • Language correction
  • Fast and reliable – it uses the same servers that translate.google.com uses

Install

npm install --save google-translate-api

Usage

From automatic language detection to English:

const translate = require('google-translate-api');

translate('Ik spreek Engels', {to: 'en'}).then(res => {
    console.log(res.text);
    //=> I speak English
    console.log(res.from.language.iso);
    //=> nl
}).catch(err => {
    console.error(err);
});

From English to Dutch with a typo:

translate('I spea Dutch!', {from: 'en', to: 'nl'}).then(res => {
    console.log(res.text);
    //=> Ik spreek Nederlands!
    console.log(res.from.text.autoCorrected);
    //=> true
    console.log(res.from.text.value);
    //=> I [speak] Dutch!
    console.log(res.from.text.didYouMean);
    //=> false
}).catch(err => {
    console.error(err);
});

Sometimes, the API will not use the auto corrected text in the translation:

translate('I spea Dutch!', {from: 'en', to: 'nl'}).then(res => {
    console.log(res);
    console.log(res.text);
    //=> Ik spea Nederlands!
    console.log(res.from.text.autoCorrected);
    //=> false
    console.log(res.from.text.value);
    //=> I [speak] Dutch!
    console.log(res.from.text.didYouMean);
    //=> true
}).catch(err => {
    console.error(err);
});

API

translate(text, options)

text

Type: string

The text to be translated

options

Type: object

from

Type: string Default: auto

The text language. Must be auto or one of the codes/names (not case sensitive) contained in languages.js

to

Type: string Default: en

The language in which the text should be translated. Must be one of the codes/names (not case sensitive) contained in languages.js.

raw

Type: boolean Default: false

If true, the returned object will have a raw property with the raw response (string) from Google Translate.

Returns an object:

  • text (string) – The translated text.
  • from (object)
    • language (object)
      • didYouMean (boolean) - true if the API suggest a correction in the source language
      • iso (string) - The code of the language that the API has recognized in the text
    • text (object)
      • autoCorrected (boolean)true if the API has auto corrected the text
      • value (string) – The auto corrected text or the text with suggested corrections
      • didYouMean (booelan)true if the API has suggested corrections to the text
  • raw (string) - If options.raw is true, the raw response from Google Translate servers. Otherwise, ''.

Note that res.from.text will only be returned if from.text.autoCorrected or from.text.didYouMean equals to true. In this case, it will have the corrections delimited with brackets ([ ]):

translate('I spea Dutch').then(res => {
    console.log(res.from.text.value);
    //=> I [speak] Dutch
}).catch(err => {
    console.error(err);
});

Otherwise, it will be an empty string ('').

Related

License

MIT © Matheus Fernandes

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].