Which writing systems (scripts) a text uses, with proportions

Identifies the writing scripts in a text (Latin, Devanagari, Tamil…) and their share of characters.

Request

POSThttps://language-detection.p.apihiver.com/v1/script

JSON object. Required: text.

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/script \
3  --header 'Accept: application/json' \
4  --header 'Content-Type: application/json' \
5  --header 'X-API-Key: YOUR_API_KEY' \
6  --data '{
7  "text": "नमस्ते hello"
8}'

Which writing systems (scripts) a text uses, with proportions: Language Detection & Transliteration API reference

Identifies the writing scripts in a text (Latin, Devanagari, Tamil…) and their share of characters. 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  "mixed": true,
3  "scripts": [
4    {
5      "share": 0.5556,
6      "script": "Latin",
7      "characters": 5
8    },
9    {
10      "share": 0.4444,
11      "script": "Devanagari",
12      "characters": 4
13    }
14  ],
15  "primary_script": "Latin"
16}

Errors

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

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