File size: 428 Bytes
415516b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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
|