Skip to content

A free, open-source API for accessing word definitions, synonyms, antonyms, and more. Perfect for developers and language enthusiasts.

License

Notifications You must be signed in to change notification settings

SH20RAJ/OpenDictionaryAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

A free, open-source API for accessing word definitions, synonyms, antonyms, and more. Perfect for developers and language enthusiasts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages