GETDetect Language
https://api-language-detection.dataandapis.com/v1/detect
Parâmetros de consulta
| Parâmetro | Exemplo | |
|---|---|---|
| candidates | 3 | Opcional |
| text | This is a simple English sentence for testing. | Obrigatório |
Exemplo de requisição
curl "https://api-language-detection.dataandapis.com/v1/detect?candidates=3&text=This%20is%20a%20simple%20English%20sentence%20for%20testing." \
-H "X-Api-Key: YOUR_API_KEY"// npm install dataandapis
import { DataAndApis } from "dataandapis";
const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY
const data = await client.languageDetection.detectLanguage({
candidates: 3,
text: "This is a simple English sentence for testing.",
});# pip install dataandapis
from dataandapis import DataAndApis
client = DataAndApis() # reads DATAANDAPIS_API_KEY
data = client.language_detection.detect_language(
candidates=3,
text="This is a simple English sentence for testing.",
){
"text_length": 47,
"detected": "eng",
"name": "English",
"reliable": true,
"candidates": [
{
"code": "eng",
"name": "English",
"score": 1
},
{
"code": "sco",
"name": "Scots",
"score": 0.8812
},
{
"code": "deu",
"name": "German",
"score": 0.7544
}
]
}



