Unable to use Fyers Websocket with python

I am trying to fetch the LTP of 200 scripts.

I got the code from the fyers documentation. Not sure why its not working.

Here is my python code:

from fyers_api.Websocket import ws

access_token = 'OEXXXXXXX100:XXXXXXcnMuaW4iLCJpYXQiOjE2NTI4NTY0NzIsImV4cCI6MTY1MjkyMDI1MiwibmJmIjoxNjUyODU'

data_type = "symbolData" # (for symbol websocket the data_type has to be “symbolData”)

run_background = False #(by default) If you don’t want to get the orderUpdate over the console you can set the run_background to True

symbol= ["NSE:SBIN-EQ","NSE:ONGC-EQ"]

def custom_message(msg):

print(f"Custom:{msg}")

ws.websocket_data = custom_message

fyersSocket = ws.FyersSocket(access_token=access_token,run_background=False,log_path="./ws.logs")

fyersSocket.subscribe(symbol=symbol,data_type=data_type)

print(fyers.get_profile())

print(fyers.tradebook())

print(fyers.positions())

fs.keep_running()


While running this code in juyternotebook. I am getting this error:

ValueError: Unable to configure handler 'file'

This is resolved.

For anyone who get here with the same issue, the fix is to give a Directory/Folder path. i.e in log_path=“”

Use this code for the Webstock

https://github.com/SHIVANIUM-GIT

fyers only allow 50 scripts at time