financial_news_fast_inference / marketaux_caller.py
Andreagus's picture
Upload 8 files
415516b verified
raw
history blame
428 Bytes
import requests
from streamlit import secrets
marketaux_api = secrets["marketaux_api"]
def get_marketaux(ticker):
marketaux_list = []
url = f'https://api.marketaux.com/v1/news/all?symbols={ticker}&filter_entities=true&language=en&api_token={marketaux_api}'
r = requests.get(url)
data = r.json()
for article in data['data']:
marketaux_list.append(article['title'])
return marketaux_list