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