Skip to main content
Beta Feature — Opt-in RequiredThe Detect Language API is currently in beta and requires explicit opt-in for your account. To request access, please send a support request.
The Detect Language API allows you to identify the language of text content. This is a beta feature that requires special access permissions and is currently available only to select accounts.

Best Practices

  1. Text Length: Provide sufficient text for accurate detection. Very short texts may result in insufficient_confidence or no_language_detected status.
  2. Batch Processing: You can detect multiple texts in a single request by providing an array of strings.
  3. Error Handling: Check the detection_status field to understand the result. Only when detection_status is success will the detected_language field contain a valid language code.
  4. Rate Limiting: Be mindful of API rate limits when making frequent requests.

Feature Availability

This is a beta feature that requires:
  • Account enrollment in the language detection beta program
  • Compatible API key with appropriate permissions
Reach out to your DeepL contact to request access to the language detection API beta.

Endpoint

POST /v3/detect/language

Authentication

This endpoint requires authentication using the DeepL-Auth-Key header with a valid API key that has access to the language detection feature.

Request Formats

curl -X POST "https://api.deepl.com/v3/detect/language" \
  -H "Authorization: DeepL-Auth-Key YOUR_AUTH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": [
      "Hello, how are you?",
      "Hola, ¿cómo estás?"
    ]
  }'

Request Parameters

text
string[]
required
List of text strings to detect languages for. Each string will be processed separately.The response detections are returned in the same order as they are requested. Each of the parameter values may contain multiple sentences. Up to 50 texts can sent in one request.

Response Format

{
  "results": [
    {
      "detected_language": "en",
      "detection_status": "success"
    },
    {
      "detected_language": "es", 
      "detection_status": "success"
    }
  ]
}
Example responses for different detection statuses:
{
  "results": [
    {
      "detected_language": "en",
      "detection_status": "success"
    },
    {
      "detection_status": "insufficient_confidence"
    },
    {
      "detection_status": "unsupported_language"
    },
    {
      "detection_status": "no_language_detected"
    }
  ]
}

Response Fields

results
array
required
Array of detection results, one for each input text. Each result object contains a detected_language and a detection_status field.
detected_language
string
The detected language code when detection is successful.Language Codes (when detection_successful is true):
  • Standard BCP-47 language codes: one of "en", "de", "fr", "es", "pt", "it", "nl", "pl", "ru", "zh", "ja", "bg", "cs", "da", "el", "et", "fi", "hu", "lt", "lv", "ro", "sk", "sl", "sv", "tr", "id", "uk", "ko", "nb", "ar", "vi", "he", "th"
  • See supported languages for more info
When detection_status is not success, this field is not defined.
detection_status
string
required
Indicates the result of language detection. Possible values:
  • "success" - Language successfully detected and returned in detected_language
  • "insufficient_confidence" - Detection confidence too low to return a reliable single result
  • "unsupported_language" - A language was detected but it’s not supported by DeepL’s translation service
  • "no_language_detected" - No language could be detected from the input text

Limitations

  • Only supports detection of languages that are available in DeepL’s translation service
  • Requires high confidence to return the language
  • Only returns the first top language guess for any single text, may not work well with language variants that are very similar to each other
  • Limited to text-based detection (no support for document formats)