A lightweight C++ REST client that fetches real-time cryptocurrency prices from the Binance public API and displays them on the terminal.
This is Version 1 using REST API only. A WebSocket (live stream) upgrade will follow in Version 2.
- Fetches real-time crypto prices (e.g., BTC/USDT, ETH/USDT) using Binance REST API
- Displays local timestamp along with price data
- Built with modular architecture each component has a dedicated responsibility
- Easily extendable for live WebSocket streaming or other exchanges
- Simple, portable, and beginner-friendly
crypto-price-fetcher/
│
├── src/
│ ├── main.cpp # Entry point – orchestrates everything
│ ├── RestClient.cpp # Handles HTTP GET requests (using libcurl)
│ ├── DataParser.cpp # Parses JSON responses and extracts key data
│ ├── TerminalUI.cpp # (Planned) Handles formatted terminal display
│
├── include/
│ ├── RestClient.hpp
│ ├── DataParser.hpp
│ ├── TerminalUI.hpp
│
├── utils/
│ ├── logger.hpp / .cpp # (Optional) Handles console and debug logs
│
├── CMakeLists.txt # Build configuration
└── README.md
Make sure you have the following installed:
- g++ / clang++
- CMake (version ≥ 3.10)
- libcurl (for REST API calls)
- nlohmann/json or any JSON parsing library
git clone https://github.com/<Enmilo-dev>/Crypto-Market-Fetcher.git
cd Crypto-Market-Fetcher
mkdir build && cd build
cmake ..
make./CryptoFetcherExample output:
[2025-10-25 18:42:03] ETH/USDT : 3962.93 USD
Using Binance REST API:
https://api.binance.com/api/v3/ticker/price?symbol=ETHUSDT
Sample Response:
{
"symbol": "ETHUSDT",
"price": "3962.93000000"
}- Add WebSocket streaming for true real-time updates
- Display data in interactive terminal UI (ncurses or rich CLI)
- Add support for multiple exchanges (Coinbase, Kraken, etc.)
- Add config file for user-defined refresh rate and symbol list
Enmilo
Built as a learning and practical project on C++ REST APIs and financial data integration.