financial_news_fast_inference / vantage_caller.py
Andreagus's picture
Update vantage_caller.py
7e77abf verified
import requests
from streamlit import secrets
vantage_api = secrets["vantage_api"]
def get_vantage(ticker):
vantage_list = []
url = f'https://www.alphavantage.co/query?function=NEWS_SENTIMENT&tickers={ticker}&apikey={vantage_api}&limit=1000'
r = requests.get(url)
data = r.json()
for article in data['feed']:
vantage_list.append(article['title'])
return vantage_list