https://github.com/neeraj1240/dictionaryapi
A simple Node.js-based API that provides dictionary functionalities, including word meanings, random word generation, and random word with meaning.
https://github.com/neeraj1240/dictionaryapi
developer-tools dictionary dictionary-api express language-tools nodejs nodejs-api rest-api vocabulary-learning
Last synced: 6 months ago
JSON representation
A simple Node.js-based API that provides dictionary functionalities, including word meanings, random word generation, and random word with meaning.
- Host: GitHub
- URL: https://github.com/neeraj1240/dictionaryapi
- Owner: neeraj1240
- License: mit
- Created: 2024-11-16T05:28:47.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-05T05:38:38.000Z (9 months ago)
- Last Synced: 2025-02-07T04:38:51.276Z (8 months ago)
- Topics: developer-tools, dictionary, dictionary-api, express, language-tools, nodejs, nodejs-api, rest-api, vocabulary-learning
- Language: JavaScript
- Homepage:
- Size: 9.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dictionary API
A simple Node.js-based API that provides dictionary functionalities, including word meanings and random word generation.
---
## ✨ Features
- 🔍 Fast word lookup with detailed meanings
- 🎲 Random word generation capabilities
- 📝 Comprehensive word definitions
- ⚡ Lightweight and efficient
- 🛡️ Built-in input validation
- 🚀 Easy to integrate
- 💻 Developer-friendly responses---
## Live API
The API is live and deployed on Render. You can access it via the following URL:
**API URL**: https://dictionaryapi-mee0.onrender.com/meaning/dictionary
---
## API Endpoints
### 1. Get Word Meaning
- **URL**: `/meaning/:word`
- **Method**: `GET`
- **Description**: Returns the meaning of the specified word.
- **Examples**:
- **Request**: `/meaning/hello`
```json
{
"word": "hello",
"meaning": "A greeting or expression of goodwill."
}
```
- **Error (Invalid Input)**: `/meaning/123`
```json
{
"error": "Invalid input. Please enter a valid word."
}
```
- **Error (Word Not Found)**: `/meaning/nonexistentword`
```json
{
"error": "Word not found"
}
```---
### 2. Get a Random Word
- **URL**: `/randomWord`
- **Method**: `GET`
- **Description**: Returns a random word.
- **Example**:
- **Response**:
```json
{
"word": "serendipity"
}
```---
### 3. Get a Random Word with Meaning
- **URL**: `/randomWordWithMeaning`
- **Method**: `GET`
- **Description**: Returns a random word along with its meaning.
- **Example**:
- **Response**:
```json
{
"word": "serendipity",
"meaning": "The occurrence of events by chance in a happy or beneficial way."
}
```---
### 4. Handle Missing Word Input
- **URL**: `/meaning/`
- **Method**: `GET`
- **Description**: Informs the user to provide a word when no word is entered.
- **Example**:
- **Response**:
```json
{
"error": "Please provide a word to search for its meaning."
}
```---
## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/Dictionary-API.git
cd Dictionary-API---