API Reference
API v1 (legacy)
Detect Language

Detect Language (v1)

Detect the language of a given text using the v1 API.

Endpoint

POST /v1/language_detect

Description

Detect the language of a given text using the v1 API.

Headers

X-API-KEY string (required) : Your API key for authentication

Content-Type string (required) : Must be application/json

Request Parameters

Body Parameters

text string (required) : The text to detect language for

Example Request

curl https://api.translateplus.io/v1/detect_language \
  -H "X-API-KEY: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Bonjour le monde!"
  }'

Success Response (200 OK)

{
  "language": "fr",
  "confidence": 0.95
}

Response Fields

FieldTypeDescription
languagestringDetected language code
confidencefloatConfidence score (0.0 to 1.0)

Error Responses

See Error Handling for common error responses.

Migration to v2

We recommend migrating to the v2 Detect Language endpoint which provides enhanced features and better error handling.