File size: 502 Bytes
415516b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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