Your first API request

Make your first API requests to translate and improve text with the DeepL API.

Once you've created a DeepL API account and located your authentication key, you're ready to make your first requests.

Text translation

To translate text, you can use the /translate endpoint, which also supports translation of XML and HTML content.

We included text translation examples for our client libraries, too, just to give you an idea of what they look like.

The example below uses our API Pro endpoint https://api.deepl.com. If you're an API Free user, remember to update your requests to use https://api-free.deepl.com instead.

Example request
curl -X POST 'https://api.deepl.com/v2/translate' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]' \
--header 'Content-Type: application/json' \
--data '{
  "text": [
    "Hello, world!"
  ],
  "target_lang": "DE"
}'
Example response
{
  "translations": [
    {
      "detected_source_language": "EN",
      "text": "Hallo, Welt!"
    }
  ]
}

Text improvement

To improve text, you can use the /write/rephrase endpoint. We included an example below.

The text improvement endpoint (DeepL API for Write) is currently only available to Pro API subscribers via the v2 endpoint.

Example cURL request
curl -X POST 'https://api.deepl.com/v2/write/rephrase' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]' \
--header 'Content-Type: application/json' \
--data '{
  "text": [
    "I could relly use sum help with edits on thiss text !"
  ],
  "target_lang": "en-US"
}'
Example response
{
  "improvements": [
    {
      "text": "I could really use some help with editing this text!",
      "target_language": "en-US",
      "detected_source_language": "en"
    }
  ]
}

Last updated