Language Detector
text.detect_language
Overview
Detects the likely language of text using offline statistical analysis. Returns ISO 639-1 code, confidence score, alternatives, and reliability indicator. Accepts file input via file_ref — no need to extract file content first.
LLMs can guess languages but waste tokens and may hallucinate ISO codes. We return a confidence-scored, offline answer with zero reasoning overhead.
Reliability
BEST_EFFORT — deterministic on this deployment but statistical, not guaranteed correct. Lingua light mode; counts may shift after a library upgrade. Only the first 4096 characters are analyzed (_meta.truncated when longer). LANGUAGE_DETECTION_LOW_CONFIDENCE_LIGHT — trigger: you set requireReliable and the best score stayed under minConfidence, so we refuse to hand you a guess; retryable: not as-is, the same text scores the same; next: send more text, narrow candidateLanguages, lower minConfidence, or escalate to a fuller detector.
Context footprint
Accepts inline text up to 1,048,576 chars or file_ref (up to 2 MB). Upload files via POST /v1/files/upload before passing file_ref. A successful call costs 2 execution credits.
When to use it
Before routing text to language-specific processing when metadata is missing or untrusted. Works best with 120+ characters of natural text.
Do not use when the language is already known, when you need translation or encoding detection, or for very short single-word inputs.
Powered by Lingua, a highly accurate offline language-detection engine that classifies text locally without sending it anywhere.
Scope
Non-goals
- Does not translate text
- Does not detect byte or character encoding
- Does not identify writing script (Latin, Cyrillic, CJK)
- Does not distinguish regional dialects (e.g. Brazilian vs European Portuguese)
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 1.9 MiB | Skill maximum |
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
Squillify guarantees
- Runs inside Squillify using a self-contained open-source component
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Self contained open source component
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- Output may reveal sensitive derived information
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | No | Bounded inline text source. Required unless file_ref is provided. |
| file_ref | string | No | Tenant-scoped opaque text-file reference. Omit it to use the required inline text; never send both. |
| candidateLanguages | array | No | Bounded optional array of candidate ISO language codes; omit it to consider every supported language. The item shape is defined by the nested schema and the array contains from 0 through 100 items. |
| minConfidence | number | No | Minimum accepted confidence; omit it for zero. |
| maxAlternatives | integer | No | Alternative-language cap; omit it for five. |
| requireReliable | boolean | No | Whether an unreliable result is refused; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| language | string | Yes | Detected lowercase ISO language code. |
| confidence | number | Yes | Detector confidence score. |
| reliable | boolean | Yes | Whether detector reliability meets the requested policy. |
| alternatives | array | Yes | Bounded array of candidate receipts ordered by descending confidence. The item shape is defined by the nested schema and the array contains from 0 through 100 items. |
| _meta | object | Yes | Closed bounded-sampling receipt with sampleLength, originalLength, and truncated properties. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"text.detect_language","input":{"text":"The quick brown fox jumps over the lazy dog near the riverbank."}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("text.detect_language", {"text":"The quick brown fox jumps over the lazy dog near the riverbank."});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| LANGUAGE_DETECTION_LOW_CONFIDENCE_LIGHT | 412 | No | The input is valid but cannot be processed as-is. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not translate text
- Does not detect byte or character encoding
- Does not identify writing script (Latin, Cyrillic, CJK)
- Does not distinguish regional dialects (e.g. Brazilian vs European Portuguese)
- Translating text between languages
- Detecting file or byte-stream encoding
- Classifying very short text (1–3 words) where statistical signal is weak
- Script identification without language classification
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "text.detect_language",
"input": {
"text": "The quick brown fox jumps over the lazy dog near the riverbank."
}
}Examples
Detect English prose
{
"text": "The quick brown fox jumps over the lazy dog near the riverbank."
}{
"language": "en",
"_meta": {
"originalLength": 63,
"truncated": false,
"sampleLength": 63
},
"confidence": 1,
"reliable": true,
"alternatives": [
{
"confidence": 1,
"language": "en"
},
{
"confidence": 0.8071,
"language": "da"
},
{
"confidence": 0.8045,
"language": "tl"
},
{
"confidence": 0.7994,
"language": "cy"
},
{
"confidence": 0.7947,
"language": "yo"
}
]
}Restrict detection to candidate languages
{
"candidateLanguages": [
"fr",
"es",
"it"
],
"text": "Bonjour le monde"
}{
"language": "fr",
"_meta": {
"originalLength": 16,
"truncated": false,
"sampleLength": 16
},
"confidence": 1,
"reliable": true,
"alternatives": [
{
"confidence": 1,
"language": "fr"
},
{
"confidence": 0.7004,
"language": "it"
},
{
"confidence": 0.6811,
"language": "es"
}
]
}Recommended use cases
- Route text to the correct language-specific pipeline
- Select locale-aware formatting or segmentation rules
- Validate declared language metadata against actual content
Avoid for
- Translating text between languages
- Detecting file or byte-stream encoding
- Classifying very short text (1–3 words) where statistical signal is weak
- Script identification without language classification
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.