The Stock Notification project is a Python application that monitors stock price changes and sends notifications via WhatsApp using the Twilio API. It fetches stock data from the Alpha Vantage API and news articles from the News API to provide context for significant stock price changes.
- Fetch daily stock prices for a specified company.
- Calculate the percentage change in stock price.
- Retrieve news articles related to the company.
- Send WhatsApp notifications for significant stock price changes.
-
Clone the repository:
git clone https://github.com/chinguun101/stock-notification.git cd stock-notification -
Install the required packages:
Make sure you have Python installed, then run:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.envfile in the root directory and add the following environment variables:API_KEY=your_alpha_vantage_api_key NEWS_API=your_news_api_key TWILIO_SID=your_twilio_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token
-
Run the main script:
Execute the main script to start monitoring stock prices:
python stock_notification/main.py
-
Check the console output:
The script will print the stock price change and any notifications sent.
stock_notification/main.py: The main script that fetches stock data, calculates price changes, retrieves news, and sends notifications.requirements.txt: Lists the Python packages required for the project.
- Alpha Vantage API for stock data.
- News API for news articles.
- Twilio for WhatsApp notifications.