Skip to content

DeepL translation stopped working: Mandatory API update required (March 2025) #304

@voothi

Description

@voothi

Description
A few days ago, the DeeplTranslator started failing with an AuthorizationException, even when using a valid API Key.

Traceback

Query error: The program has returned exit code 1.
Traceback (most recent call last):
  File "translate_deepl.py", line 31, in <module>
    result = translator.translate(args.text)
  File "deep_translator\deepl.py", line 87, in translate
    raise AuthorizationException(self.api_key)
deep_translator.exceptions.AuthorizationException: Unauthorized access with the api key ...

Cause
This issue is caused by the DeepL API breaking changes (effective March 2025) which have deprecated:

  1. GET requests for translation (now requires POST).
  2. The auth_key query parameter (now requires Authorization header).

Reference
DeepL Breaking Changes Notice

Proposed Solution
The DeeplTranslator.translate method needs to be updated to use requests.post and send the API key via the Authorization: DeepL-Auth-Key [KEY] header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions