Kotak-Neo / kotak-neo-api

100 stars 86 forks source link

Issue retrieving LTP from websocket #71

Open codewithraviteja opened 9 months ago

codewithraviteja commented 9 months ago

Hello, I am getting this error!

And also please explain how to retrieve ltp in a proper way

image

darshil-lakhani commented 9 months ago

@droidmaniac31 Share your code at least , how can someone assume what is the issue without the code !

Kotak-Neo commented 9 months ago

@droidmaniac31 Kindly share your code to debug the issue. Do mask your credentials and keys while sharing your code.

AlbertBGeorge commented 9 months ago

I think you are trying to print "ltp" using the callback function, but getting KeyError because "ltp" is sometimes not present in message. Try this: ltp_value = message[0].get('ltp') # Use get to avoid KeyError if 'ltp' is not present