Language Detection
Identify the likely language of supplied text. Returns the detected language, confidence and alternative language candidates.
Pay by wallet (x402)
language-detect Example
Example answer
{
"confidence": 0.74,
"text_length": 59,
"alternatives": [
{
"confidence": 0.76,
"language_code": "nld",
"language_name": "Dutch"
},
{
"confidence": 0.74,
"language_code": "afr",
"language_name": "Afrikaans"
},
{
"confidence": 0.7,
"language_code": "src",
"language_name": "src"
},
{
"confidence": 0.69,
"language_code": "nno",
"language_name": "nno"
}
],
"language_code": "deu",
"language_name": "German",
"script_detected": "Latin"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
text | string | Yes | Text to detect language of |
min_length | integer | No | Minimum text length for reliable detection (default 10) |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
confidence | number | Always (present in every successful answer) |
text_length | integer | Always (present in every successful answer) |
alternatives | array | Usually (present for most inputs) |
language_code | string | Always (present in every successful answer) |
language_name | string | Always (present in every successful answer) |
script_detected | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "language-detect",
"inputs": {
"text": "Dies ist ein deutscher Satz zum Testen der Spracherkennung."
},
"max_price_cents": 2
}' {
"tool": "strale_execute",
"arguments": {
"slug": "language-detect",
"inputs": {
"text": "Dies ist ein deutscher Satz zum Testen der Spracherkennung."
},
"max_price_cents": 2
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "language-detect",
inputs: {
"text": "Dies ist ein deutscher Satz zum Testen der Spracherkennung."
},
max_price_cents: 2,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="language-detect",
inputs={
"text": "Dies ist ein deutscher Satz zum Testen der Spracherkennung.",
},
max_price_cents=2,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/language-detect?text=Dies+ist+ein+deutscher+Satz+zum+Testen+der+Spracherkennung.' Limitations
Short texts unreliable
Texts shorter than ~20 characters produce unreliable results — trigram analysis needs sufficient sample
What to do instead: Provide at least 30+ characters for reliable detection
Similar languages may be confused
Closely related languages (e.g., Norwegian/Danish/Swedish, Serbian/Croatian) may be confused