Explore this comprehensive API for Bitcoin price analysis, featuring historical data and real-time updates from major exchanges. Built with FastAPI, Python and PostgreSQL, this open-source project is optimised for efficiency and scalability catering to developers, traders and analysts. Contribute and collaborate to enhance functionality.
OTHER License
As a Data Scientist with 3 years of experience, I am expanding my skill set to include FastAPI, a modern web framework for building APIs with Python. This repository serves as my first project based on my previous work on Bitcoin Price Analysis Before the 2024 Halving. This comprehensive API provides both historical and real-time Bitcoin price analysis, designed to be a valuable resource for developers, traders and analysts. The project is built with a focus on efficiency, scalability, and reliability, using FastAPI, PostgreSQL and real-time data integration with multiple cryptocurrency exchanges.
If you find this project useful, kindly consider giving it a star ⭐ on GitHub. Contributions are also welcome as it is intended for open-source collaboration!
The Bitcoin Price Analysis and Real-Time Data API offers a comprehensive solution for accessing both historical and real-time Bitcoin prices. The API is built with FastAPI, leveraging its speed and ease of use and integrates multiple cryptocurrency exchanges to provide up-to-date market data.
git clone https://github.com/your-username/Bitcoin-Price-Analysis-API.git
cd Bitcoin-Price-Analysis-API
python -m venv BTC_Price_API
source BTC_Price_API/bin/activate # For Linux/MacOS
BTC_Price_API\Scripts\activate # For Windows
pip install -r requirements.txt
uvicorn main:app --reload
- **GET /root/**
- Description: Provides an overview of the API including a list of available endpoints and their descriptions.
- Route: `/api/0.1.0/root/`
- **GET /prices/**
- Description: Retrieves all historical Bitcoin prices from the PostgreSQL database.
- Route: `/api/prices/`
- **GET /prices/{year}**
- Description: Fetches Bitcoin prices for a specific year by providing the year as a parameter in the URL.
- Route: `/api/prices/{year}`
- **GET /prices/halving/{halving_number}**
- Description: Provides Bitcoin price data around specific halving events.
- Route: `/api/prices/halving/{halving_number}`
- **GET /historical/prices/statistics**
- Description: Provides statistical analysis of Bitcoin prices (e.g., average, highest, lowest).
- Route: `/api/historical/prices/statistics`
- **GET /coingecko**
- Description: Fetches the current Bitcoin price from the CoinGecko platform.
- Route: `/api/coingecko`
- **GET /coincap**
- Description: Fetches the latest Bitcoin price from CoinCap.
- Route: `/api/coincap`
- **GET /prices/binance**
- Description: Retrieves the most recent Bitcoin price from the Binance exchange.
- Route: `/api/prices/binance`
- **GET /kraken**
- Description: Fetches the most recent Bitcoin price from the Kraken exchange.
- Route: `/api/kraken`
The API integrates with multiple cryptocurrency exchanges (Bybit, Binance, Kucoin and Coinbase) to provide real-time Bitcoin prices. This allows for up-to-date market analysis and decision-making.
Contributions are welcome! Please read the contributing guidelines for details on how to contribute.
- Fork the repository.
- Create a new feature branch (git checkout -b feature-name).
- Commit your changes (git commit -m 'Add some feature').
- Push to the branch (git push origin feature-name).
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries or feedback please contact me at https://nafisalawalidris.github.io/13/.