Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing DeepL alternate translations

Tags:

json

vb.net

deepl

After hours of messing around with the DeepL API and HTTP, I finally managed to get a JSON response object for translation, but it contains only one translation in the JSON.

However, when I use the DeepL desktop application, and I enter a sentence that results in multiple alternative translations, if I then use the same sentence as an API call (REST) in my application, it only returns one translation.

I could have sworn that in my hours of playing around, I saw multiple translation JSON objects, but that doesn't seem to be the case anymore.

Is there an additional parameter you have to pass for alternatives?

Note - I am using the DeepL Free API version.

Thanks.

like image 361
ByteCarp Avatar asked Oct 12 '25 10:10

ByteCarp


1 Answers

The DeepL API does not currently offer translation alternatives, this feature is only available in the web translator and desktop apps.

The response JSON contains a translations array with one translation object per input. If you provide multiple input texts, the response will contain multiple translation objects; maybe this is what you remember. You can find documentation about the response here: https://www.deepl.com/docs-api/translating-text/response/

The free and paid API versions accept the same input parameters and provide the same responses. However the endpoint is different (api.deepl.com and api-free.deepl.com), and there are differences in usage limits and data security, see https://www.deepl.com/pro#developer

like image 79
Daniel Jones Avatar answered Oct 15 '25 13:10

Daniel Jones