Skip to content

bounoable/deepl

Folders and files

NameName
Last commit message
Last commit date
Feb 14, 2021
Nov 18, 2020
Dec 18, 2024
Dec 18, 2024
Nov 19, 2020
Dec 18, 2024
Feb 15, 2021
Dec 18, 2024
Dec 18, 2024
Nov 16, 2020
Sep 17, 2021
Dec 18, 2024
Dec 18, 2024
Nov 19, 2020
Dec 18, 2024
Nov 16, 2020
Apr 15, 2022
Apr 15, 2022
Oct 10, 2024
Dec 18, 2024
Dec 18, 2024
Nov 16, 2020
Dec 18, 2024
Apr 15, 2022

Repository files navigation

DeepL Pro API client

PkgGoDev

Client library for the DeepL Pro API.

Installation

go get github.com/bounoable/deepl

Usage

See the examples.

import (
  "github.com/bounoable/deepl"
)

client := deepl.New("your-auth-key")

translated, sourceLang, err := client.Translate(
  context.TODO(),
  "Hello, world",
  deepl.Chinese,
)
if err != nil {
  log.Fatal(err)
}

log.Println(fmt.Sprintf("source language: %s", sourceLang))
log.Println(translated)

Testing

You can test the library against the real DeepL API by running the following command.

CAUTION: Runnning these tests will add to your usage and therefore will be billed!

make e2e-test authKey=YOUR_AUTH_KEY

License

MIT