Skip to main content
POST
/
v2
/
translate
Request Translation
curl --request POST \
  --url https://api.deepl.com/v2/translate \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "text": [
    "Hello, World!"
  ],
  "source_lang": "EN",
  "target_lang": "DE",
  "context": "This is context.",
  "show_billed_characters": true,
  "split_sentences": "1",
  "preserve_formatting": false,
  "formality": "prefer_more",
  "model_type": "quality_optimized",
  "glossary_id": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7",
  "style_id": "7ff9bfd6-cd85-4190-8503-d6215a321519",
  "tag_handling": "html",
  "tag_handling_version": "v1",
  "outline_detection": true,
  "enable_beta_languages": false,
  "non_splitting_tags": [
    "non_splitting_tag"
  ],
  "splitting_tags": [
    "splitting_tag"
  ],
  "ignore_tags": [
    "ignore_tag"
  ]
}'
{
  "translations": [
    {
      "detected_source_language": "EN",
      "text": "Hallo, Welt!",
      "billed_characters": 42,
      "model_type_used": "quality_optimized"
    }
  ]
}

Authorizations

Authorization
string
header
required

Body

text
string[]
required
target_lang
enum<string>
required
Available options:
AR,
BG,
CS,
DA,
DE,
EL,
EN-GB,
EN-US,
ES,
ES-419,
ET,
FI,
FR,
HE,
HU,
ID,
IT,
JA,
KO,
LT,
LV,
NB,
NL,
PL,
PT-BR,
PT-PT,
RO,
RU,
SK,
SL,
SV,
TH,
TR,
UK,
VI,
ZH,
ZH-HANS,
ZH-HANT
Example:
source_lang
enum<string>
Available options:
AR,
BG,
CS,
DA,
DE,
EL,
EN,
ES,
ET,
FI,
FR,
HE,
HU,
ID,
IT,
JA,
KO,
LT,
LV,
NB,
NL,
PL,
PT,
RO,
RU,
SK,
SL,
SV,
TH,
TR,
UK,
VI,
ZH
Example:
context
string
Example:
show_billed_characters
boolean
split_sentences
enum<string>
default:1
Available options:
0,
1,
nonewlines
Example:
preserve_formatting
boolean
default:false
formality
enum<string>
default:default
Available options:
default,
more,
less,
prefer_more,
prefer_less
Example:
model_type
enum<string>
Available options:
quality_optimized,
prefer_quality_optimized,
latency_optimized
glossary_id
string
Example:
style_id
string
Example:
tag_handling
enum<string>
Available options:
xml,
html
Example:
tag_handling_version
enum<string>
Available options:
v1,
v2
outline_detection
boolean
default:true
enable_beta_languages
boolean
default:false
non_splitting_tags
string[]
splitting_tags
string[]
ignore_tags
string[]

Response

translations
object[]
Minimum length: 1