Getting empty message with paper streaming

Hi Alpaca staff,

I am trying to get used to alpaca-py and set up my paper trading algorithm. I’ve read docs and watched videos regarding the topic, but found that the mismatch of the syntax between the versions. I am now able to get the credantials authorized, but then got empty message when trying to listen to the live stream.

The script I used is here:

import config
import websocket, json

def on_open(ws):
    auth_data = {
        "action": "authenticate",
        "key": config.API_KEY, "secret": config.SECRET_KEY
    listen_message = {"action": "listen", "data": {"streams": ["AM.SPY"]}}

def on_message(ws, message):
    print("received a message")

def on_close(ws):
    print("closed connection")

socket = "wss://"
# socket = "wss://"
ws = websocket.WebSocketApp(socket, on_open=on_open, on_message=on_message, on_close=on_close)

Any thought, and I am also wondering what is the best setup for paper and live streaming today?