POST
/
v2
/
translate
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",
  "tag_handling": "html",
  "outline_detection": true,
  "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

Authentication with Authorization header and DeepL-Auth-Key authentication scheme

Body

Response

200
application/json

The translate function returns a JSON representation of the translations in the order the text parameters have been specified.

The response is of type object.