A modular FastAPI-based REST API to fetch word meanings and synonyms using external APIs like DictionaryAPI and Datamuse.
- Fetch word meanings
- Retrieve synonyms
- FastAPI interactive docs (Swagger UI)
- Clean architecture (routes, services, utils)
- Scalable and easy to extend
FastAPI provides built-in docs:
dictionary-api/
│
├── app/
│ ├── routes/ # API endpoints
│ ├── services/ # Business logic
│ ├── utils/ # External API calls
│ └── config/ # Settings
│
├── tests/ # Unit tests
├── run.py # Entry point
├── requirements.txt
└── README.md
git clone https://github.com/gopal092003/Dictionary-API.git
cd Dictionary-APIpython -m venv venv
venv\Scripts\activate # Windowspip install -r requirements.txtpython run.pyServer will start at:
http://127.0.0.1:8000
GET /
GET /define/{word}
Example:
/define/apple
{
"word": "apple",
"meanings": [
"A common, round fruit produced by the tree Malus domestica."
],
"synonyms": [
"orchard apple tree",
"malus pumila"
]
}- Dictionary API (dictionaryapi.dev)
- Datamuse API (for synonyms)
| Status Code | Description |
|---|---|
| 404 | Word not found |
| 500 | Internal server error |
pytest(or use unittest if configured)
- FastAPI
- Uvicorn
- Requests
- Add antonyms endpoint
- Add phonetics and pronunciation
- Add caching (Redis / in-memory)
- Deploy to cloud (Render / AWS)
Gopal Gupta
- GitHub: https://github.com/gopal092003
If you like this project:
- ⭐ Star the repo
- 🍴 Fork it
- 🚀 Use it in your own apps

