DEV Community

Alexey D
Alexey D

Posted on

Language Detection API: Detect 100+ Languages with Confidence Score (Free Tier)

Need to detect what language a piece of text is written in? Whether you are building a multilingual chatbot, content moderation system, or routing engine — here is how to do it with one API call.

Language Detector Pro API

RapidAPI link: https://rapidapi.com/adunaev8419/api/language-detector-pro

Supports 100+ languages, returns confidence score, works on short texts too. Free tier: 50 requests/hour.

Python Example

import requests

url = "https://language-detector-pro.p.rapidapi.com/detect"
headers = {
    "X-RapidAPI-Key": "YOUR_KEY",
    "Content-Type": "application/json"
}

texts = ["Hello world", "Bonjour le monde", "Привет мир", "こんにちは"]

for text in texts:
    r = requests.post(url, json={"text": text}, headers=headers)
    d = r.json()
    print(f"{text:<20} -> {d['language_name']} ({d['confidence']*100:.0f}%)")

# Hello world          -> English  (99%)
# Bonjour le monde     -> French   (98%)
# Привет мир           -> Russian  (99%)
# こんにちは              -> Japanese (99%)
Enter fullscreen mode Exit fullscreen mode

JavaScript Example

const res = await fetch("https://language-detector-pro.p.rapidapi.com/detect", {
  method: "POST",
  headers: {
    "X-RapidAPI-Key": "YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ text: "Wie geht es Ihnen?" })
});
const data = await res.json();
console.log(data.language_name); // "German"
console.log(data.confidence);    // 0.97
Enter fullscreen mode Exit fullscreen mode

Batch Processing

r = requests.post(
    "https://language-detector-pro.p.rapidapi.com/batch",
    json={"texts": ["Hello", "Bonjour", "Привет", "Hola", "Ciao"]},
    headers=headers
)
for item in r.json()["results"]:
    print(item["detected_language"], item["language_name"])
# en English / fr French / ru Russian / es Spanish / it Italian
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • Multilingual chatbots — route to correct response template by language
  • Content moderation — apply language-specific rules
  • Customer support — auto-assign tickets to right-language agents
  • Analytics — understand your global audience breakdown

Pricing

Plan Price Requests/hr
BASIC Free 50
PRO $9.99/mo 1,000
ULTRA $24.99/mo 8,000

Try it free: https://rapidapi.com/adunaev8419/api/language-detector-pro

GitHub: https://github.com/adun8419/language-detector-pro-api

Top comments (0)