0

I am using DeepL API to translate text and it is working fine. But if there is more than 4000 characters, it returns status as error without translating data.

https://api.deepl.com/v2/translate?&target_lang=en&auth_key=<auth_key>&text=dummy text;

So I used DeepL Api with multiple text query strings but still same issue.

https://api.deepl.com/v2/translate?&target_lang=en&auth_key=<auth_key>&text=dummy text&text=dummy text&text=dummy text;

Is there any way to translate the long text using DeepL API.

  • 1
    As [the docs](https://www.deepl.com/docs-api/accessing-the-api/limits/) say: *"The request size should not exceed 30kbytes"*. One solution would be to split your text up and send them as seperate requests. – Reyno Jul 29 '21 at 07:19
  • Check out [Error handling](https://www.deepl.com/docs-api/accessing-the-api/error-handling/) for your specific error. My guess is a `414` error which tells you: *"The request URL is too long. You can avoid this error by using a POST request instead of a GET request."* – Reyno Jul 29 '21 at 07:22
  • @Reyno,You are right. I spilt the text using new line character at particular length and create new request for remaining text. It worked. Thank you so much – Kanchan Kumbhar Aug 02 '21 at 05:36

1 Answers1

0

As Reyno says, I grouped mine into groups of 1000 texts and sent them in.

Jeff Blumenthal
  • 442
  • 6
  • 8