https://github.com/eziraa/stock_market_analysis
https://github.com/eziraa/stock_market_analysis
flask nltk stock-market stock-news tailwindcss template
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/eziraa/stock_market_analysis
- Owner: eziraa
- Created: 2025-03-20T15:53:18.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-03-20T17:37:17.000Z (about 1 month ago)
- Last Synced: 2025-03-20T18:35:32.488Z (about 1 month ago)
- Topics: flask, nltk, stock-market, stock-news, tailwindcss, template
- Language: HTML
- Homepage: https://stock-market-analysis-vu5f.onrender.com
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📊 Stock Sentiment Analysis API
## 🚀 Overview
This API provides **real-time sentiment analysis** for stock market news related to a given stock symbol (e.g., AAPL, GOOGL, TSLA). It fetches financial news, analyzes sentiment, and returns insights to help investors make data-driven decisions.## 🏗️ Features
- 🔍 **Real-time News Fetching** – Retrieves the latest financial news articles.
- 🧠 **Sentiment Analysis** – Classifies news as **Positive, Negative, or Neutral**.
- 📈 **Stock Insights** – Helps investors gauge market sentiment.
- ⚡ **Fast & Scalable** – Built using Flask and Gunicorn.## 🛠️ Tech Stack
- **Backend:** Flask (Python)
- **Data Processing:** Pandas, NLTK (or Google Gemini for AI-based sentiment)
- **API Hosting:** Render / Heroku
- **Database (if needed):** PostgreSQL## 📌 Setup Instructions
### 1️⃣ Clone the Repository
```bash
git clone https://github.com/eziraa/stock_sentiment_analysis.git
cd stock-sentiment-analysis
```### 2️⃣ Install Dependencies
```bash
pip install -r requirements.txt
```### 3️⃣ Set Up Environment Variables
Create a `.env` file and add the necessary API keys:
```
NEWS_API_KEY=your_news_api_key
GOOGLE_GEMINI_API_KEY=your_google_gemini_key # If using Google AI
```### 4️⃣ Run the Application
```bash
python app.py # OR
flask run
```The API will be available at: `http://127.0.0.1:5000/`
## 🔥 API Endpoints
### 1️⃣ Get Sentiment for a Stock Symbol
**Endpoint:**
```http
GET /sentiment/{stock_symbol}
```
**Example Request:**
```http
GET /sentiment/GOOGL
```
**Response:**
```json
{
"stock": "GOOGL",
"average_sentiment": "Positive",
"news": [
{
"title": "Google expands AI research in Europe",
"sentiment": "Positive"
},
{
"title": "EU fines Google for antitrust violations",
"sentiment": "Negative"
}
]
}
```
### Deployement[See](https://stock-market-analysis-vu5f.onrender.com)
## 📜 License
MIT License## 🤝 Contributing
Pull requests are welcome! Open an issue for bug fixes or feature requests.## 📬 Contact
- GitHub: [Ezira Tigab](https://github.com/eziraa)
- Email: [email protected]