At 3:05PM i am closing all my open positions. I am consuming kite.positions() api to identify open position using quantity in net positions. But looks like api is giving zero quantity for net position ('quantity' in position['net']).
Sorry, i am not getting you. do you mean kite.poistions()['net'] returning empty? No it was not returning empty, it was returning closed position only. open position was not there. To give you more idea, i am continuously polling open position using kite.postions() api and at around 3:05PM i am closing all positions. I have checked till around 3:02PM api was working as expected, and was giving all open positions (with quantity). But after, quantity in net positions were 0 only, though i can see, my trade was still open. I had to manually close my trade, automation didn't square off my trade.
Kite web uses the same APIs to display the values. Can you let us know which field you are looking for? You need to paste the complete stack trace with debug logs when it happens next time.