zumbov2 / deeplr

An R wrapper for the DeepL Translator API
Other
38 stars 4 forks source link

deeplr broken with new api lincenses. api-link must be updated. #3

Closed CubicTom closed 3 years ago

CubicTom commented 3 years ago

Having had to switch to the new DeepL API license plan this year, deeplr does not accept my new auth_key.

> translate_vec(text = c("Dies ist ein Test."), source_lang = "DE", target_lang = "EN",
+              auth_key = deepl_auth_key)
Fehler in response_check(response) : 
  Please supply a valid auth_key parameter. (HTTP error 403)

This seems connected to the version of DeepL's API that deeplr uses (v1):

Please note that:

  • Version 1 (v1) of the DeepL API is not supported by the DeepL API plan available from October 2018. Please use version 2 for all new products other than CAT tool integrations.
  • Version 2 (v2) of the DeepL API is not compatible with CAT tools and is not included in DeepL plans for CAT tool users. If you intend to integrate DeepL Pro into a CAT tool or another tool assisting translation, please contact support@DeepL.com

Currently, the two DeepL API versions differ only in the URL used for access. (Source: https://www.deepl.com/docs-api/accessing-the-api/api-versions/)

Example Request for the new api:

curl https://api.deepl.com/v2/usage?auth_key=[yourAuthKey]

Could you please update the URL used by deeplr to access the DeepL API and thus make deeplr compatible with the new license plans? Thanks a lot in advance.

zumbov2 commented 3 years ago

Hey @CubicTom. Please excuse my late reply. I have just updated the package (version 2.0.0). Please note that some functions have changed slightly. translate_vec no longer exists, but translate and translate2 are now fully vectorized. Hope it helps.

CubicTom commented 3 years ago

Hi @zumbov2, thanks, that's highly appreciated! Keep up the good work!