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 detects 99 languages, using the Apache OpenNLP language model (103 language variants folded into 99 codes).
Each entry contains the language as an ISO 639-1 code (or an ISO 639-3 code where the language has no ISO 639-1 code) and a confidence between 0 and 1. The entries are sorted by confidence, highest first, and languages with a confidence of 0.01 or less are omitted. Detection works best on a full sentence or more; for very short phrases (a few words) the confidence is low and the result is less reliable.
Supported languages (99): Afrikaans (af), Arabic (ar), Asturian (ast), Azerbaijani (az), Bashkir (ba), Belarusian (be), Bulgarian (bg), Bengali (bn), Breton (br), Bosnian (bs), Catalan (ca), Chechen (ce), Cebuano (ceb), Czech (cs), Welsh (cy), Danish (da), German (de), Greek (el), English (en), Esperanto (eo), Spanish (es), Estonian (et), Basque (eu), Persian (fa), Finnish (fi), Faroese (fo), French (fr), Western Frisian (fy), Irish (ga), Galician (gl), Swiss German (gsw), Gujarati (gu), Hebrew (he), Hindi (hi), Croatian (hr), Hungarian (hu), Armenian (hy), Indonesian (id), Icelandic (is), Italian (it), Japanese (ja), Javanese (jv), Georgian (ka), Kazakh (kk), Kannada (kn), Korean (ko), Kyrgyz (ky), Latin (la), Luxembourgish (lb), Limburgish (li), Lithuanian (lt), Latvian (lv), Malagasy (mg), Māori (mi), Minangkabau (min), Macedonian (mk), Malayalam (ml), Mongolian (mn), Marathi (mr), Malay (ms), Maltese (mt), Min Nan (nan), Norwegian Bokmål (nb), Low German (nds), Nepali (ne), Dutch (nl), Norwegian Nynorsk (nn), Occitan (oc), Punjabi (pa), Polish (pl), Pashto (ps), Portuguese (pt), Romanian (ro), Russian (ru), Sanskrit (sa), Sinhala (si), Slovak (sk), Slovenian (sl), Somali (so), Albanian (sq), Serbian (sr), Sundanese (su), Swedish (sv), Swahili (sw), Tamil (ta), Telugu (te), Tajik (tg), Thai (th), Tagalog (tl), Turkish (tr), Tatar (tt), Ukrainian (uk), Urdu (ur), Uzbek (uz), Vietnamese (vi), Volapük (vo), Waray (war), Chinese (zh), Zulu (zu).
[
{
"language": "de",
"confidence": 0.83
},
{
"language": "nds",
"confidence": 0.11
}
] {{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
The API detects 99 languages. It uses the Apache OpenNLP language model, whose 103 language variants are folded into 99 codes: ISO 639-1, or ISO 639-3 where no two-letter code exists.
Detection works best on a full sentence or more; for very short phrases (a few words) the confidence is low and the result is less reliable.
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.
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.
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.