Trying to pull specific data from market api stream using websocket and ast but having trouble

Hello everyone,

I’m using this specific code that I found from a video on here in the forums and it’s not picking up any data. I’m newish to python so if someone could help that would be great. Here’s the code I’m using.

formatted_message = ast.literal_eval(message)
last_close = formatted_message.get(“data”).get(“c”)
print(“Last closing price is: {}$”.format(last_close))

I’m sure there’s an easier way but I don’t know what that is.