Request Translation
Changed onTranslate one or more text strings into a target language. Send multiple strings in a single request, within the request size limit, and specify formatting, tag handling, and customization options such as glossaries, style rules, and translation memories.
Request
- Base URLhttps://api.deepl.com
- URLhttps://api.deepl.com/v2/translate
- AuthAPI key in header Authorization
Headers
An optional custom reporting tag used to attribute this request's usage to a team, project, customer, or other category of your choosing. Values are limited to 100 characters. See How to use custom reporting tags for validation rules, naming guidance, and how to retrieve usage by tag.
Request body
Example request
{
"text": [
"Hello, World!"
],
"source_lang": "EN",
"target_lang": "DE",
"context": "This is context.",
"split_sentences": "1",
"formality": "prefer_more",
"glossary_id": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7",
"glossary_ids": [
"def3a26b-3e84-45b3-84ae-0c0aaf3525f7"
],
"style_id": "7ff9bfd6-cd85-4190-8503-d6215a321519",
"translation_memory_id": "a74d88fb-ed2a-4943-a664-a4512398b994",
"translation_memory_threshold": 75,
"custom_instructions": [
"Use a friendly, diplomatic tone"
],
"style_profile_id": "3f1c9d0e-7a24-4b58-9c31-8f0e5d2a1b47",
"tag_handling": "html",
"non_splitting_tags": [
"non_splitting_tag"
],
"splitting_tags": [
"splitting_tag"
],
"ignore_tags": [
"ignore_tag"
]
}Response
The translate function returns a JSON representation of the translations in the order the text parameters have been specified.
Example response
{
"translations": [
{
"detected_source_language": "EN",
"text": "Hallo, Welt!",
"billed_characters": 42,
"model_type_used": "quality_optimized",
"tag_handling_version": "v2"
}
]
}Changes
- info
added the new optional
headerrequest parameterX-DeepL-Reporting-Tag - info
added the new optional request property
(media type: application/json) - info
added the new optional request property
(media type: application/x-www-form-urlencoded) - info
added the new
1enum value to the request property(media type: application/x-www-form-urlencoded) - info
added the media type
application/jsonfor the response with the status - info
added the media type
application/jsonfor the response with the status - info
added the media type
application/jsonfor the response with the status
- info