Skip to main content
Question
FYERS API
Ameet Malekar
Algo Trader
Asked a question last year

How to get nifty weekly and monthly expiry "dates", and trading holidays dates using python?

Join FYERS Community to pick others' brains on Trading/Investing

I know this is not an answer to your question. But sharing how i am handling the exact requirement of mine. What i do is to select the distinct expiry dates from http://public.fyers.in/sym_details/NSE_FO.csv277. Setup a cron to clear old data and update the database comparing current date, so that it remains updated on each day.

I have another table for holidays, where the trading holidays are collected from nse website https://www.nseindia.com/resources/exchange-communication-holidays385. Once in a year process.

You can use pandas_market_calendar module to get list of all holidays historical to current. Refer this https://github.com/rsheftel/pandas_market_calendars291. Make sure to change market to BSE.