Unable to unsubscribe

I have subscribed to a bunch of symbols including ‘CESC’

When I try to unsubscribe to any of them, I am getting the following error

‘Error: {‘code’: -300, ‘message’: ‘Please provide a valid symbol’, ‘s’: ‘error’}’

Here is my code that I tried to unsubscribe to CESC:
data_type = “SymbolUpdate”

symbols_to_unsubscribe = [‘NSE:CESC-EQ’]

fyers_data_ws.unsubscribe(symbols=symbols_to_unsubscribe, data_type=data_type)

I am running v3 and here is my log

Hey @joel_elias1

Can you please let us know the inputs given here

@WWhYB2qrsx Why don’t you try and replicate this? Unsubscribe is not working under any condition.


fyers_socket = data_ws.FyersDataSocket(
            access_token=access_token,  # Access token in the format "appid:accesstoken"
            on_connect=onConnect,  # Callback function to handle connection events
            on_message=onMessage,  # Callback function to handle incoming messages
            on_error=onError,  # Callback function to handle errors
            on_close=onClose,  # Callback function to handle connection close events
        )
fyers_socket.connect()
fyers_socket.keep_running()
fyers_socket.subscribe(symbols=['NSE:RELIANCE-EQ'])
fyers_socket.subscribe(symbols=['NSE:ITC-EQ'])
fyers_socket.unsubscribe(symbols=['NSE:RELIANCE-EQ'])

Logs:

{"level":"ERROR","location":"[unsubscribe:1758] data_ws","message":{"code":-300,"message":"Please provide a valid symbol","s":"error"},"timestamp":"2024-07-20 14:05:05,218+0530","service":"FyersDataSocket"}

Prints:

Response: {'type': 'cn', 'code': 200, 'message': 'Authentication done', 's': 'ok'}
Response: {'type': 'ful', 'code': 200, 'message': 'Full Mode On', 's': 'ok'}
Connected!
Response: {'type': 'sub', 'code': 200, 'message': 'Subscribed', 's': 'ok'}
Response: {'ltp': 3110.3, 'vol_traded_today': 6570195, 'last_traded_time': 1721384998, 'exch_feed_time': 1721384999, 'bid_size': 6681, 'ask_size': 0, 'bid_price': 3110.3, 'ask_price': 0.0, 'last_traded_qty': 5, 'tot_buy_qty': 6681, 'tot_sell_qty': 0, 'avg_trade_price': 3128.39, 'low_price': 3105.6, 'high_price': 3179.95, 'lower_ckt': 0, 'upper_ckt': 0, 'open_price': 3172.0, 'prev_close_price': 3173.35, 'type': 'sf', 'symbol': 'NSE:RELIANCE-EQ', 'ch': -63.05, 'chp': -1.9869}
Response: {'type': 'sub', 'code': 200, 'message': 'Subscribed', 's': 'ok'}
Response: {'ltp': 474.55, 'vol_traded_today': 24977373, 'last_traded_time': 1721384978, 'exch_feed_time': 1721384978, 'bid_size': 0, 'ask_size': 28089, 'bid_price': 0.0, 'ask_price': 474.55, 'last_traded_qty': 15, 'tot_buy_qty': 0, 'tot_sell_qty': 28089, 'avg_trade_price': 474.64, 'low_price': 469.4, 'high_price': 479.4, 'lower_ckt': 0, 'upper_ckt': 0, 'open_price': 471.0, 'prev_close_price': 470.25, 'type': 'sf', 'symbol': 'NSE:ITC-EQ', 'ch': 4.3, 'chp': 0.9144}
Error: {'code': -300, 'message': 'Please provide a valid symbol', 's': 'error'}

Hey @joel_elias1 @swapniel99

Have checked the Unsubscribe , it is working for me . This should be due to some implementation logic , Could you please try to use the unsubscribe with the sample code and check if the issue persists

Hey @joel_elias1 @swapniel99
Did you guys get an update on this? I am facing the same issue with unsubscribe.