A free and unlimited API for Google Translate 💵🚫

Features

  • Auto language detection
  • Spelling correction
  • Language correction

Install

npm install @fdciabdul/google-translate-api

or

yarn install @fdciabdul/google-translate-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

GitHub

View Github