Language Detection

Detect the language of any text and receive the language name, ISO 639-1 code, and a confidence score.

Get API Key

Overview

Use Cases

  • Routing user messages to the correct language support team
  • Auto-translating user-generated content
  • Filtering content by language in multilingual platforms
  • Preprocessing text for NLP pipelines

Features

Supports 75 languages
Returns ISO 639-1 language code
Provides a confidence score between 0.0 and 1.0
Works on short phrases and full sentences

API Endpoints

Detect Language

Identifies the language of the provided text and returns the language name, ISO 639-1 code, and confidence score.

POST
https://api.requiems.xyz/v1/ai/detect-language

Parameters

Name Type Required Description
text string Required The text whose language should be detected.

Try it out

Live Demo
Request

The text whose language should be detected.

Response Fields

Field Type Description
language string Full name of the detected language (e.g. French, English, Spanish)
code string ISO 639-1 two-letter language code (e.g. fr, en, es). Empty string when detection is unreliable.
confidence float Confidence score between 0.0 and 1.0. 0.0 is returned when the language cannot be reliably detected.

Code Examples

curl -X POST https://api.requiems.xyz/v1/ai/detect-language \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Bonjour, comment Γ§a va?"}'

Error Responses

validation_failed

The text field is missing or empty.

bad_request

The request body is missing or malformed.

internal_error

Unexpected server error.

Frequently Asked Questions