---
title: Language Detection API
slug: detect-language
url: https://apyhub.com/apyhub/service/detect-language
provider: ApyHub
categories: [Artificial Intelligence, Standard Data]
tags: [language-detection, text-analysis, localization, nlp, classification]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 1
atoms: 50
mcp: true
alias: language-detector
---

# Language Detection API

Detect the language of a text sample and get the language name, ISO codes, script, and a confidence score for routing or localization.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/detect/language` | What it does Detects the language of the text you send in the request body. It returns a JSON objec… | 50 |

## Endpoint reference

### Detect language from text

`POST https://api.eu.apyhub.com/detect/language` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `text` | body | string | yes | Text sample for language detection (minimum 50 characters). Example: `This word checker is free and easy to use, and you can choose which language to…`. |

#### Quickstart

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

```bash
curl -X POST "https://api.eu.apyhub.com/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`.

```json
{
  "data": {
    "language": "English",
    "code": "eng",
    "iso_code": "en",
    "script": "Latin",
    "confidence": 0.9821
  }
}
```

## About

## 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.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/detect-language
