This document provides technical documentation for developers using the Dictionary API.
http://127.0.0.1:8000
Health check endpoint to verify that the API is running.
GET
{
"message": "Dictionary API is running 🚀",
"usage": "/define/{word}"
}Fetch meanings and synonyms for a given word.
GET
| Parameter | Type | Required | Description |
|---|---|---|---|
word |
string | Yes | Word to search |
GET /define/apple{
"word": "apple",
"meanings": [
"A common, round fruit produced by the tree Malus domestica."
],
"synonyms": [
"orchard apple tree",
"malus pumila"
]
}| Field | Type | Description |
|---|---|---|
word |
string | Queried word |
meanings |
list | List of definitions |
synonyms |
list | List of synonyms |
Returned when:
- The word does not exist in the dictionary API
Example:
{
"detail": "Word 'xyzabc' not found"
}Returned when:
- External API fails
- Unexpected server issues occur
Example:
{
"detail": "Internal server error"
}Client Request
↓
FastAPI Route (/define/{word})
↓
Service Layer (dictionary_service)
↓
External API Calls
├── Dictionary API (meanings)
└── Datamuse API (synonyms)
↓
Processed Response Returned
https://api.dictionaryapi.dev/api/v2/entries/en/{word}
Used for:
- Word meanings
- Definitions
https://api.datamuse.com/words?rel_syn={word}
Used for:
- Synonyms
http://127.0.0.1:8000/define/apple
curl http://127.0.0.1:8000/define/applehttp://127.0.0.1:8000/docs
- Only English words are supported
- Case-insensitive input (handled internally)
- No caching (each request hits external APIs)
- No rate limiting
- Depends on availability of third-party APIs
- Limited metadata (no phonetics or examples yet)
- Add
/antonyms/{word}endpoint - Add phonetics and pronunciation
- Add caching layer (Redis / in-memory)
- Add request validation and rate limiting
- Deploy to cloud platform
- API follows REST principles
- Responses are JSON formatted
- Designed with modular architecture for scalability