Crypto Price Tracker This application was created for fun and you could just use CoinGecko API directly. Crypto Price Tracker uses CoinGecko API for fetching real-time prices, stores data in SQLite, and exposes an API endpoint to fetch the historical price data. It also provides a Python script to visualize this data using Matplotlib.
β¨ Features
- Real-time cryptocurrency price tracking
- Data stored in SQLite
- API endpoint for fetching historical data
- Visualization of price data over time
π Prerequisites
- Python 3.8+
- Libraries: FastAPI, Uvicorn, Requests, Matplotlib, SQLite
These requirements can be installed by running
pip install -r requirements.txt
π Project Structure
Here's a brief intro to the main files in this repository:
main.py
: Contains the FastAPI server and the endpoint that fetches data from the SQLite database.plot.py
: Fetches data from the FastAPI server and plots the cryptocurrency price over time.fetch_price.py
: Fetches the current price of the cryptocurrency from the CoinGecko API and inserts it into the SQLite database.
π Getting Started
1. Start the FastAPI server:
uvicorn main:app --reload
2. Run the script that fetches the current price and inserts it into the database:
python fetch_price.py
3. Run the script that fetches data from the FastAPI server and plots it:
python plot.py
You should see a matplotlib window pop up displaying the plot of the cryptocurrency price over time.
Contributions, issues, and feature requests are welcome!
This project is MIT licensed.