Text Language API
97 languages
ISO 639-1 & 639-3
Batch: 50

Detect any language.From any text.

Language detection across 97 languages using confidence-scored candidates. Single texts or batches of 50 — with ISO 639-1 and ISO 639-3 output formats. One clean REST call.

97 · languages50k chars · per text50 · per batch1–5 · top candidates

Try language detection live.

Paste any text, pick your output format, and see the detected language in real time. No API key needed.

Request builder

Type or pick a sample text, choose format and top-N candidates.

GET /detect
Output preview

Detected language, confidence, and raw JSON response.

English
en
conf 1.00

ISO codes

639-3: eng

639-1: en

textLength: 44candidatesFound: 1topResults: 1

97 languages supported

From Arabic to Vietnamese — covering the vast majority of written web content.

Batch up to 50 texts

Use POST /detect/batch with an items array to detect multiple texts in one call.

Confidence-ranked output

Request top=3 or top=5 to get ranked candidates — useful for mixed-language content.

Why Text Language API

Detection that just works.

97 Languages

Detects 97 languages from Arabic to Vietnamese — covering the vast majority of written web content.

Confidence Scores

Every result includes a 0–1 confidence score. Request up to 5 top candidates to handle ambiguous or multilingual text.

Dual ISO Format

Output language codes in ISO 639-3 (three-letter) or ISO 639-1 (two-letter) format with a single format param.

Batch Processing

Send up to 50 texts in a single request. Each item is identified by a custom ID so results map back cleanly.

GET-Friendly

URL-encode text and pass your API key — no request body required. Works from a browser, curl, or any HTTP client.

Structured Responses

Every response includes a correlationId for tracing. Consistent error shapes make integration and debugging predictable.

/api/text-language

Endpoints, at a glance.

Single or batch detection with GET or POST. Start with /detect — add top=3 to get confidence-ranked candidates.

GET/detect

Single detection

Detect the language of a single text. Returns top candidate(s) with confidence scores. Default format: ISO 639-3.

PRIMARY
POST/detect

POST detect

Same as GET /detect — pass text, top, and format in the JSON body instead of query params.

GET/detect/batch

Batch detection (GET)

Detect languages for up to 50 texts. Pass comma-separated texts and optional ids, or a JSON-encoded items array.

POST/detect/batch

Batch detection (POST)

Submit up to 50 items as a JSON array with per-item id and text fields. Results map back by id.

GET/languages

Supported languages

Returns the full list of 97 supported languages with ISO 639-3 code, name, and ISO 639-1 code.

GET/meta

Service metadata

Returns engine version, supported language count, and service configuration.

GET/health

Health check

Returns service status, version, uptime, and franc engine metadata.

GET/metrics

Prometheus metrics

Detection counts, processing durations, and error rates.

ParameterTypeRequiredDescription
textstringyes*Input text (10–50,000 chars). Required for single detect.
topintegernoNumber of top candidates to return (1–5). Default: 1.
formatstringnoOutput code format: "639-3" (default) or "639-1".
itemsarray/JSONyes**Batch items array. Each item: { id, text }. Max 50.
textsstringyes***Comma-separated texts for GET batch mode.
idsstringnoComma-separated IDs aligned to texts by index.
api_keystringyesAPI key via query param, or pass as x-api-key header.

Requests & responses.

Single or batch detection — GET or POST. URL-encode text for GET requests.

Single detection

Detect one text with ISO 639-1 output. Add top=3 for ranked candidates.

GET https://datpaq.com/api/text-language/detect?api_key=BYPASS_API_KEY&text=Bonjour%20tout%20le%20monde%2C%20comment%20%C3%A7a%20va%20aujourd%27hui%3F&top=1&format=639-1
Batch detection

POST up to 50 texts with per-item IDs. Results map back by id.

POST https://datpaq.com/api/text-language/detect/batch
Content-Type: application/json

{
  "items": [
    { "id": "en1", "text": "The quick brown fox jumps over the lazy dog." },
    { "id": "de1", "text": "Guten Morgen! Wie geht es Ihnen heute?" }
  ],
  "top": 1,
  "format": "639-1"
}
Health

https://datpaq.com/api/text-language/health

Metrics

https://datpaq.com/api/text-language/metrics

Error reference

Predictable errors, always structured.

Every error response includes a correlationId for request tracing and a clear error message.

400Text Too Short

Input text must be at least 10 characters. Very short strings cannot be reliably detected.

400Text Too Long

Text exceeds the 50,000 character limit. Trim the input or split into smaller chunks.

400Invalid top Value

top must be an integer between 1 and 5. Values outside this range are rejected.

400Invalid format Value

format must be "639-3" or "639-1". Any other value returns a validation error.

400Batch Limit Exceeded

More than 50 items in a batch request. Split into smaller requests of ≤50 items.

400Detection Failure

Language cannot be confidently detected. Try providing more or cleaner text.

401Unauthorized

API key missing or invalid. Pass api_key as a query param or x-api-key as a header.

429Rate Limited

200 requests per 15 minutes per IP exceeded. Retry after the window resets.

500Processing Error

Internal error during detection. The correlationId in the response helps with debugging.

Example error response

{
  "error": "Validation failed",
  "details": "Text must be at least 10 characters long",
  "correlationId": "1780007487318-6jpjq22dt"
}

FAQ

API questions developers ask first.

How do I authenticate with this API?

Create an API key in your Datpaq dashboard and send it with each request as a bearer token in the Authorization header.

Is there a free tier?

Yes. Datpaq APIs include a free tier for building, testing, and small production workloads before you move to a paid plan.

What format do requests and responses use?

Datpaq APIs use REST over HTTPS and return JSON by default. Endpoint docs show the supported methods, query parameters, request bodies, and response fields.

Where can I see limits and errors?

Each API documents rate limits, validation rules, and error responses in the landing page and API docs so integrations can retry and fail cleanly.

Start detecting languages in minutes.

One GET request returns a language code, name, and confidence score. URL-encode your text, add your API key — done.