apyhub
ARTIFICIAL INTELLIGENCE · STANDARD DATA

Language Detection API

Hosted on ApyHub

What it does

Language Detection identifies the language of a text sample and returns the detected language name, ISO 639-3 code, ISO 639-1 code, script, and confidence score.

Send a text string in the required body.text field. The sample must be at least 50 characters long, which gives the detector enough context to classify short or ambiguous phrases more reliably. The response comes back under data with language, code, iso_code, script, and confidence so you can route content based on language without adding your own classifier.

Use Language Detection when you need to sort user-generated content, choose translation pipelines, localize search, or apply language-specific processing rules before indexing or moderation. It fits well in workflows where text arrives from forms, support tickets, feeds, or imported documents and you need a fast first-pass label.

Because the output is compact and structured, you can plug it directly into validation, translation, or content analysis systems with minimal transformation.

POST
Detect language from text
https://api.eu.apyhub.com/apyhub/detect-language

QUICKSTART

GUIDE

Quickstart

Detect the language of a text sample by sending the text in the request body.

curl -X POST "https://api.eu.apyhub.com/apyhub/detect-language" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text":"This word checker is free and easy to use, and you can choose which language to base this word checker on for better results in your application."}'

What you'll get back

Returns a JSON object with a data object containing language, code, iso_code, script, and confidence.

{
  "data": {
    "language": "English",
    "code": "eng",
    "iso_code": "en",
    "script": "Latin",
    "confidence": 0.9821
  }
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Text sample for language detection (minimum 50 characters).

About this endpoint

What it does

Detects the language of the text you send in the request body. It returns a JSON object containing the detected language details inside a data object.

Request Body

ParameterTypeMandatoryDescription
textStringYesText sample for language detection (minimum 50 characters).

Response

Returns a JSON object with a data object field. The data object contains the detected language details: language (String), code (String), iso_code (String), script (String), and confidence (Number). This endpoint returns the detection result in the data object on success.

ParameterTypeMandatoryDescription
dataObjectYesDetected language details.
data.languageStringYesDetected language name.
data.codeStringYesISO 639-3 code.
data.iso_codeStringYesISO 639-1 code.
data.scriptStringYesWriting script used by the detected language.
data.confidenceNumberYesConfidence score as a float.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.