yumixiaofu / Google-Translate-API

Free and Unlimited Google Translate API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A free and unlimited API for Google Translate 💵🚫

Features

  • Auto language detection
  • Spelling correction
  • Language correction

Install

npm install gtranslate-api

or 

```bash
yarn add gtranslate-api

Usage

for automatic detection language:

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

trans.getSentence('Aku orang indonesia', {to: 'en'}).then(res => {
console.log(res.translation);
//=> I am Indonesian
})

for specific language:

trans.getSentence('Aku orang indonesia!', {from: 'id', to: 'en'}).then(res => {
console.log(res.translation);
//=> I am Indonesian

})

it's also can get dictionary from translation

trans.getDictionary('Aku orang indonesia!', {from: 'id', to: 'en'}).then(res => {
console.log(res.translation);
//=> I am Indonesian

})

API

getSentence(text, options)

getDictionary(text, options)

License

MIT © Abdul Muttaqin

About

Free and Unlimited Google Translate API

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%