DalalAI Blog

Indian Stock Market API for Developers — Integration Guide (NSE/BSE)

By DalalAI Research · Updated March 2026

How to access NSE and BSE stock data programmatically — API types, authentication, endpoint patterns, and practical integration guidance for building Indian fintech applications and algo trading systems.

📖 7 min read · Updated 27 March 2026

Indian stock market APIs fall into two categories: data APIs (read-only market data, fundamentals, and signals) and trading APIs (order placement and portfolio management through brokers). Most developers need both — a data API for research and signal generation, and a broker API for execution. This guide covers both and how they fit together.

📌 API Architecture Overview

Data layer
Market Data API
Prices, fundamentals, flows, signals — read-only research data
Execution layer
Broker Trading API
Order placement, position management, portfolio tracking
Real-time
WebSocket Feeds
Live price streaming, tick data, order book depth
Intelligence
AI Signal API
ML-generated scores, convergence signals, anomaly alerts

Types of Indian stock market APIs

Broker APIs (Kite Connect, SmartAPI, Upstox): These provide both market data and order execution. You need a brokerage account. The data access is typically limited to what the broker licenses — usually real-time prices and basic order book, but not institutional flows or AI signals.

Market data aggregator APIs: These compile data from multiple exchange sources into unified REST endpoints. They cover price history, fundamentals, corporate actions, institutional flows, delivery data, and often add value-added analytics. DalalAI's API falls in this category, adding AI signals and convergence scores on top of raw market data.

Exchange data feeds: Direct feeds from NSE (through authorized vendors) provide the lowest latency tick data. These are expensive, require colocation infrastructure, and are used by HFT firms and institutional desks. Not suitable for most application developers.

Data APIs vs. trading APIs — know the difference

AspectData APITrading API
PurposeResearch, analysis, screeningOrder execution, portfolio management
Auth requirementAPI keyBroker account + OAuth / TOTP
Typical endpoints/stocks/{symbol}/price, /screener/orders/place, /portfolio
Best forDashboards, screeners, research tools, ML modelsAlgo trading bots, automated execution
Data scopeBroad (fundamentals, flows, signals)Narrow (prices, orders, positions)

For a complete algo trading system, the typical architecture is: Data API → Signal generation → Decision logic → Trading API → Order execution → Data API → Performance tracking.

API authentication and rate limiting patterns

Authentication: Data APIs typically use API key authentication (X-API-Key header or query parameter). Trading APIs require multi-factor auth — typically OAuth 2.0 flow with TOTP (time-based one-time password) for session initiation, as SEBI requires 2FA for automated trading.

Rate limits: Free tiers: 5-50 requests/minute. Paid tiers: 100-500 requests/minute. Enterprise: 1000+ or unlimited. When building screeners that scan 500+ stocks, use batch endpoints (/stocks/bulk) that return multiple symbols per call to stay within limits.

Best practice: Implement exponential backoff on 429 (rate limit) responses. Cache EOD data locally — price data after 3:30 PM IST doesn't change until the next trading day. This reduces API calls by 90%+ for most applications.

Building an algo trading pipeline

Step 1 — Data ingestion: Connect to a data API and pull EOD prices, delivery volume, FII/DII flows, and any AI signals available. Store in a local database (SQLite for prototypes, PostgreSQL for production).

Step 2 — Signal generation: Apply your strategy logic — technical indicators, ML model inference, or rule-based screening. The data API may provide pre-computed signals (convergence scores, momentum ranks) that save you from building entire ML pipelines.

Step 3 — Decision engine: Combine signals with risk management rules — position sizing, sector exposure limits, maximum drawdown thresholds. This is where your edge lives.

Step 4 — Execution: Route orders through a broker trading API. Start with paper trading mode to validate the pipeline end-to-end before connecting to real execution.

Common integration challenges

Symbol mapping: NSE and BSE use different symbol conventions. Your application needs a mapping layer. Some APIs provide unified symbol search endpoints that resolve this automatically.

Weekend gaps and holidays: API calls for market data on non-trading days should return the last available trading day's data, not errors. Not all APIs handle this gracefully — test thoroughly.

Corporate actions: When a stock splits or issues bonus shares, historical price data needs adjustment. APIs that provide both raw and adjusted prices are safer to build on.

Choosing the right API for your use case

Use caseRecommended API type
Research dashboard / screenerData aggregator API (DalalAI, similar)
Automated trading botBroker API + Data API combination
ML model trainingData API with deep historical coverage
Mobile fintech appData aggregator API with batch endpoints
Institutional analyticsEnterprise data API with institutional flow endpoints

❓ FAQ

Does NSE provide a free API?

NSE does not provide a public REST API. Market data is distributed through licensed data vendors and broker APIs. Aggregator APIs like DalalAI provide developer-friendly access to NSE data through standard REST endpoints with free tiers available.

Can I build an algo trading system with these APIs?

Yes. Combine a data API for research and signal generation with a broker trading API (Kite Connect, SmartAPI) for order execution. Start with paper trading, validate for 2-3 months, then move to small real-capital deployment.

What's the best programming language for Indian stock market APIs?

Python is the most popular choice due to its data science ecosystem (pandas, numpy, scikit-learn). JavaScript/Node.js works well for web dashboards. Most Indian stock market APIs provide Python SDKs as a first-class offering.

Explore DalalAI API — Free Tier Available →

📚 Related Reading

Best Financial Data API for Indian Stocks (2026) — Developer Guide — financial data APIs
Machine Learning for Stock Market in India — Practical Guide for Quant Traders — ML for stocks
Algo Trading in India — Complete Guide to Automated Trading on NSE/BSE — algo trading
📬

Get Free Daily Stock Picks

AI-curated top picks, market regime, and accuracy report — every market morning.

Found this useful? Share it 𝕏 Post LinkedIn WhatsApp 🔗 Copy Link

← All Posts | Developer API | Stock Screener