Docs › Language and text
Transliteration API
Rewrite text between Indian scripts and Roman letters.
Converts by rule between Devanagari, Bengali, Gurmukhi, Gujarati, Odia, Tamil, Telugu, Kannada and Malayalam, and to ISO 15919, IAST or plain ASCII. ISO 15919 and IAST can also be turned back into any of the scripts. The spelling changes, not the language: this is not translation. Casual Roman typing (vanakkam) cannot be converted by rule and is not accepted as input.
Transliterate text
GET/v1/transliteratePOST
Also takes POST: The text. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.
What you send here is never written to the log, and the answer is not cached.
| Parameter | Description |
|---|---|
textquery | The text (or POST it). Letters of other scripts pass through unchanged. |
toquery, required | A script (devanagari, bengali, gurmukhi, gujarati, odia, tamil, telugu, kannada, malayalam), a language code such as ta or hi, or iso15919, iast, ascii. |
fromquery | auto (default: the script of the text), a script, or iso15919 or iast for romanised input. |
curl
curl "https://api.dharun.dev/v1/transliterate?to=tamil&text=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87+%E0%A4%AD%E0%A4%BE%E0%A4%B0%E0%A4%A4"JavaScript
const response = await fetch("https://api.dharun.dev/v1/transliterate?to=tamil&text=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87+%E0%A4%AD%E0%A4%BE%E0%A4%B0%E0%A4%A4");
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/transliterate?to=tamil&text=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87+%E0%A4%AD%E0%A4%BE%E0%A4%B0%E0%A4%A4", timeout=10)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])Response
{
"data": {
"text": "நமஸ்தே பாரத",
"from": "devanagari",
"to": "tamil"
},
"meta": {
"note": "Converted by rule, letter by letter: the spelling changes, not the language. Letters a script lacks become the nearest one it has."
}
}Using an AI assistant? Connect the MCP server and it can call this API by itself.