Docs / Language and text

Indic text tools API

Letters as readers count them, dictionary order, look-alike fixes, braille and keyboard layouts.

For text in Indian scripts: split into aksharas and count them, sort words in a language's dictionary order, repair sequences that only look like a letter, write Bharati braille, and convert between QWERTY keys and the InScript and Tamil99 layouts.

Base URL https://api.dharun.devNo key needed for most600 units a minute, 3000 with a free keyThis page as Markdown

Split into letters and count them

GET/v1/indic/aksharasPOST

Also takes POST: The text, as text/plain or JSON {"text": "..."}. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

ParameterDescription
textqueryThe text.

curl

curl "https://api.dharun.dev/v1/indic/aksharas?text=%E0%A4%95%E0%A5%8D%E0%A4%B7%E0%A4%A4%E0%A5%8D%E0%A4%B0%E0%A4%BF%E0%A4%AF&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/indic/aksharas?text=%E0%A4%95%E0%A5%8D%E0%A4%B7%E0%A4%A4%E0%A5%8D%E0%A4%B0%E0%A4%BF%E0%A4%AF&utm_medium=docs");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/indic/aksharas?text=%E0%A4%95%E0%A5%8D%E0%A4%B7%E0%A4%A4%E0%A5%8D%E0%A4%B0%E0%A4%BF%E0%A4%AF&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Response, with lists and long text shortened

{
  "data": {
    "aksharas": [
      "क्ष",
      "त्रि",
      "य"
    ],
    "count": {
      "aksharas": 3,
      "codePoints": 8,
      "words": 1,
      "bytesUTF8": 24
    }
  },
  "meta": {
    "note": "Aksharas are the letters a reader counts: a consonant with its vowel sign, and conjuncts as one (क्ष). In Tamil a consonant with pulli (க்) counts as its own le…"
  }
}

Dictionary order

GET/v1/indic/sortPOST

Also takes POST: JSON {"words": [...], "lang": "ta"}. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

ParameterDescription
wordsqueryWords separated by commas.
langqueryhi, ta, bn, te, kn, ml, mr, gu, pa, or or en. Default hi.

curl

curl "https://api.dharun.dev/v1/indic/sort?lang=ta&words=%E0%AE%95%E0%AE%9F%E0%AE%B2%E0%AF%8D,%E0%AE%85%E0%AE%AE%E0%AF%8D%E0%AE%AE%E0%AE%BE,%E0%AE%86%E0%AE%B1%E0%AF%81&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/indic/sort?lang=ta&words=%E0%AE%95%E0%AE%9F%E0%AE%B2%E0%AF%8D,%E0%AE%85%E0%AE%AE%E0%AF%8D%E0%AE%AE%E0%AE%BE,%E0%AE%86%E0%AE%B1%E0%AF%81&utm_medium=docs");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/indic/sort?lang=ta&words=%E0%AE%95%E0%AE%9F%E0%AE%B2%E0%AF%8D,%E0%AE%85%E0%AE%AE%E0%AF%8D%E0%AE%AE%E0%AE%BE,%E0%AE%86%E0%AE%B1%E0%AF%81&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Response

{
  "data": {
    "lang": "ta",
    "words": [
      "அம்மா",
      "ஆறு",
      "கடல்"
    ]
  },
  "meta": {
    "note": "Dictionary order by Unicode's collation rules (CLDR) for the language."
  }
}

Fix look-alike letters

GET/v1/indic/normalisePOST

Also takes POST: The text, as text/plain or JSON {"text": "...", "strip": "true"}. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

ParameterDescription
textqueryThe text.
stripqueryAlso remove zero-width characters.

curl

curl "https://api.dharun.dev/v1/indic/normalise?text=%E0%A4%85%E0%A4%BE%E0%A4%AE&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/indic/normalise?text=%E0%A4%85%E0%A4%BE%E0%A4%AE&utm_medium=docs");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/indic/normalise?text=%E0%A4%85%E0%A4%BE%E0%A4%AE&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Response, with lists and long text shortened

{
  "data": {
    "changed": true,
    "fixes": [
      {
        "from": "अा",
        "to": "आ",
        "why": "a + aa sign drawn as the letter aa"
      }
    ],
    "text": "आम"
  },
  "meta": {
    "note": "Unicode NFC, then sequences that only look like a letter (अ + ा for आ, old Malayalam chillu forms, a doubled virama) replaced by the letter. strip=true also rem…"
  }
}

Bharati braille

GET/v1/braillePOST

Text in any Indian script (and digits) as Unicode braille cells, Grade 1. Check with a braille reader before printing for others.

Also takes POST: The text, as text/plain or JSON {"text": "..."}. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

ParameterDescription
textqueryThe text, up to 5,000 characters.

curl

curl "https://api.dharun.dev/v1/braille?text=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/braille?text=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87&utm_medium=docs");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/braille?text=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Response, with lists and long text shortened

{
  "data": {
    "braille": "⠝⠍⠎⠈⠞⠑",
    "cells": 6,
    "script": "devanagari",
    "unwritten": []
  },
  "meta": {
    "note": "Bharati braille, Grade 1, as Unicode braille cells. Other Indian scripts are written by sound through Devanagari, as Bharati braille intends. Check with a brail…"
  }
}

QWERTY keys and Indian layouts

GET/v1/keyboard/convertPOST

type: what pressing those QWERTY keys gives on the layout (to fix text typed with the wrong keyboard on). keys: the keys to press to type a text.

Also takes POST: The text, as text/plain or JSON {"text": "...", "layout": "tamil99", "direction": "type"}. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

ParameterDescription
textqueryKeys, or text.
layoutqueryDefault inscript-hindi. One of: inscript-hindi, tamil99.
directionqueryDefault type. One of: type, keys.

curl

curl "https://api.dharun.dev/v1/keyboard/convert?layout=tamil99&text=vphhkf&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/keyboard/convert?layout=tamil99&text=vphhkf&utm_medium=docs");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/keyboard/convert?layout=tamil99&text=vphhkf&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Response

{
  "data": {
    "keys": "vphhkf",
    "layout": "tamil99",
    "text": "வணக்கம்"
  },
  "meta": {
    "note": "What typing those QWERTY keys gives with the layout switched on: the fix for text typed with the wrong keyboard selected."
  }
}

Using an AI assistant? Connect the MCP server and it can call this API by itself. Want every endpoint on one bench? Open the playground.