A Python-based server that fetches real-time and historical cryptocurrency market data from major exchanges using the CCXT library. It provides API endpoints built with FastAPI for accessing price quotes and OHLCV (candlestick) data.
This project aims to build a simple but robust server that:
- Retrieves live cryptocurrency prices for various trading pairs.
- Fetches historical market data in OHLCV format with configurable timeframes.
- Implements caching to reduce unnecessary repeated API calls.
- Provides clear and reliable API endpoints with error handling.
- Uses asynchronous programming with FastAPI for better performance.
- Real-time price quote API endpoint (
/quote). - Historical candlestick data API endpoint (
/history). - Supports Binance, Kraken, and Coinbase Pro exchanges.
- In-memory caching with 60 seconds TTL.
- Handles errors gracefully and returns meaningful HTTP responses.
- Basic test coverage included.
- Having Python Updated Version
Install required Python packages:
pip install fastapi uvicorn ccxt cachetools pydantic
What I Learned 1.How to use APIs from different crypto exchanges collectively with CCXT. 2.Building fast and asynchronous web servers with FastAPI. 3.Handling common software problems like errors and caching. 4.Organizing Python code in a clean, modular way following best practices.