Skip to main content

Unsubscribe depth

Request details: Parameter

ParameterDescription
t‘ud’ represents Unsubscribe depth
kOne or more scriplist for unsubscription. Example NSE
from typing import Any
from thefirstock.firstockModules import firstockWebSockets
from thefirstock.pyClient.websocket import WsClient
from thefirstock.pyClient.websocket.enums import MessageTopic


client = firstockWebSockets.webSocketLogin()
ws = client.ws


@ws.on_connect
def connected(client, message):
if message.get('s') == 'OK':
client.unsubscribe_depth('NSE', '22')


@ws.on_message(MessageTopic.DEPTH_UNSUB)
def msg_handler(client: WsClient, message: Any):
print(message)


ws.connect(uid='userId', actid='userId')
ws.run_forever()

Response details

ParameterDescription
t‘udk’ represents unsubscribe depth acknowledgement
kOne or more scriplist for unsubscription. Example NSE