This repo includes a simple finance recommendation site using Cryptocompare and OpenAI API.
This project is a web-based tool that fetches and displays cryptocurrency data, including real-time prices and historical trends, and provides AI-generated trading advice using the OpenAI API.
- Fetch Coin List: Displays a list of available cryptocurrencies along with their symbols, names, and algorithms.
- Historical Price Chart: Plots the price of a selected cryptocurrency over the last 7 days.
- AI-Generated Trading Advice: Uses OpenAI's GPT-3.5-turbo model to provide trading advice based on the latest cryptocurrency data.
- Flask: A lightweight WSGI web application framework.
- OpenAI API Key: To interact with OpenAI's models.
-
Clone the repository:
git clone https://github.com/Umit-Yilmaz/CryptoAdvisorBot.git cd crypto-analysis-tool
-
Install Python dependencies:
pip install -r requirements.txt
-
Install JavaScript dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the project root and add your API keys:OPENAI_API_KEY=your_openai_api_key CRYPTOCOMPARE_API_KEY=your_cryptocompare_api_key
-
Start the Flask server: Go to project directory and write:
python app.py
-
Open the web application:
Open
index.html
in your web browser or start a local server using Node.js or just clicking:npm start
-
Fetch Cryptocurrency Data:
-
Generate AI Trading Report:
- GET
/process
: Fetches the cryptocurrency data and generates an AI trading report.
- Cryptocompare API Errors: If the cryptocurrency data cannot be fetched, an error message will be displayed.
- OpenAI API Errors: If the AI report generation fails, an error message with details will be shown.
- API Limits: Ensure that you monitor your API usage and do not exceed the rate limits set by OpenAI and Cryptocompare (which I've encountered this problem before)
- CORS Issues: If running on a different domain, ensure that CORS is properly configured in the Flask app.
This project is licensed under the MIT License. See the LICENSE
file for more details.