Detect Language API

Detect the language of the given text. The API returns a list of languages and their confidence scores. The confidence score is a value between 0 and 1, where 1 means the language was detected with 100% confidence. The API supports text in 22 languages.

GET
https://api.apileague.com/detect-language
Example Request and Response
GET
https://api.apileague.com/{{ examples.getDetectLanguage }}
[
    {
        "language": "de",
        "confidence": 0.34
    },
    {
        "language": "et",
        "confidence": 0.22
    },
    {
        "language": "fi",
        "confidence": 0.13
    },
    {
        "language": "sv",
        "confidence": 0.11
    },
    {
        "language": "it",
        "confidence": 0.11
    },
    {
        "language": "es",
        "confidence": 0.05
    },
    {
        "language": "pt",
        "confidence": 0.03
    },
    {
        "language": "lt",
        "confidence": 0.01
    }
]
cURL
Java
Javascript
Python
Go
C#
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}

Frequently Asked Questions

How many languages can be detected?

The API supports detection for 22 different languages, covering the most widely spoken languages globally.

What is the confidence score?

The confidence score is a value between 0 and 1 indicating how certain the API is about the detected language. A score of 1 represents 100% confidence.

Can it detect multiple languages in one text?

The API returns a list of potential languages with their confidence scores. If a text contains mixed languages, the API will likely return the dominant language with the highest score.

How is the Detect Language API different from the Detect Sentiment API?

The Detect Language API identifies the language of the text, while the Detect Sentiment API analyzes the emotional tone (positive or negative) of the text.

Questions? Need Help? Ask Away