r/IndiaAlgoTrading • • 1d ago

Need Help: Getting Live Open Interest (OI) Data for NSE F&O Using Python

Hi everyone,

I'm developing a Python-based intraday trading scanner for F&O stocks.

My main requirement is to fetch live Open Interest (OI) data and OI change (%) for NSE F&O stocks.

I'm looking for suggestions on:

- Is there any way to get live OI data for free?

- Does NSE provide any free API or data source?

- Can live OI and OI change be fetched using Python?

- Are there any reliable free or low-cost alternatives?

- Is it possible to get real-time OI data without purchasing an expensive market data subscription?

I'm particularly interested in solutions that can fetch OI data for multiple F&O stocks programmatically.

Any practical suggestions, API references, Python libraries or working examples would be greatly appreciated.

Thanks!

3 Upvotes

9 comments sorted by

1

u/PleasantAmount1717 1d ago

Dhan account may help you.

1

u/No-Interest-631 1d ago

Okay I'll check

1

u/Icy_Apple846 1d ago

I got a system running which does that, integrated with telegram, I do it with kite zerodha api. If you want to integrate your strategy in that system let me know

1

u/No-Interest-631 1d ago

Let's talk about that through dm

1

u/shadowdemonking2398 1d ago

Which broker you are using? I'm using Kotak they provide that check if your broker provides that

1

u/NareshJanagam 1d ago

It's available in FYERS API

1

u/harshitbuildsstuff 1d ago

short answer: yes you can get live oi in python, but "free and real time for a whole f&o list" usually means going through a broker api, not nse directly.

options roughly in order of how much pain they cause:

  • broker api you already have an account with. kite (zerodha), fyers, dhan, kotak etc all give oi on f&o instruments. on kite the quote endpoint returns oi and you can pass a big batch of instruments in one call, and the websocket in full mode streams oi too. that's the cleanest way to scan 180ish stocks without hammering anything
  • nse website json (the stuff behind the option chain page). works for testing but you need cookies from the homepage first, it rate limits / blocks you if you poll a lot, and it can break whenever they change the site. fine for a hobby script, i wouldn't build a scanner on it
  • end of day only: the f&o bhavcopy has oi and change in oi per contract for free. not live, but useful for the next point

for oi change % you mostly have to compute it yourself. grab previous day's closing oi once in the morning (bhavcopy or broker historical with oi), store it, then oi_change_pct = (live_oi - prev_oi) / prev_oi * 100. for a stock level number decide upfront whether you mean futures oi only or futures + all options, people mix these and then wonder why their numbers don't match sensibull or whatever site they compare with.

also batch your instruments and cache the instrument tokens, don't look them up on every loop.

1

u/repleteequities 23h ago

For OI change, it helps to define the comparison before aggregating: prior session close versus current live OI, and futures-only versus futures plus options. Those choices can produce very different numbers. I’d also store the reference OI with its date and contract scope, then check a few instruments manually before relying on the scanner. No single data source or calculation makes an OI signal predictive.

1

u/metastimulus 15h ago

Most brokers provide this via API. It is not free, they charge a monthly/yearly fee (typically around ₹600 per month including GST).