🌐

Language Detector

Identify the language of any text with a confidence score across 50+ languages

POST 1 credit /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
Response 200 OK
{
  "language_code": "fr",
  "language_name": "French",
  "confidence": 0.9823
}

Try It Live

Live Demo

Description

Identify the language of any text with a confidence score across 50+ languages

How to Use

1

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

Start using Language Detector now

Get your free API key and make your first request in under a minute.