Language Detection

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

Get API Key

Descripción general

Casos de uso

  • 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

Funcionalidades

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

Puntos finales de la API

Detect Language

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

POST
https://requiems.xyz/v1/text/detect-language

Parámetros

Nombre Tipo Obligatorio Descripción
text string Obligatorio The text whose language should be detected.

Pruébalo

Demostración en vivo
Solicitud

The text whose language should be detected.

Campos de respuesta

Campo Tipo Descripción
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 number Confidence score between 0.0 and 1.0. 0.0 is returned when the language cannot be reliably detected.

Ejemplos de código

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

Respuestas de error

validation_failed

The text field is missing or empty.

bad_request

The request body is missing or malformed.

internal_error

Unexpected server error.

Preguntas frecuentes