Text Language Detection Compute Call

The Text Language Detection (TLD) compute call identifies the ISO language code and script of raw text strings across scheduled Indian languages.

Inference Compute Endpoint:

POST https://dhruva-api.bhashini.gov.in/services/inference/pipeline

1-Minute Quick Call

Detect the language and script of a text input with your inference API key:

curl --location 'https://dhruva-api.bhashini.gov.in/services/inference/pipeline' \
  --header 'Content-Type: application/json' \
  --header 'Accept: */*' \
  --header 'Authorization: <YOUR_INFERENCE_API_KEY>' \
  --data '{
    "pipelineTasks": [
      {
        "taskType": "txt-lang-detection",
        "config": {
          "serviceId": "ai4bharat/indic-lang-detect--gpu-t4"
        }
      }
    ],
    "inputData": {
      "input": [
        {
          "source": "नमस्ते, आप कैसे हैं?"
        }
      ]
    }
  }'

Required Headers

HeaderTypeRequiredDescription
Content-TypestringRequiredStandard JSON request body (application/json).
AcceptstringRequiredExpected response format (*/*).
AuthorizationstringRequiredRaw inference API key (without Bearer).
Postman headers for Text Language Detection