Unofficial DeepL API client for Go.
go get -u github.com/candy12t/go-deepl@latest
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"github.com/candy12t/go-deepl"
)
func main() {
authkey := os.Getenv("DEEPL_AUTH_KEY")
client := deepl.NewClient(authkey)
translatetext, err := client.TranslateText(context.Background(), []string{"Hello world"}, "JA", deepl.TranslateOption{SourceLang: "EN"})
if err != nil {
log.Fatal(err)
}
b, err := json.Marshal(translatetext)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(b))
}
- POST /v2/translate
- POST /v2/document
- POST /v2/document/{document_id}
- POST /v2/document/{document_id}/result
- GET /v2/glossary-language-pairs
- POST /v2/glossaries
- GET /v2/glossaries
- GET /v2/glossaries/{glossary_id}
- DELETE /v2/glossaries/{glossary_id}
- GET /v2/glossaries/{glossary_id}/entries
- GET /v2/usage
- GET /v2/languages
MIT License