Welcome to the Stock Analysis API project using uAgents! This project leverages uAgents to provide detailed stock information, news, and analysis based on fundamental and quarterly results.
- Features
- Installation
- Usage
- uAgents Endpoints
- Running the Flask App
- Running the Streamlit App
- Contributing
- License
- Search Stock Using Google Finance: Get detailed information about a specific stock.
- Get Stock News By Scraping Google Finance: Retrieve 5 recent news related to a specific stock.
- Get Stock Data From Yahoo Finance: Get Fundamental data like PE, EPS and last 3 quarter result.
- Analysis using Gemini: Perform analysis on a stock based on its fundamentals and quarterly results on Gemini 1.0 Pro.
-
Clone the repository:
git clone https://github.com/your/repository.git cd StockAdvisor/Backend/agent -
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Run all agents:
cd agents python get_stock.py python get_news.py python get_analysis.py -
Run the Flask app:
cd .. python app.py
-
Ensure the backend is running:
python app.py
-
Access the endpoints:
- Get Stock Data:
GET /api/stocks/<stock_name> - Perform Analysis:
GET /api/analysis/<stock_symbol> - Perform Analysis:
GET /api/news/<stock_symbol>
- Get Stock Data:
The uAgents handle specific types of requests related to stocks. Here are the main agents and their functionalities:
- Stock Agent: Retrieves stock data based on the stock name.
- News Agent: Provides news related to a stock symbol.
- Analysis Agent: Performs analysis based on stock fundamentals and quarterly results.
To run the Streamlit frontend, follow these steps:
-
Navigate to the repository root:
cd StockAdvisor/frontend -
Ensure the backend is running:
-
Run the Streamlit app:
streamlit run streamlit_app.py
-
Access the Streamlit app: Open your browser and go to
http://localhost:8501.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
