1.0.0 • Published 7 months ago

opendictionaryapi v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

OpenDictionaryAPI šŸŒŸšŸ“š

License: MIT Contributions Welcome Issues Forks Stars NPM Version Visitors

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 šŸ› ļø

  1. Clone the repository:
    git clone https://github.com/SH20RAJ/OpenDictionaryAPI.git
  2. Install dependencies:
    npm install
  3. 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! ⭐