How to use Websocket / Python

Hello,

I want to query some markPrice symbols using Websocket, and I´d like to know if there is information about it using Python.

Regards,

Orlando Gautier

Hello, I do not underestand your answer. Could you explain to me please.

Thank you!

sorry i posted something wrong , so i deleted it,
I request can you help me with my question?
Thank You

If I got it right, it’s about how to listen to websocket stream in python?

Hello,

I´m connecting using:

from binance.client import Client

client = Client('xxxx', 'xxxx')

from binance.websockets import BinanceSocketManager

bm = BinanceSocketManager(client)

def process_m_message(msg):

print("stream: {} data: {}".format(msg['stream'], msg['data']))
conn_key = bm.start_multiplex_socket(['sxpusdt@aggTrade', 'sxpusdt@ticker','sxpusdt@markPrice'], process_m_message)

bm.start()

It works fine…

But when I try to get sxpusdt@markPrice or sxpusdt@markPrice@1s it does not work. I don´t know if it is neccesary to subuscribe to this work.

Regards,

Orlando Gautier

Here is an example file with an other lib: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/example_binance_futures_1s.py

Thank you Dino,

markPrice is only from futures, it will return data if this bm can also handle futures streams.

sure, please post the question in a new topic. thank you