18

Is there any possibility to find out if the DeepL translator offers an API for the translation? Unfortunately I haven't found any information on this.

Would like to implement this to an Excel script for auto translation. I've already tried it with Google (like https://translate.google.com/#en/es/Hello%20World) but DeepL seems more accurate.

clemens
  • 16,716
  • 11
  • 50
  • 65
dontbyteme
  • 1,221
  • 1
  • 11
  • 23
  • 8
    An API will come in few months. See the press release: https://www.deepl.com/press.html – clemens Aug 29 '17 at 11:34
  • @macmoonshine this is great, thank you for the information – dontbyteme Aug 31 '17 at 06:50
  • @dontbyteme The quality of these machine-learning based services improve over time, as the model's training progresses. You may try again Google's feature and see if there is a difference. It may be worthwhile checking the excellent answer by Nicholas to the "How can I use Google Translate API to Translate text in Microsoft Excel" question: https://stackoverflow.com/questions/41671778/how-can-i-use-google-translate-api-to-translate-text-in-microsoft-excel – George Sep 01 '17 at 14:53

3 Answers3

16

The REST API is finally (commercially) available, see the API reference documentation.

A sample request would be

https://api.deepl.com/v1/translate?text=Hello%20World!&target_lang=EN&auth_key=XXX

where XXX is the authentication key you need to register with DeepL.

clemens
  • 16,716
  • 11
  • 50
  • 65
dontbyteme
  • 1,221
  • 1
  • 11
  • 23
15

There is a POST call that allows you get the translations, I don't know how many time this will be supported or it's times limitations but here it is:

Url: https://www.deepl.com/jsonrpc

You should make a POST call with the next json:

{
        'jsonrpc': '2.0',
        'method': 'LMT_handle_jobs',
        'params': {
            'jobs': [
                {
                    'kind':'default',
                    'raw_en_sentence': TEXT_TO_TRANSLATE
                }
            ],
            'lang': {
                'user_preferred_langs': [
                    FROM_LANGUAGE,
                    TO_LANGUAGE
                ],
                'source_lang_user_selected': FROM_LANGUAGE,
                'target_lang': TO_LANGUAGE
            },
            'priority': -1
        },
}

The available languages are:

auto  Auto detect
DE    German
EN    English
FR    French
ES    Spanish
IT    Italian
NL    Dutch
PL    Polish

TO_LANGUAGE must be a valid language and FROM_LANGUAGE can be a valid language or auto

I wrote a python module that wraps this API: pydeepl There are currently also a node package and a php client that accomplish the same goal.

EmilioK
  • 380
  • 4
  • 10
  • 4
    Thanks for this great insights. :) - The node-package is cool but has too many dependencies for my taste. I have come across another much leaner package. [deepl-translator](https://www.npmjs.com/package/deepl-translator) – Dave Gööck Sep 13 '17 at 21:22
  • 1
    This code seems not working now. deepl server send `429 Too many requests` back. – einverne Apr 23 '20 at 05:07
0

There is a free DeepL API, but you need to register and an important point is that they ask your credit card number:

"We need your credit card information in order to prevent misuse of our free API, in particular to prevent fraudulent multiple registrations. Your credit card won't be charged unless you manually upgrade to DeepL API Pro."

vmagnin
  • 165
  • 6