Language Detector
Identify the language of any text with a confidence score across 50+ languages
/v1/text/detect-language
curl -X POST "https://textanalysis.toolkitapi.io/v1/text/detect-language" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Bonjour le monde, comment allez-vous?"}'
import httpx
resp = httpx.post(
"https://textanalysis.toolkitapi.io/v1/text/detect-language",
json={"text": "Bonjour le monde, comment allez-vous?"},
)
print(resp.json())
const resp = await fetch("https://textanalysis.toolkitapi.io/v1/text/detect-language", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"text": "Bonjour le monde, comment allez-vous?"}),
});
const data = await resp.json();
console.log(data);
# See curl example
{
"language_code": "fr",
"language_name": "French",
"confidence": 0.9823
}
Try It Live
Description
How to Use
1. Send a POST request to `/v1/text/detect-language` with the `text` field. 2. Read `language_code` (ISO 639-1, e.g. `"fr"`) and `language_name` (e.g. `"French"`). 3. Use `confidence` to decide whether to trust the result — scores above 0.85 are highly reliable. 4. For very short texts (< 20 words), treat results with confidence < 0.7 as uncertain.
About This Tool
The Language Detection endpoint identifies the language of any text snippet and returns an ISO 639-1 language code along with a confidence score and the full language name.
Detection is based on character n-gram frequency analysis — a lightweight, fast approach that works well for texts of 20 words or more across 50+ languages including all major European languages, Chinese, Japanese, Korean, Arabic, and Russian.
Why Use This Tool
- Multi-language content routing — Route user-submitted content to the correct language processing pipeline
- Automatic translation trigger — Detect non-English content and trigger a translation workflow
- Analytics segmentation — Segment user feedback by language for localised analysis
- Form validation — Verify that content is in the expected language before processing
Start using Language Detector now
Get your free API key and make your first request in under a minute.