Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fdciabdul/google-translate-api

Free and Unlimited Google Translate API
https://github.com/fdciabdul/google-translate-api

Last synced: 12 days ago
JSON representation

Free and Unlimited Google Translate API

Awesome Lists containing this project

README

        

A **free** and **unlimited** API for Google Translate :dollar::no_entry_sign:

## Features

- Auto language detection
- Spelling correction
- Language correction

## Install

```bash
npm install gtranslate-api
```
or

```bash
yarn add gtranslate-api

```
## Usage

for automatic detection language:

``` js
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:

``` js
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

``` js
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](http://aqinshare.my.id)