import requests from streamlit import secrets bezinga_api = secrets["bezinga_api"] def bezinga_get(ticker): bezinga_list = [] url = f"https://api.benzinga.com/api/v2/news?token={bezinga_api}&pageSize=1000&tickers={ticker}" headers = {"accept": "application/json"} r = requests.request("GET", url, headers=headers) data = r.json() print(data) for article in data: print(article) bezinga_list.append(article['title']) return bezinga_list