How to work with the response from the websocket?

Hello everyone!

I’m trying to set up my first trading bot, I’m working with the WebSocket, everything is running fine but I’m struggling trying to access the data I’m getting on the console. I need to access to ‘h’ ‘l’ and ‘c’ to work with TA-Lib.

Can you help with an example of how to print ‘c’ on my console?
ex. print(“This candle close at” + ( ? ) )

Many thanks for your time.

===================CONSOLE=====================
{'data': {'T': 'TSLA',
          'a': 863.2809,
          'av': 380723,
          'c': 860.025,
          'e': 1612375440000,
          'ev': 'AM',
          'h': 860.23,
          'l': 860.01,
          'o': 860.23,
          'op': 877.03,
          's': 1612375380000,
          'v': 1289,
          'vw': 860.104},
 'stream': 'AM.TSLA'}

===================CODE=====================
import websocket, json, pprint, talib, numpy
import config

SOCKET = "wss://data.alpaca.markets/stream"

TRADE_SYMBOL = 'AM.TSLA'

def on_open(ws):
    auth_data = {
        "action": "authenticate",
        "data": {"key_id": config.API_KEY, "secret_key": config.SECRET_KEY}
    }

    ws.send(json.dumps(auth_data))
    listen_message = {"action": "listen", "data": {"streams": [TRADE_SYMBOL]}}
    ws.send(json.dumps(listen_message))

def on_close(ws):

def on_message(ws, message):
    json_message = json.loads(message)
    pprint.pprint(json_message)

ws = websocket.WebSocketApp(SOCKET, on_open=on_open, on_message=on_message, on_close=on_close)
ws.run_forever()

This was my try using examples from other bots.

def on_message(ws, message):

    json_message = json.loads(message)
    pprint.pprint(json_message)

    close = json_message['c']
    high = json_message['h']
    low = json_message['l']

    print("candle closed at {}".format(close))
    print("candle high at {}".format(high))
    print("candle low at {}".format(low))