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) orto_hinglish(Hindi → Hinglish). Defaultto_hindi.grammar:truefixes है / हैं / हूँ after मैं, तुम, हम, आप. Defaultfalse.unsure:guess(best guess) orleave(unknown words stay as typed). Defaultguess.adult:trueallows adult words in the output. Defaultfalse.keep_caps:truekeeps words typed in CAPITALS as typed. Defaultfalse.keep_english:truekeeps the words in your My English words list as typed. Defaultfalse.
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 adirectionthat is notto_hindiorto_hinglish. - 400
rest_missing_callback_param: Notextin 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 theRetry-Afterheader. - 503
aksharkosh_converter_down: The converter isn’t answering; no words were used. Try again in a minute.
