Docs / Language and text

Translation API

Translate between English and 22 Indian languages with IndicTrans2.

Machine translation by AI4Bharat's IndicTrans2 (distilled models), between English and Assamese, Bengali, Bodo, Dogri, Gujarati, Hindi, Kannada, Kashmiri, Konkani, Maithili, Malayalam, Manipuri, Marathi, Nepali, Odia, Punjabi, Sanskrit, Santali, Sindhi, Tamil, Telugu and Urdu. Between two Indian languages the text goes through English. Web and e-mail addresses and long numbers are kept as they are. Nothing you send is kept or logged.

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

Translate text

GET/v1/translatePOST

Translates a sentence at a time and returns the whole translation and each sentence. Up to 2,000 characters and 30 sentences. Write Indian languages in their own script.

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

Model endpoint: it will need a free API key, sent as Authorization: Bearer <key> or X-API-Key. Until the date on API keys it answers without one and says so in the X-Key-Notice header. With a key: 500 model requests a day.

What you send here is never written to the log, and the answer is not cached.

ParameterDescription
textqueryThe text (or POST it).
fromquery, requiredThe language of the text: en, or a code from /v1/translate/languages such as hi or ta.
toquery, requiredThe language to translate into.

curl

curl "https://api.dharun.dev/v1/translate?from=en&to=ta&text=The+train+to+Chennai+leaves+at+6+pm.+Please+reach+the+station+early.&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/translate?from=en&to=ta&text=The+train+to+Chennai+leaves+at+6+pm.+Please+reach+the+station+early.&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/translate?from=en&to=ta&text=The+train+to+Chennai+leaves+at+6+pm.+Please+reach+the+station+early.&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": {
    "from": "eng_Latn",
    "to": "tam_Taml",
    "sentences": [
      "சென்னைக்கு செல்லும் ரயில் மாலை 6 மணிக்கு புறப்படுகிறது.",
      "தயவுசெய்து முன்கூட்டியே நிலையத்தை அடையவும்."
    ],
    "via_english": false,
    "truncated": [],
    "translation": "சென்னைக்கு செல்லும் ரயில் மாலை 6 மணிக்கு புறப்படுகிறது. தயவுசெய்து முன்கூட்டியே நிலையத்தை அடையவும்."
  },
  "meta": {
    "source": {
      "name": "IndicTrans2 distilled 200M (int8)",
      "url": "https://github.com/AI4Bharat/IndicTrans2",
      "licence": "MIT",
      "version": "indictrans2-dist-200M@models-2026-10",
      "retrieved": "2026-10-15T12:28:44Z",
      "attribution": "Translation by IndicTrans2 (AI4Bharat, Gala et al., 2023), MIT."
    },
    "note": "Machine translation by IndicTrans2; names, numbers and technical terms deserve a check."
  }
}

Languages

GET/v1/translate/languages

Every language with its short code and FLORES-200 code; either can be used as from and to.

curl

curl "https://api.dharun.dev/v1/translate/languages?utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/translate/languages?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/translate/languages?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": [
    {
      "code": "asm_Beng",
      "short": "as",
      "name": "Assamese"
    },
    {
      "code": "ben_Beng",
      "short": "bn",
      "name": "Bengali"
    },
    {
      "code": "brx_Deva",
      "short": "brx",
      "name": "Bodo"
    }
  ],
  "meta": {
    "total": 26,
    "note": "Use short or code as from and to. Between two Indian languages the text is translated through English."
  }
}

Data source

IndicTrans2 distilled 200M (int8), indictrans2-dist-200M@models-2026-10. Retrieved 2026-10-15T12:28:44Z. Licence: MIT. Translation by IndicTrans2 (AI4Bharat, Gala et al., 2023), MIT.

Guides

Translate app content into Indian languages

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.