https://github.com/gilang-as/google-translate
A free and unlimited API for Google Translate Golang 💵 🚫
https://github.com/gilang-as/google-translate
go golang google-translate google-translate-api google-translate-free-api googletrans language translate translation translator
Last synced: 6 months ago
JSON representation
A free and unlimited API for Google Translate Golang 💵 🚫
- Host: GitHub
- URL: https://github.com/gilang-as/google-translate
- Owner: gilang-as
- License: mit
- Created: 2021-11-14T08:51:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-10-08T03:34:01.000Z (9 months ago)
- Last Synced: 2025-10-08T05:33:43.143Z (9 months ago)
- Topics: go, golang, google-translate, google-translate-api, google-translate-free-api, googletrans, language, translate, translation, translator
- Language: Go
- Homepage: https://gopkg.gilang.dev/google-translate
- Size: 39.1 KB
- Stars: 39
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# google-translate
[](https://github.com/gilang-as/google-translate/actions)
A **free** and **unlimited** API for Google Translate
Parts of the code are ported from [gtranslate](https://github.com/bregydoc/gtranslate) and [google-translate-api](https://github.com/matheuss/google-translate-api) (also MIT license).
## Features
- Auto language detection
- Spelling correction
- Language correction
- Fast and reliable – it uses the same servers that [translate.google.com](https://translate.google.com) uses
## Install
```
go get gopkg.gilang.dev/google-translate
```
## API
### Example
```go
package main
import (
"encoding/json"
"fmt"
gt "gopkg.gilang.dev/google-translate"
"gopkg.gilang.dev/google-translate/params"
)
func main() {
value := params.Translate{
Text: "Halo Dunia",
//From: "id",
To: "en",
}
translated, err := gt.TranslateWithParam(value)
if err != nil {
panic(err)
} else {
prettyJSON, err := json.MarshalIndent(translated, "", "\t")
if err != nil {
panic(err)
}
fmt.Println(string(prettyJSON))
}
}
```
### Returns an `object`:
- `text` *(string)* – The translated text.
- `pronunciation` *(string)* – The Pronunciation text.
- `from` *(object)*
- `language` *(object)*
- `did_you_mean` *(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)*
- `auto_corrected` *(boolean)* – `true` if the API has auto corrected the `text`
- `value` *(string)* – The auto corrected `text` or the `text` with suggested corrections
- `did_you_mean` *(boolean)* – `true` if the API has suggested corrections to the `text`
## License
MIT © [Gilang Adi S](https://github.com/gilang-as)