ForHosting KIT · Text & AI

Detect language

A comment box, a support ticket, or a scraped product title rarely comes labeled with its language. The Language Detection API reads any text and returns the identified language with a confidence score, so your pipeline can route, translate, or store content correctly without a human ever guessing.

● StablePer request + per 1,000 words$0.003
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The routing problem behind every multilingual system

Before you can translate, moderate, or apply language-specific processing like spell checking to a piece of text, you need to know what language it's actually in — and that assumption breaks constantly in real systems. Contact forms get filled out in the visitor's native language regardless of your site's default, product catalogs get imported from suppliers using mixed languages, and user-generated content shows up in whatever the author happens to type. This endpoint exists to answer that one question reliably before anything else runs.

How a request resolves to a language

You send text to POST /text/detect-language, the task queues, and the engine analyzes character patterns, common word sequences, and script to identify the most likely language, along with a confidence score and, for closely related languages, an ordered list of alternatives. The result reaches your signed webhook or a signed link within moments of the underlying model completing, ready for your code to branch on immediately.

Why some text is genuinely ambiguous

Detection accuracy depends heavily on how much signal the text carries: a full paragraph in Portuguese is straightforward, but a three-word string like 'no problema' sits right at the boundary between Spanish, Portuguese, and code-switched English, and closely related language pairs — Norwegian and Danish, Indonesian and Malay — share enough vocabulary that even careful models return a lower-confidence result. The confidence score exists precisely so your system can treat a clear 98% match differently from a 55% guess on an ambiguous fragment.

The first link in a multilingual chain

Language detection almost never runs in isolation — it's the gate that decides what happens next. A detected language routes text to the right spell-check or proofreading dictionary, tells a translation step which source language to assume, or determines which regional content variant a visitor should see. Running it first, as a cheap and fast async task, keeps every downstream language-specific tool from having to guess for itself.

Pricing built for high-volume routing

The cost is $0.003 per request plus $0.0135 per 1,000 words, scaling naturally whether you're classifying a two-word search query or a full imported product description. Because it's often the very first step in a pipeline, failed detection tasks are retried automatically up to three times before returning a clear error, and you're never charged for a task that didn't produce a result.

Support ticket auto-routing

Detect the language of an incoming ticket the moment it arrives and route it to the right regional support queue automatically.

Content moderation triage

Identify the language of user comments before applying language-specific moderation rules, instead of running every language's filters on every comment.

Import pipeline sorting

Classify product titles and descriptions from a bulk supplier feed so mixed-language batches get split correctly before translation begins.

Analytics segmentation

Tag inbound form submissions or reviews by detected language to segment reporting by market, even when the submission form itself doesn't ask.

How accurate is the language detection API?

Accuracy is strong for full sentences and paragraphs; very short strings or text mixing multiple languages naturally return lower confidence scores, which the response reports explicitly.

Can it detect the language of a very short text?

Yes, it will return its best guess for short strings, but confidence tends to drop with less than a few words of signal, so always check the returned score.

Is there a free tier?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

How many languages can it identify?

The engine identifies major world languages and scripts; closely related language pairs may return an ordered list of likely alternatives alongside the top result.

What does it return for mixed-language text?

It returns the most probable dominant language along with a confidence score reflecting the ambiguity, rather than forcing an artificial single answer when a text genuinely blends languages.

How is pricing calculated?

It's $0.003 per request plus $0.0135 per 1,000 words analyzed, billed only for tasks that complete successfully, with no charge for failed requests.

Can I detect language in bulk for a large catalog?

Yes, requests are asynchronous with webhook delivery, so you can classify thousands of strings in a batch and collect results as they finish.

What happens if a detection request fails?

It's retried automatically up to three times; if it still can't complete you receive a clear error and are never charged for that task.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/text/detect-language

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/text/detect-language \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"…"}'
{
  "text": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "text.detect_language",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.003
Per 1,000 words$0.0135

Published price — no tokens, no invented credits. A failed task is never charged.

max_tokens20000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
422task_failedThe task failed after 3 retries. You are never charged for it.

Read the full KIT documentation →