AksharKosh API

Convert Hinglish to Hindi (or Hindi to Hinglish) from your own code. The API comes with the monthly plan or a word pack, and uses the same words as the converter page: every word you send is counted. API calls use only your plan and pack words, never the free daily words.

1. Make a key

Go to My Account › API keys and press Create key. Copy the key straight away: we only keep a fingerprint of it, so it can’t be shown again. You can have up to 5 keys and delete any of them.

Keep the key on your server. Don’t put it in a web page or an app that others can download.

2. Send text

curl https://aksharkosh.com/wp-json/aksharkosh/v1/api/convert \
  -H "X-API-Key: ak_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "mai ghar ja raha hu"}'

Fields (all optional except text):

  • text: Your text, up to 20,000 words (required).
  • direction: to_hindi (Hinglish → Hindi) or to_hinglish (Hindi → Hinglish). Default to_hindi.
  • grammar: true fixes है / हैं / हूँ after मैं, तुम, हम, आप. Default false.
  • unsure: guess (best guess) or leave (unknown words stay as typed). Default guess.
  • adult: true allows adult words in the output. Default false.
  • keep_caps: true keeps words typed in CAPITALS as typed. Default false.
  • keep_english: true keeps the words in your My English words list as typed. Default false.

Your personal dictionary (My Account › My dictionary) is always used.

3. The answer

{
  "text": "मैं घर जा रहा हूँ",
  "word_count": 5,
  "charged": 5,
  "direction": "to_hindi",
  "words": [ { "latin": "mai", "output": "मैं", "candidates": ["मैं", "मै"], "unsure": false } ],
  "usage": { "monthly_left": 499995, "pack_left": 0 }
}

words lists each word with the other choices we know (candidates) and whether we are unsure of it. The word as you sent it is in latin for to_hindi and in hindi for to_hinglish; output is our answer for it.

Errors

  • 400 rest_invalid_param: A bad option value, for example a direction that is not to_hindi or to_hinglish.
  • 400 rest_missing_callback_param: No text in the request.
  • 401 aksharkosh_api_key: No key, or a key that doesn’t exist.
  • 402 aksharkosh_api_words: Your plan and pack words are fewer than the words in this call. Buy a word pack, or wait for your plan to renew.
  • 403 aksharkosh_api_paid: Your plan has ended and you have no pack words.
  • 413 aksharkosh_too_long: Too many words for one call.
  • 429 aksharkosh_rate_limit: More than 60 calls in a minute (shared with your own use of the converter page); wait the seconds in the Retry-After header.
  • 503 aksharkosh_converter_down: The converter isn’t answering; no words were used. Try again in a minute.