Getting event data from Websocket

Hi everyone,

I’m having trouble retrieving data from the websocket using the description given in the Python-API documentation . I’ve written the code below. It executes, but does not produce any messages. I’d expect message events to appear in my jupyter notebook. What am I doing wrong?

Thanks in advance,

Import packages

from binance.client import Client
from binance.websockets import BinanceSocketManager
from twisted.internet import reactor

Set API keys

api_key = “”
api_secret = “”

print(‘Setting up the client’)
client = Client(api_key, api_secret)
client.API_URL = “

def on_message(ws, message):

Start the websocket manager

socketManager = BinanceSocketManager(client)

conn_key = socketManager.start_symbol_ticker_socket(‘BNBBUSD’, on_message)

Start the socket manager

print(‘Starting the socket manager’)

The SDK you use cannot get testnet wss properly. It would work if you remove this line:
client.API_URL = “”