free expiry day ↓

blog /

NIFTY weekly options historical data download: building a week-by-week archive

How to download NIFTY weekly options historical data and organise it by weekly series: separating weeklies from monthlies, tracking days to expiry, and choosing the pack window.

A NIFTY weekly option lives for a week or two of active trading. Research on weeklies means following each series from listing to expiry, not looking at one day in isolation. This guide covers how to download NIFTY weekly options historical data so that each weekly series can be rebuilt from first trade to last.

How the files map to weekly series

Each trading day holds a file per listed expiry: the current weekly, the next weeklies and the monthly. To follow one weekly series, collect every file that shares its expiry:

import re
from pathlib import Path
import pandas as pd

pat = re.compile(r"NIFTY_OPT_1min_(\d{4}-\d{2}-\d{2})_exp(\d{4}-\d{2}-\d{2})")
by_expiry = {}
for f in Path("NIFTY").rglob("NIFTY_OPT_1min_*.parquet"):
    if m := pat.search(f.name):
        by_expiry.setdefault(m[2], []).append((m[1], f))

series = by_expiry["2025-10-14"]          # one weekly, every day it traded
week = pd.concat(pd.read_parquet(f).assign(day=d) for d, f in sorted(series))
week["dte"] = (pd.to_datetime("2025-10-14") - pd.to_datetime(week["day"])).dt.days

Weekly or monthly?

The monthly contract is simply the last expiry of the month. Mark it from the expiry dates themselves: for each calendar month, the latest expiry date is the monthly, the rest are weeklies. That rule keeps working across the Thursday-to-Tuesday change and holiday shifts.

Picking a window

FAQ

Does the download include expired NIFTY weeklies?

Yes. Expired weekly contracts are the archive: every trading day is stored with the expiries listed that day.

How do I tell weekly and monthly expiries apart?

The monthly is the last expiry date in each calendar month. Everything else is a weekly.

Can I compute days to expiry?

Yes. Every file carries its trading day and expiry, so days to expiry is a subtraction.

more guides

Building an expiry-day dataset in Python: pandas and DuckDB recipesOne-second or one-minute bars for the last hour of expiry?Does NIFTY pin to max pain on expiry day? Testing it with open interest by strike