Detect languages for up to 100 texts

Detects the language of up to 100 texts in one call.

Request

POSThttps://language-detection.p.apihiver.com/v1/detect/batch

JSON object. Required: texts.

Request Body

Edit the values below to test different scenarios.

Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.

Language
Client
1curl --request POST \
2  --url https://language-detection.p.apihiver.com/v1/detect/batch \
3  --header 'Accept: application/json' \
4  --header 'Content-Type: application/json' \
5  --header 'X-API-Key: YOUR_API_KEY' \
6  --data '{
7  "texts": [
8    "Hello world",
9    "Hola amigo"
10  ]
11}'

Detect languages for up to 100 texts: Language Detection & Transliteration API reference

Detects the language of up to 100 texts in one call. This endpoint is part of the Language Detection & Transliteration API: Detect the language of any text (55 languages), transliterate Indian scripts (नमस्ते → namaste) and identify writing scripts.

Example response (200, application/json)

Success.

1{
2  "results": [
3    {
4      "text": "Hello world",
5      "language": "en",
6      "reliable": false,
7      "candidates": [
8        {
9          "language": "en",
10          "confidence": 0.5714,
11          "language_name": "English"
12        },
13        {
14          "language": "nl",
15          "confidence": 0.4286,
16          "language_name": "Dutch"
17        }
18      ],
19      "confidence": 0.5714,
20      "language_name": "English"
21    },
22    {
23      "text": "Hola amigo",
24      "language": "so",
25      "reliable": false,
26      "candidates": [
27        {
28          "language": "so",
29          "confidence": 1,
30          "language_name": "Somali"
31        }
32      ],
33      "confidence": 1,
34      "language_name": "Somali"
35    }
36  ]
37}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "texts: Field required"
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.