i am trying to use websocket plus, this is code.
async def upstox_websocket():
websocket_url=‘wss://api.upstox.com/v3/feed/market-data-feed’
upstox_header={‘Authorization’:f"Bearer {upstox_token}“,‘Accept’:‘/’}
websocket=create_connection(websocket_url,header=[f”{key}:{value}" for key,value in upstox_header.items()])
prs={‘guid’:‘1’,‘method’:‘sub’,‘data’:{‘mode’:‘full_d30’,‘instrumentKeys’:[“NSE_EQ|ETERNAL”]}}
websocket.send(json.dumps(prs).encode(‘utf-8’))
res1=websocket.recv()
print(res1)
websocket.close()
asyncio.run(upstox_websocket())
this is what result is
b’\x08\x02\x18\xaf\xfa\xc5\x86\xf22"\x8e\x01\n\x0b\n\x07NSE_COM\x10\x02\n\n\n\x06NCD_FO\x10\x02\n\n\n\x06NSE_FO\x10\x03\n\n\n\x06BSE_EQ\x10\x05\n\n\n\x06BCD_FO\x10\x02\n\n\n\x06BSE_FO\x10\x03\n\n\n\x06NSE_EQ\x10\x05\n\n\n\x06MCX_FO\x10\x02\n\r\n\tMCX_INDEX\x10\x02\n\r\n\tNSE_INDEX\x10\x05\n\r\n\tBSE_INDEX\x10\x05’
i want d30 data,what i am doing wrong?