financial_news_fast_inference / vantage_caller.py
Andreagus's picture
Upload 8 files
415516b verified
raw
history blame
No virus
438 Bytes
from api_keys import vantage_api
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