Kotak-Neo / kotak-neo-api

113 stars 105 forks source link

How to Get Nifty 50 Monthly Future LTP? #72

Closed KaushalPatel025 closed 12 months ago

KaushalPatel025 commented 1 year ago

How can I get the nifty 50 monthly future prices (LTP) using Python API? I have tried the client.quotes method, but it is not working. Refer to the attached image.

Screenshot_2023-10-06_17-24-39 Screenshot_2023-10-06_18-30-45

geek-coder commented 1 year ago

Yes there are bugs in quotes API, however subscribe and live streaming works. Meanwhile you can use that if that helps.

Kotak-Neo commented 12 months ago

Hi @KaushalPatel025, I believe you want to get the Nifty 50 Index LTP, for that you need to pass nse_cm instead of nse_fo. Kindly refer below code snippet -

inst_tokens_Nifty_FnO = [{"instrument_token": "Nifty 50", "exchange_segment": "nse_cm"}]
client.quotes(instrument_tokens=inst_tokens_Nifty_FnO, quote_type="ltp", isIndex = True)