POST /translator/detect

Detect Language

Detect the language of a given text with support for 250+ languages.

Translation API

Detect the language of a given text. Returns the language code and human-readable name. Useful for routing content to the appropriate translation pipeline or for analytics on multilingual datasets.

HTTP Request

1
POST /translator/detect

Parameters

This endpoint has no query parameters.

Request Body

Send the text to analyze as the raw request body with Content-Type: text/plain.

1
Bonjour, comment allez-vous aujourd'hui?

Response

1
2
3
4
5
6
7
{
  "status": true,
  "data": {
    "language": "fr",
    "language_name": "French"
  }
}

Response Fields

FieldTypeDescription
statusbooleanWhether the request was successful
data.languagestringDetected language code
data.language_namestringHuman-readable name of the detected language

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import requests

url = "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/detect"

payload = "Bonjour, comment allez-vous aujourd'hui?"

headers = {
    "Content-Type": "text/plain",
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "multi-format-ai-translator-the-most-complete.p.rapidapi.com"
}

response = requests.post(url, headers=headers, data=payload)
data = response.json()

print(f"Language: {data['data']['language_name']} ({data['data']['language']})")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
const url = "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/detect";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Content-Type": "text/plain",
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "multi-format-ai-translator-the-most-complete.p.rapidapi.com",
  },
  body: "Bonjour, comment allez-vous aujourd'hui?",
});

const data = await response.json();

console.log(`Language: ${data.data.language_name} (${data.data.language})`);
1
2
3
4
5
curl -X POST "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/detect" \
  -H "Content-Type: text/plain" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: multi-format-ai-translator-the-most-complete.p.rapidapi.com" \
  -d "Bonjour, comment allez-vous aujourd'hui?"
  • Translate — Translate text with automatic language detection
  • Batch Translate — Translate multiple strings in a single request
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI