opendictionaryapi v1.0.0
OpenDictionaryAPI šš
OpenDictionaryAPI is a free and open-source API that provides access to word definitions, synonyms, antonyms, pronunciations, and more. š§āš» Perfect for developers and language enthusiasts who want to integrate dictionary data into their applications. š
Features š
- š Word Definitions: Accurate and detailed meanings for words.
- š Synonyms and Antonyms: Explore related words and opposites.
- š§ Pronunciations: Access audio pronunciations to improve your skills.
- š Multiple Languages: Look up words in different languages.
- ā” Fast & Reliable: Built to deliver fast and consistent responses.
Installation & Usage (NPM) š
Install the package from npm:
npm i opendictionaryapi
Example Usage:
const OpenDictionaryAPI = require("opendictionaryapi");
OpenDictionaryAPI.search('hi', 'en')
.then(results => {
console.log(results);
})
.catch(error => {
console.log(error);
});
Results Example:
[
{
"word": "hello",
"phonetics": [
{
"audio": "https://api.dictionaryapi.dev/media/pronunciations/en/hello-au.mp3",
"sourceUrl": "https://commons.wikimedia.org/w/index.php?curid=75797336",
"license": {
"name": "BY-SA 4.0",
"url": "https://creativecommons.org/licenses/by-sa/4.0"
}
}
],
"meanings": [
{
"partOfSpeech": "noun",
"definitions": [
{
"definition": "\"Hello!\" or an equivalent greeting."
}
]
}
],
"sourceUrls": [
"https://en.wiktionary.org/wiki/hello"
]
}
]
Error Example:
{
"title": "No Definitions Found",
"message": "Sorry pal, we couldn't find definitions for the word you were looking for.",
"resolution": "You can try the search again at a later time or head to the web instead."
}
Direct API Usage š
You can also directly fetch word data via the URL:
https://www.jsdelivr.com/package/gh/SH20RAJ/OpenDictionaryAPI/data/english/{word}.json
Example:
Fetch data for the word "hello":
https://cdn.jsdelivr.net/gh/SH20RAJ/OpenDictionaryAPI/data/english/hello.json
Installation & Development š ļø
- Clone the repository:
git clone https://github.com/SH20RAJ/OpenDictionaryAPI.git
- Install dependencies:
npm install
- Run the server:
npm start
Contributing š¤
We welcome contributions from the community! š ļø To get started:
1. Fork the repository.
2. Create a new branch: git checkout -b feature-name
.
3. Commit your changes: git commit -m "Added new feature"
.
4. Push to your branch: git push origin feature-name
.
5. Submit a pull request. š
License š
This project is licensed under the MIT License.
Contact āļø
For questions or support, please reach out via Issues.
ā If you find this project helpful, give it a star! ā
7 months ago