Vocara Dictionary
25 Mar 2025 | MrLwitwma
What is an API?
Just for quick information, an API key is a digital key (which are just some random numbers, letters and symbols) which helps programers to get data from a pre-existing program without actually creating the program for getting that data. Example Map API (provides developers with maps without the developer explicitely making their own map)
Follow this Steps to create an API key:
- Go to dictionary.bitmindai.in
- Then find API at the top right header, then click it
- Provide your email address
- Get the api key then click how to use, you will get a js code then use it.
So this was the straight forward explaination of how to create and use our API key.
Steps Explaination in details:
Creation of an API:
For Creating an API you would need to go to the site dictionary.bitmindai.in.
Then find a link with "API" written on it, located at the top left of the header bar.
Then you will be redirected to platform.bitmindai.in,
then enter your email address and click "Generate API Key"
Then you will be provided with an API key, copy the API key and keep it safe as you can't get back your API key once generated.
Using the API Key:
After generating API key click "How to use" button on clicking it you will get to know all the codes and the routes where and how the data should be fetched.
Paste one of the following js to your html file.
<script src="https://platform.bitmindai.in/static/api.js"></script>
<script>
function loadScript(src, callback) {
const script = document.createElement("script");
script.src = src;
script.onload = callback;
document.head.appendChild(script);
}
loadScript("https://platform.bitmindai.in/static/api.js", async function () {
const apiKey = "YOUR_API_KEY_HERE"; // Replace with your actual API key
const word = "example";
try {
const suggestions = await matchWord(word, apiKey);
console.log("Suggestions:", suggestions);
} catch (error) {
console.error("Error:", error);
}
});
</script>
Both the functions takes in two parameter, first is the word and then the other is the API key.
Exmaple: matchWord("ap", "thisisanexmpleapikey") Here in response you will get 3 words form the datas.
Deeper into the data response and how to set up the frontend for this datas.
Using the getWord() function you can get the following data:
The backend returns:
jsonify({"word": word, "data": word_data})
An Example of the response json
{
"word": "example",
"data": {
"bird": {
"noun": {
"translation": "दाउ",
"definition": [
[
"A warm-blooded egg-laying vertebrate animal distinguished by feathers, wings, and a beak, typically able to fly."
],
["मोनसे गुदुं थै गोनां दावदै होग्रा भार्टिब्रेट जुनार जाय गां, गां आरो मासे बिखुंजों फाराग खालामजायो, जाय सरासनस्रायै बिरनो हायो।"]
],
"synonym": [
[
"sparrow",
"eagle",
"crow",
"parrot",
"pigeon"
],
["गौरैया",
"गोरख",
"दावखा",
"बाट'",
"फारौ"]
],
"antonym": [
[],
[]
],
"examples": [
[
"The bird flew across the sky."
],
["दाउआ अख्रां बारनानै बिरलांदोंमोन।"]
],
"usage": [
[
"The bird flew across the sky."
],
["दाउआ अख्रां बारनानै बिरलांदोंमोन।"]
],
"audio": [
[],
[]
]
},
"author": "BitMindAI"
}
}
}
The getWord() function which is with the js returns a data. To use the program you can do.
data = getWord()
word = data.word
dictionary_data = data.data
translation = data.data.noun.translation
definition = data.data.noun.definition[0]
synonym = data.data.noun.synonym[0]
antonym = data.data.noun.antonym[0]
example = data.data.noun.examples[0]
usage = data.data.noun.usage[0]
If you look into the code can see me giving index in all except translation. As translation is a string and all the others are a list of list of strings or list[list[str]]
If you have any more issue. Please contact [email protected], we are ever ready to respond to your service within 24 Hours 😊