A clean, modular Flask-based Currency Converter API that fetches real-time exchange rates using the Frankfurter API.
- Convert between any two currencies
- Real-time exchange rates
- Clean and scalable project structure
- Error handling for invalid inputs
- Lightweight and easy to extend
currency-converter-api/
│
├── app/
│ ├── routes/ # API endpoints
│ ├── services/ # Business logic
│ ├── utils/ # External API calls
│ └── config/ # Configuration
│
├── tests/ # Unit tests
├── run.py # Entry point
├── requirements.txt
├── README.md
└── documentation.md
git clone https://github.com/gopal092003/currency-converter-API.git
cd currency-converter-APIpython -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windowspip install -r requirements.txtpython run.pyServer will start at:
http://127.0.0.1:5000
Endpoint:
GET /convert
Example Request:
/convert?amount=100&from=USD&to=INR
Example Response:
{
"from": "USD",
"to": "INR",
"amount": 100,
"rate": 93.43,
"converted": 9343
}| Status Code | Description |
|---|---|
| 400 | Invalid input (amount/currency) |
| 500 | Internal server error |
python -m unittest discover tests- Flask
- Requests
- Add
/currenciesendpoint - Add caching (Redis / in-memory)
- Batch currency conversion
- Docker support
- Deploy to cloud (Render / AWS)
Powered by:
- Frankfurter Exchange Rate API
Gopal Gupta
- GitHub: https://github.com/gopal092003
If you like this project:
- ⭐ Star the repo
- 🍴 Fork it
- 🧠 Use it in your own projects
=======
-Frankfurter Exchange Rates API
- Add
/currenciesendpoint to list supported currencies. - Support batch conversion (one-to-many).
- Add caching for faster repeated requests.
- Dockerize the application for easy deployment.
