# Language Detector API

> Language Detector is a language detection API that identifies the language of text in Latin, Cyrillic, Arabic, Greek, Hebrew, Thai, Chinese, Japanese and Korean scripts, including one-line messages. It returns the primary language, its ISO 639-1 code, and candidate matches ranked by confidence scores.

**Endpoint:** `POST https://api.apiverve.com/v1/languagedetector`  
**Category:** AI/Computer Vision  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/languagedetector

## Overview

A language recognition API for multilingual text such as support tickets, reviews and user posts. Language Detector works by comparing the trigram frequencies in the text against language profiles, then returns the language code, ranked candidates and, on paid plans, the confidence level.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/languagedetector" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"esta es una frase en español. esta API puede detectar fácilmente el idioma"}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string | Yes | The text to detect the language of |

## Response fields

- `primaryLanguage` — string · The most likely detected language
- `primaryCode` — string · ISO 639-1 code of the primary language
- `confidenceLevel` — string · Overall confidence level: high, medium, or low · (premium)
  - `detectedLanguages.0.language` — string · The candidate language's full name
  - `detectedLanguages.0.confidence` — number · How strongly the sample matched this language's trigram frequencies, from 0 to 1
  - `detectedLanguages.0.code` — string · ISO 639-1 code of this candidate language

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "primaryLanguage": "spanish",
    "primaryCode": "es",
    "confidenceLevel": "medium",
    "detectedLanguages": [
      {
        "language": "spanish",
        "confidence": 0.38471794871794873,
        "code": "es"
      },
      {
        "language": "portuguese",
        "confidence": 0.2946153846153846,
        "code": "pt"
      },
      {
        "language": "danish",
        "confidence": 0.2464615384615384,
        "code": "da"
      }
    ]
  }
}
```

## Use cases

- **Inbound Ticket Dispatch** — When an international customer submits a support ticket, help desks inspect the text to route the ticket to native-speaking agents.
- **Voice Synthesizer Selection** — To read articles aloud with correct accents, screen readers check the language code before choosing a matching text-to-speech voice model.
- **Search Stemmer Configuration** — Tag document uploads with ISO language codes during ingest so search engines apply the correct grammatical stemming rules for each language.
- **Market Research Segmentation** — Analytics teams group raw global survey responses by primary language before running regional sentiment and feedback models.

## SDKs

- **npm** — `npm install @apiverve/languagedetector` (https://www.npmjs.com/package/@apiverve/languagedetector)
- **PyPI** — `pip install apiverve-languagedetector` (https://pypi.org/project/apiverve-languagedetector/)
- **NuGet** — `dotnet add package APIVerve.API.LanguageDetector` (https://www.nuget.org/packages/APIVerve.API.LanguageDetector)
- **Source** — https://github.com/apiverve/languagedetector-api

## More

- Full reference: https://docs.apiverve.com/ref/languagedetector
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
