NSE API for Market Data: How to Access Free and Paid Data Sources in India

NSE API market data is the backbone of every serious trading system built for Indian markets — yet most retail traders either don't know how to access it or waste hours wrestling with unreliable workarounds. Whether you're building a scanner for NIFTY option chain shifts, tracking HDFCBANK delivery percentages in real-time, or backtesting a BANKNIFTY straddle strategy, you need clean, structured data flowing into your system. Without it, you're trading blind.
The problem is that NSE doesn't offer a straightforward, publicly documented REST API the way exchanges in the US do. What exists is a patchwork of unofficial endpoints, third-party providers, and SEBI-regulated data vendors — each with different reliability, latency, cost, and legal standing. This guide cuts through the confusion. You'll learn exactly how to access NSE market data API free and paid sources India has available today, what each option actually delivers, and which one fits your specific use case.
The Reality of NSE's "API" — What Actually Exists
Let's get the biggest misconception out of the way: NSE does not offer a public, documented API for retail traders. There is no developer portal where you sign up, get an API key, and start pulling OHLCV data for RELIANCE or TATAMOTORS.
What NSE does have:
- nseindia.com endpoints — The NSE website itself fetches data from internal JSON endpoints. URLs like
https://www.nseindia.com/api/option-chain-indices?symbol=NIFTYreturn structured JSON. These are not official APIs. They're internal endpoints that power the website's frontend. - NSE Data Products — NSE sells institutional-grade data feeds (tick-by-tick, end-of-day) through its subsidiary NSE Data & Analytics. These are meant for brokers, data vendors, and institutional subscribers. Pricing starts at several lakhs per year.
- Bhavcopy and reports — NSE publishes daily bhavcopies (end-of-day files), bulk/block deal data, FII/DII activity, and delivery percentage reports as downloadable CSV/ZIP files. These are free but not real-time.
The unofficial JSON endpoints are what 90% of retail developers mean when they say "NSE API." They work — until they don't. NSE actively blocks scrapers using rate limiting, CAPTCHAs, cookie validation, and IP blocking. If your script worked last month and broke today, this is why.
How to Access Free NSE Market Data Sources
Unofficial NSE Website Endpoints
The most commonly used free source. Here's how it works in practice:
- Session initialization — You must first hit
https://www.nseindia.comto get session cookies. Without valid cookies, API calls return 401 or redirect to a CAPTCHA page. - Data endpoints — With cookies set, you can access endpoints like:
/api/equity-stockIndices?index=NIFTY%2050— NIFTY 50 constituents with LTP, change, volume/api/option-chain-indices?symbol=NIFTY— Full NIFTY option chain with OI, IV, Greeks/api/option-chain-equities?symbol=HDFCBANK— Stock option chains/api/quote-equity?symbol=RELIANCE— Detailed quote with 52-week high/low, P/E, deliverable quantity
- Rate limits — NSE aggressively throttles requests. More than 3-4 requests per second from a single IP will get you blocked. Use delays of 2-3 seconds between calls. Rotate user-agent headers.
Critical limitation: This data is delayed by a few seconds to a few minutes. It's not real-time tick data. For building a live scalping bot on BANKNIFTY weekly options, this won't cut it. For end-of-day analysis, portfolio tracking, or OI analysis with 5-minute refresh intervals, it's sufficient.
Python libraries like jugaad-data, nsetools, and nselib wrap these endpoints. But be warned — they break frequently because NSE changes its cookie/session logic every few months. If you depend on these for a production system, you need a maintenance plan.
NSE Bhavcopy and Daily Reports
Completely free, completely legal, completely reliable. NSE publishes these every trading day after market hours:
- Equity Bhavcopy — OHLC, volume, traded value, and number of trades for every listed security
- F&O Bhavcopy — Settlement price, OI, volume, and value for every futures and options contract
- Delivery percentage data — How much of the day's volume was actually taken for delivery vs. squared off intraday
- FII/DII activity — Net buy/sell values in cash and F&O segments
These files are available at predictable URLs following a date-based pattern. You can automate daily downloads with a simple cron job. For anyone building an end-of-day screening system — say, stocks with delivery percentage above 60% and volume spike above 2x average — bhavcopies are your most reliable data source.
Where to find them: Navigate to nseindia.com > Market Data > Reports or use the archives section. F&O bhavcopies include contract-level details including expiry date, strike price, option type, and open interest — everything you need for options analytics.
Google Finance and Yahoo Finance
Google Finance provides limited NSE data through URLs like https://www.google.com/finance/quote/RELIANCE:NSE. Yahoo Finance covers NSE stocks under the .NS suffix (e.g., RELIANCE.NS) and offers a more developer-friendly interface through the yfinance Python library.
Yahoo Finance gives you historical OHLCV data going back years, which is useful for backtesting. However, the data has known issues: adjusted close calculations can be wrong after splits/bonuses, and intraday data is limited to the last 60 days at 1-minute granularity.
Use these for: Quick historical data pulls, rough backtests, academic research. Don't use these for: Production trading systems, anything requiring accuracy on corporate action adjustments, or real-time data.
Paid NSE API Market Data Providers Worth Considering
When free sources hit their ceiling — unreliable connections, delayed data, missing tick history — you move to paid providers. Here are the categories that matter for Indian retail traders:
Broker APIs (Zero to Low Additional Cost)
If you have a trading account with Zerodha, Upstox, Angel One, Fyers, or similar discount brokers, you likely have access to a market data API bundled with your account:
- Zerodha Kite Connect — ₹2,000/month. WebSocket streaming for live ticks, historical candle data (minute to day), full order management. Covers NSE, BSE, MCX. Arguably the most mature API in the Indian retail broker space. Rate limit: 3 requests/second for HTTP, 3,000 instruments on WebSocket.
- Upstox API v2 — Free with an Upstox account. WebSocket streaming, historical data, and order placement. Generous rate limits. Documentation has improved significantly.
- Angel One SmartAPI — Free. Provides live feeds, historical candles, and order placement. Works well for basic automation. The WebSocket implementation can be less stable during high-volatility sessions like budget day or RBI policy announcements.
- Fyers API — Free with account. Clean documentation, WebSocket feeds, historical data access. A solid choice for algo traders who don't need Zerodha's ecosystem.
- Dhan API — Free. Relatively newer but gaining traction. Good WebSocket stability and modern REST design.
The key trade-off: Broker APIs give you data and execution in one package, but the data is tied to your brokerage relationship. If you switch brokers, you rebuild your data pipeline. Also, historical data depth varies — most brokers offer 1-2 years of minute candles, which may not be enough for robust backtesting of strategies like mean reversion on NIFTY that need 5+ years of data.
Independent Data Vendors
For traders who need deeper history, higher reliability, or data types brokers don't offer:
- TrueData — Popular among Indian algo traders. Offers real-time tick-by-tick data, 15+ years of historical data for NSE equities and F&O, and data replay for backtesting. Plans start around ₹1,500-3,000/month depending on segments. Integrates with AmiBroker, MetaTrader, Python.
- Global Data Feeds — Similar to TrueData. Tick-level real-time data, historical data, AmiBroker plugin. Competitive pricing in the ₹1,000-2,500/month range.
- Doxter (by Doxter Systems) — Provides NSE data feeds with focus on derivatives analytics. Used by some proprietary trading desks.
These vendors are licensed by NSE to redistribute data. This matters legally — if you're scraping NSE's website at scale and redistributing the data, you're violating NSE's terms. Licensed vendors have legitimate redistribution rights.
Premium Institutional Sources
If you're running a serious quantitative operation or a SEBI-registered research analyst/advisory:
- NSE Data & Analytics (NDA) — The exchange's own data subsidiary. Offers tick-by-tick historical data, corporate action-adjusted prices, index data, and custom data products. Pricing is institutional — think lakhs per annum. Contracts are annual.
- Bloomberg Terminal / Refinitiv — Comprehensive but expensive (₹12-15 lakh/year for Bloomberg). Overkill for most retail traders but mentioned for completeness.
Choosing the Right Source for Your Use Case
Not every trader needs tick data. Not every strategy needs real-time feeds. Match the data source to what you're actually building:
Scenario 1: End-of-day swing trading scanner You're screening for stocks like TATASTEEL or WIPRO breaking out of a 20-day range with above-average delivery volumes. Best source: NSE bhavcopies (free) + Yahoo Finance historical data for backtesting. Total cost: ₹0.
Scenario 2: Intraday momentum strategy on NIFTY futures You need 1-minute candles streaming live, with 2-3 years of minute-level history for backtesting. Best source: Zerodha Kite Connect or Upstox API for live data + TrueData for deep historical data. Total cost: ₹2,000-5,000/month.
Scenario 3: BANKNIFTY option selling with OI-based adjustments You need live option chain data refreshing every 30 seconds — all strikes, all expiries, with OI and IV. Best source: Broker WebSocket API for live Greeks/OI + NSE unofficial endpoints as fallback for option chain snapshots. Total cost: ₹0-2,000/month.
Scenario 4: High-frequency or low-latency execution You need tick-by-tick data with sub-second latency. Best source: Co-location services at NSE + NDA data feeds. This is institutional territory. Total cost: ₹10+ lakh/year. SEBI's co-location framework (circular SEBI/HO/MRD/DP/CIR/P/2018/62) governs fair access.
Legal and Compliance Considerations
SEBI and NSE have clear positions on data usage that most retail developers ignore:
- NSE's data is proprietary. Scraping it for personal use exists in a grey area. Scraping it and redistributing it — even in a free tool — violates NSE's intellectual property terms.
- Broker API terms of service — Most broker APIs explicitly prohibit you from reselling or redistributing the market data you receive through their feeds. You can use it for your own trading decisions. You cannot build a public-facing data product on top of Zerodha's API without Zerodha's and NSE's permission.
- SEBI's algo trading circular (2021 and 2023 updates) — If your automated system places orders without manual intervention, brokers are required to get exchange approval for the algo. This affects how you deploy any system built on these data feeds. The latest framework requires all algos routed through broker APIs to be registered.
Bottom line: Use free sources for personal analysis and backtesting. If you're building a product or service, get proper data licensing from NSE or a licensed vendor.
Building a Robust Data Pipeline — Practical Architecture
Here's what a real, working NSE data pipeline looks like for a serious retail trader:
-
Real-time layer — Broker WebSocket (e.g., Kite Connect) streaming ticks for your watchlist of 50-100 instruments. Store in a time-series database like TimescaleDB or InfluxDB.
-
Historical layer — TrueData or Global Data Feeds for 10+ years of minute candles. Download once, update daily. Store in PostgreSQL or flat Parquet files.
-
Supplementary data — Daily automated download of NSE bhavcopies, FII/DII data, option chain snapshots. Parse CSVs with Python (pandas), store in your database.
-
Validation layer — Cross-check your real-time data against bhavcopy OHLC at end of day. Discrepancies happen — WebSocket disconnections, missed ticks, broker-side issues. A 0.5% discrepancy in NIFTY close price can materially affect your P&L calculations on a 10-lot futures position (10 * 50 * NIFTY level * 0.5% = significant rupees).
-
Fallback logic — If your primary broker API goes down (it will, especially during volatile sessions when BANKNIFTY moves 1000+ points), have a secondary data source ready. Even a simple fallback to NSE website endpoints with proper session handling can keep your monitoring alive.
Pro tip: Store raw data separately from processed data. When you discover a bug in your candle aggregation logic six months later, you'll want the raw ticks to reprocess. Storage is cheap. Rebuilding lost data is not.
What to Actually Do Right Now
If you're starting from zero, here's your action plan:
- Step 1: Open an account with a broker that offers API access — Zerodha, Upstox, or Fyers are the top choices. Get API credentials.
- Step 2: Write a Python script that connects to the broker's WebSocket and streams NIFTY 50 ticks. Store them locally. Get comfortable with the connection lifecycle — connect, subscribe, handle disconnections, reconnect.
- Step 3: Set up automated daily bhavcopy downloads from NSE. Parse them into a database. Build your first screen — for example, NIFTY 500 stocks where today's volume is 3x the 20-day average and delivery percentage exceeds 50%.
- Step 4: Once you've validated your data pipeline for 2-3 weeks, layer in option chain data. Start tracking PCR (put-call ratio) and max pain for NIFTY weekly expiries.
- Step 5: If free sources create reliability headaches, invest ₹1,500-3,000/month in TrueData or a similar licensed vendor. The time you save troubleshooting broken scrapers is worth far more.
Stop hoarding data sources you never use. Start with one clean pipeline, validate it ruthlessly, and expand only when your strategy demands it.
Building reliable data infrastructure is the unsexy work that separates traders who survive from those who blow up due to bad fills and stale signals. Tools like MarketNetra already process these raw NSE data streams — option chains, OI shifts, volume anomalies — through AI models, so you can focus on decision-making rather than data plumbing. If you'd rather analyze than engineer, that's a shortcut worth exploring.


