---
title: Language Detection API
slug: detect-language
url: https://apyhub.com/apyhub/service/detect-language
provider: ApyHub
categories: [Retrieval Kit]
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

Automatically detect the language of any text. Get the language name, ISO 639-1 and 639-3 codes, script and a confidence score as JSON. Try it free.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/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/apyhub/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/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`.

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

## About

## What it does

The Language Detection API automatically identifies the language of a piece of text. Send any text of at least 50 characters and get back the language name, its ISO codes, its writing script and how confident the detection is, so you know what language you are dealing with before you translate, route or moderate it.

It is one POST endpoint with a single `text` field. The response comes back in a `data` object with five fields: `language` with the name, such as `English`, `iso_code` with the two-letter ISO 639-1 code, such as `en`, `code` with the three-letter ISO 639-3 code, such as `eng`, `script` with the writing system, such as `Latin`, and `confidence` as a score between 0 and 1. Use the ISO codes to pass the result straight into translation, search or localization tools, and use the confidence score to send uncertain results for review instead of acting on them.

The 50-character minimum is there for accuracy: a single word like "gift" means different things in English and German, while a full sentence gives the detector enough context to be sure. Common uses include routing support tickets to the right team, choosing the translation pipeline for incoming text, tagging user reviews and posts by language, applying language-specific search and moderation rules, and checking that content is in the language it claims to be.

To see every possible language with its probability instead of one answer, use the [Detect Text Language Probabilities API](https://apyhub.com/dosvak/service/detect-text-language). To detect the language spoken in a video, use the [AI Video Language Detection API](https://apyhub.com/apyhub/service/detect-language-video). Once you know the language, translate the text with the [Translate Text API](https://apyhub.com/sharpapi/service/translate-text) or screen it for offensive words with the [CheckText Profanity API](https://apyhub.com/dosvak/service/profanity-check).

You can try it right here in the playground. Start for free with 5 API calls a day, no card required, and find out what language your own text is in before you commit.

The API is also available through [ApyHub MCP](https://apyhub.com/mcp), so AI agents can check the language of incoming text directly before deciding how to handle it.

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