Prerequisites
- A DeepL API account. Visit our plans page, choose a plan, and sign up. If you already have a DeepL Translator account, you need to log out and create a separate account for the API.
- Your API key, which you can find in your account settings. To learn more about keys, see Authentication.
curl, or one of the official client libraries for Python, JavaScript, PHP, C#, Java, or Ruby.
Building with an AI coding agent?
Wire it up to the DeepL Docs MCP Server so it can search and read this documentation while it writes code. In Claude Code:Step 1: Send your first translation request
A translation request needs only two parameters:text, the text to translate, and target_lang, the language you’re translating to. You don’t need to specify the source language. DeepL detects it and returns it in the response as detected_source_language. If your text is very short or mixes languages, you can pin the source with the optional source_lang parameter.
Language codes follow ISO 639, like DE for German or JA for Japanese, and are case-insensitive. Some target languages support regional variants, like en-US or pt-BR. See the full list of supported languages.
- cURL
- Python
- JavaScript
- PHP
- C#
- Java
- Ruby
Set the API key
Sample request
Sample response
Step 2: Translate multiple strings in one call
Thetext parameter is an array, so one request can carry many strings, like every notification in a template file. Each string is translated separately and the response preserves their order. If you don’t set source_lang, DeepL detects the language of each string individually.
Sample request
Sample response
translate_text methods you used in step 1.
The total request body is limited to 128 KiB. For anything larger, or for files whose formatting should be preserved, translate a document instead.
Next steps
You’ve now covered the core text translation workflow: single strings and batches. To keep going:- Translate entire files, formatting included, with the Translate Documents Quickstart
- Try requests with more parameters in our playground or Postman
- Improve translation quality for short or ambiguous text with the context parameter
- Choose between speed- and quality-optimized models with the
model_typeparameter, documented in the/translatereference - Translate into regional variants like
pt-BRwith the language variants guide - Enforce your terminology with glossaries
- Check usage and limits before going to production