How to Get Expired Options Data When Kite Connect Doesn't Provide It
If you have tried to backtest an options strategy using Kite Connect, you have probably hit this: the historical data endpoint works perfectly for live contracts and returns nothing useful for anything that has already expired.
This is the single most common question in the Kite Connect forum on this topic, and the same question recurs on Angel One’s SmartAPI forum, the Upstox community and Quora. It is worth explaining why it happens, because the reason determines which workarounds actually work.
Why it happens
Kite Connect’s historical endpoint is keyed on an instrument token, not on a human-readable symbol. You look the token up in the instruments dump, then request candles for it.
The instruments dump lists what is currently tradeable. Once a contract settles, it drops out. No listing, no token, no historical request — even though the candles existed while the contract was live and the exchange has a record of every one of them.
That is the whole mechanism. It is not a deliberate restriction on historical data so much as a consequence of how instruments are addressed. SmartAPI works the same way and has the same gap.
The practical consequence is awkward: the data you most want for a backtest is exactly the data that becomes unaddressable. A live contract you can query freely, but you do not need its history yet. By the time its full lifecycle is interesting, you can no longer ask for it.
What does not work
Guessing the token. Instrument tokens are not derivable from symbol, strike and expiry. There is no formula.
Reconstructing from the index. You cannot compute what an option traded at from the underlying’s price. That requires an implied volatility, which is the thing you are trying to observe. Any attempt produces model output, not market data, and a backtest run on it is testing your model rather than your strategy.
Assuming the tradingsymbol still resolves. NIFTY24JAN21500CE is meaningful to a human but the API needs the token, and for a settled contract the mapping is gone.
What does work
If you planned ahead: archive the instruments dump
If you have been saving the daily instruments dump, you have the historical token mappings, and you can request candles for contracts that expired since you started.
Two catches. It only works forward from the day you began — there is no way to recover mappings you never saved. And some APIs reject historical requests for settled contracts even when the token is known, so test before relying on it.
Worth starting today if you are not doing it, because the value compounds and the cost is a cron job.
Brokers that do serve expired data
DhanHQ exposes expired options data on a rolling basis, up to about five years, including OI, IV, OHLC and volume. If you hold a Dhan account this is the easiest answer available.
ICICI Direct Breeze provides roughly three years of historical F&O data free to account holders.
Both are genuinely good options and worth checking before paying anyone. The constraint is that you need the account, and the rolling window means the far end of the history keeps disappearing.
NSE bhavcopy
The exchange publishes daily files with end-of-day data for every contract, free, going back years. Authoritative — this is the settlement record.
The limits matter though: end-of-day only, so no intraday series at all; one file per day that you download and stitch together yourself; and a format that has changed over the years, so a loader written against last year’s files may not parse older ones.
Fine for: positional studies, settlement prices, anything where daily granularity suffices. Not enough for: anything intraday.
A dedicated archive
If you need per-minute data with open interest across multiple years, this is usually where you land, because the hard part is not access — it is that somebody had to capture and store it continuously, and keep it after expiry.
Free web tools like StockMojo, NiftyTrader and OptionBacktesting carry historical chains and are genuinely useful for checking a specific expiry by hand. They are web-first rather than API-first, so they do not fit a backtest loop pulling thousands of contracts.
MoneyTicks — disclosure, this is our own — keeps 1-minute OHLC with open interest for every expired NIFTY, BANK NIFTY and SENSEX contract, NIFTY and BANK NIFTY from August 2021 and SENSEX from March 2024. Addressed by symbol, expiry, strike and option type rather than by token, so the “no token after expiry” problem does not arise:
curl -s "https://api.moneyticks.com/api/v1/options/NIFTY/candles?expiry=2024-01-25&strike=21500&optionType=CE&interval=1m" \
-H "Authorization: Bearer mt_live_your_api_key"
The archive is browsable free without an account — pick any NIFTY expiry and any strike to see the full recorded history before deciding whether it is worth paying for.
Choosing
| Situation | Start with |
|---|---|
| Daily granularity is enough | NSE bhavcopy |
| You have a Dhan or ICICI Direct account | DhanHQ / Breeze |
| Checking one expiry by hand | StockMojo, NiftyTrader |
| Per-minute, multi-year, programmatic | A dedicated archive |
| You are planning years ahead | Start archiving instrument dumps today |
The thing worth internalising
Options data is asymmetric in a way equity data is not. An equity ticker persists, so you can always go back and fetch it. An option contract exists for a few weeks and then stops being addressable forever.
That means the decision to keep the data has to be made before you need it — and almost nobody does, which is why this question keeps being asked.
If you are building anything that will eventually want to look backwards, either start capturing now or use a source that already did. There is no third option that recovers it later.
Related: backtesting an options strategy in Python covers the harness once you have the data, and where to get expired NIFTY and Bank Nifty options data compares the sources in more detail.
Frequently asked questions
Does Kite Connect provide expired options data?
No. Kite Connect's historical data endpoint works by instrument token, and expired contracts are removed from the instruments dump once they settle. Without a resolvable token there is no way to request the candles, even though the data existed while the contract was live.
Does Angel One SmartAPI provide historical data for expired contracts?
No. SmartAPI has the same limitation for the same reason — historical requests are keyed on a symbol token that stops being listed after expiry.
Can I look up an old instrument token to get expired contract data?
Sometimes, if you saved the instruments dump while the contract was live. Brokers do not generally publish historical instrument dumps, so this only works if you were archiving them yourself in advance. Even where a token resolves, some APIs reject historical requests for settled contracts.
Which brokers do offer expired options data?
DhanHQ exposes expired options data on a rolling basis of up to five years. ICICI Direct's Breeze API offers roughly three years of historical F&O data free to account holders. Both are worth checking first if you already hold the account.
What is the simplest way to get years of expired options data?
A dedicated archive. NSE bhavcopy is free and authoritative but end-of-day only and distributed as daily files. For per-minute data with open interest across several years, a paid source is usually the practical answer because the storage and capture cost is the hard part.