Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪙 Crypto Price Fetcher (C++)

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.


🚀 Features

  • 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

🧩 Project Structure

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

⚙️ Setup & Build

Prerequisites

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

Build Steps

git clone https://github.com/<Enmilo-dev>/Crypto-Market-Fetcher.git
cd Crypto-Market-Fetcher
mkdir build && cd build
cmake ..
make

Run

./CryptoFetcher

Example output:

[2025-10-25 18:42:03]  ETH/USDT : 3962.93 USD

🔧 Example API Endpoint

Using Binance REST API:

https://api.binance.com/api/v3/ticker/price?symbol=ETHUSDT

Sample Response:

{
  "symbol": "ETHUSDT",
  "price": "3962.93000000"
}

🧠 Next Version (Planned)

  • 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

👨‍💻 Author

Enmilo
Built as a learning and practical project on C++ REST APIs and financial data integration.


About

High-performance CLI tool ingesting live crypto market prices via cURL with concurrent API calls using thread pooling for minimal latency.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages