# Text Language API

> Text Language is a language detection API that detects the language of any input string, returning the full language name and its two-letter ISO 639-1 code. Send plain text passages or short snippets to identify incoming multilingual content.

**Endpoint:** `POST https://api.apiverve.com/v1/textlanguage`  
**Category:** Text Processing  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/textlanguage

## Overview

Text Language works by analyzing the text and comparing it to a database of languages and ai models. It uses advanced algorithms to detect the language of the text and returns the language.

## 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/textlanguage" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Ceci est un exemple de texte. Il peut détecter la langue"}'
```

## Parameters

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

## Response fields

- `language` — string · Full name of detected language (e.g., French)
- `iso` — string · ISO 639-1 code for detected language

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "language": "french",
    "iso": "fr"
  }
}
```

## Use cases

- **Localized Helpdesk Queuing** — Helpdesk software inspects inbound contact messages to route each ticket to an agent fluent in the detected language.
- **User Review Indexing** — When customers submit feedback across regional app stores, marketplaces tag each comment with its ISO code for localized sentiment tracking.
- **Forum Post Moderation** — Community platforms check new discussion submissions to assign posts to regional moderators based on the returned language name.
- **Speech Engine Selection** — Before generating synthetic audio, narration tools check input snippets to select the voice model matching the detected ISO code.

## SDKs

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

## More

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