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/pipelineRequest Schema→
Request Payload Specification
Detailed breakdown of input text strings, language detection service IDs, and batch inference options.
Response Schema→
Response Payload Specification
Examine predicted language codes (e.g. 'hi', 'bn', 'ta'), confidence scores, and script metadata.
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
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Required | Standard JSON request body (application/json). |
Accept | string | Required | Expected response format (*/*). |
Authorization | string | Required | Raw inference API key (without Bearer). |