This Python project fetches stock data and news articles related to a specified company and sends SMS alerts via Twilio when there is a significant change in the stock price. It utilizes APIs from Alpha Vantage for stock data, News API for news articles, and Twilio for SMS messaging.
- Fetches daily stock data from Alpha Vantage API.
- Retrieves news articles related to the specified company from News API.
- Sends SMS alerts via Twilio when the stock price change exceeds a specified threshold.
- Utilizes environment variables for API keys and endpoints for enhanced security.
- Retrieves daily stock data for a specified company using the Alpha Vantage API.
- Calculates the percentage difference in the stock price between two consecutive trading days.
- If the percentage difference exceeds a specified threshold (e.g., 5%), fetches news articles related to the company using the News API.
- Sends SMS alerts via Twilio with the headline and brief description of the top news articles.
git clone https://github.com/Manjunathhs-0003/Stock-News
cd Stock-News
- Set up environment variables for the required API keys and endpoints.
- Run the Python script
main.py
.
python main.py
- Alpha Vantage:
- Endpoint: Alpha Vantage
- Documentation: Navigate to the Alpha Vantage website, sign up for an account, and obtain the API key from the dashboard or API section.
- News API:
- Endpoint: News API
- Documentation: Visit the News API website, sign up for an account or log in, and obtain the API key from the dashboard or API section.
- Twilio:
- Endpoint: Twilio
- Documentation: Go to the Twilio website, sign up for an account, obtain the Account SID and Auth Token from the dashboard, and set up a virtual phone number.