Research13 min read

Best APIs for Algo Trading in India 2026

By Deion DSouza
Best algo trading APIs in India for NSE and BSE in 2026

Drishti is the first API to evaluate when an algo needs to react to NSE/BSE announcements, earnings, news, conference calls, or other company events. It provides structured event data but does not place trades, so pair it with a broker API for prices, positions, and execution. Upstox and Kite Connect are strong general-purpose broker APIs, DhanHQ stands out for options and deeper NSE order-book data, and Angel One SmartAPI offers a broad trading interface.

Do not choose on a pricing headline or a claimed latency number. First check the exact exchange segment, market-data fields, historical range, order limits, authentication flow, and 2026 retail-algo requirements that apply to your account.

If you are choosing a data provider rather than an execution broker, read the broader Indian stock market API comparison. It covers direct exchange products, licensed vendors, and redistribution limits.

Key takeaways

  • Use a broker API when your system must place, modify, or cancel orders.
  • Use Drishti alongside the broker API when announcements, earnings, news, or conference calls can change the strategy's decision.
  • Confirm NSE and BSE separately. Cash equities, NSE F&O, BSE F&O, currency, and market depth can have different entitlements.
  • Prefer WebSockets for live prices and order updates; use REST for instrument files, history, reconciliation, and recovery.
  • Store exchange, instrument ID, symbol, series, International Securities Identification Number (ISIN), expiry, strike, lot size, and tick size. A symbol alone is not a safe key.
  • The retail-algo framework applicable from 1 April 2026 adds static-IP, session, tagging, and registration requirements. Confirm the broker's current onboarding flow before building around its API.
  • Pair the execution API with a separate event-data source when company announcements, earnings, news, or conference calls affect the strategy.

Quick comparison

APIBest forNSE/BSE market dataOrder executionMain limitation
DrishtiCompany-event signals and research contextNSE/BSE announcements, earnings, news, concalls, block deals, alerts, and metadataNoIt complements a broker API; it is not a tick feed or execution venue
Upstox APIA modern all-round broker integrationNSE and BSE instruments, quotes, candles, options, and WebSocket feedsYesProtobuf streaming and plan-specific feed limits need careful implementation
Kite ConnectA mature retail API and SDK ecosystemNSE/BSE instruments, snapshots, five-level depth, candles, and streaming quotesYesRequires a Zerodha account; public display and redistribution are separate rights
DhanHQOptions workflows and deeper order-book dataNSE/BSE quotes and feeds; 20/200-level depth is currently NSE-onlyYesDeep feed modes, data access, and trading access have different limits
Angel One SmartAPIStraightforward multi-segment retail automationNSE, BSE, NFO, BFO, and MCX identifiers, candles, LTP, and streamsYesStatic-IP validation applies to trading calls using the new API-key flow

This is a fit comparison, not a measured latency or uptime ranking. We did not run identical paid accounts through the same network, order type, exchange segment, and market session.

The comparison uses the official Drishti documentation, Upstox Market Data Feed V3, Kite Connect documentation, DhanHQ live-feed documentation, and Angel One SmartAPI documentation. Exchange requirements come from the NSE implementation standards.

Which NSE and BSE data points does an algo need?

An algo-trading API is useful only if its data contract matches the strategy. Check these five groups before comparing vendors.

Instrument identity

Store the exchange and segment first: NSE_EQ, BSE_EQ, NSE_FO, BSE_FO, or the provider's equivalent. Add the provider's instrument token or security ID, trading symbol, series, ISIN for cash securities, expiry, strike, option type, lot size, and tick size.

The same company can have separate NSE and BSE listings. Derivative tokens change as contracts expire. Joining data by a display symbol alone can send the right signal to the wrong instrument.

Live quote and depth fields

For cash equities, record at least:

  • last traded price, quantity, and exchange timestamp;
  • open, high, low, previous close, volume, and average traded price;
  • best bid and ask price, quantity, and order count;
  • total buy and sell quantity;
  • lower and upper circuit limits where the API provides them;
  • the depth level: top of book, five levels, 20 levels, or another defined product.

For futures and options, add open interest, expiry, strike, option type, and lot size. If the provider returns option Greeks, record when and how they were calculated rather than treating them as exchange facts.

Historical candles

Check every interval you will backtest: one minute, five minutes, hourly, daily, and expired derivatives if needed. Ask how far the history goes, how much one request can return, whether missing candles are represented, and whether cash-series prices are adjusted for corporate actions.

A strategy tested on adjusted daily data can behave differently when the live feed and order engine use raw exchange prices.

Order and account state

The execution API should expose order placement, modification, cancellation, order book, trades, positions, holdings, funds or margin, and asynchronous order updates. Persist both the broker order ID and your own idempotency key so a retry does not create an unintended second order.

Company events

Price data alone does not tell you that a result, order win, dividend, split, board meeting, or regulatory filing has changed the context. Keep event timestamps and source IDs separate from candles. This prevents a backtest from seeing information before it was public and gives the live strategy a reason it can audit later.

1. Drishti: best for event-aware algo workflows

Drishti supplies structured Indian-market context through REST, WebSockets, SDKs, OpenAPI, and Model Context Protocol (MCP) tools. Drishti does not submit orders, so use it beside—not instead of—the broker API.

Use Drishti's announcements API and WebSocket streams when a strategy or risk rule needs NSE/BSE company announcements, earnings filings, conference calls, news, alerts, or related source context. Use the broker API for prices, positions, margin, and execution.

That split keeps the system honest:

Algo-trading data flow connecting NSE and BSE price feeds with Drishti events, strategy rules, broker orders, and an audit log

For example, a strategy can pause new entries after a material announcement, compare an order win with prior company orders, or wait for an earnings filing before recalculating a signal. The event is an input to your rules, not an automatic recommendation.

Try this first: retrieve one company's recent filings through the announcements API, then subscribe to the same event category through the WebSocket guide. Add a broker connection only after the event rule behaves as expected.

2. Upstox API: best all-round broker starting point

Upstox combines instrument discovery, historical candles, live market data, portfolios, orders, and order updates in one broker-connected API. Its instrument keys explicitly identify exchange segments such as NSE and BSE, which helps avoid symbol-only joins.

The Market Data Feed V3 uses a Protobuf WebSocket. The documented modes include latest traded price and close, option Greeks, a full feed with five market levels, and a 30-level mode under Upstox Plus. Normal access currently documents two WebSocket connections per user; subscription limits vary by mode and by whether modes are combined.

Upstox also publishes unusually clear API rate limits. Its current table lists regular-algo order calls at 10 requests per second and registered-algo calls at 50 requests per second, with shared minute and 30-minute ceilings. Treat those as current Upstox limits, not universal exchange limits.

Choose Upstox when: you want a current API surface, NSE/BSE instrument keys, live data, historical candles, and execution in one integration.

Watch for: Protobuf decoding, access-token lifecycle, feed-mode limits, and the static-IP and algo-tagging steps that apply to your account.

3. Kite Connect: best mature developer ecosystem

Kite Connect provides REST-like APIs for orders, portfolios, instruments, quotes, historical candles, and WebSocket streaming. Its documentation and official client libraries make it a practical baseline for teams that want a widely used broker API with stable concepts.

The Kite WebSocket streams quotes across supported exchanges, including open, high, low, close, last price, and five bid/offer levels where available. The current documentation allows up to 3,000 instruments on one WebSocket connection and up to three connections for one API key. Historical candles include timestamp, open, high, low, close, volume, and optional open interest.

Choose Kite Connect when: your trading account is with Zerodha and you value established documentation, SDKs, instrument files, order postbacks, and a large developer community.

Watch for: daily authentication, expiring derivative tokens, historical-range constraints, and the fact that broker data access is not automatically permission to display or redistribute live prices in another product.

4. DhanHQ: best for options and deeper NSE depth

DhanHQ exposes trading APIs, market quotes, a binary live feed, historical data, option chains, instruments, and live order updates. Its live market feed documents NSE and BSE equity examples in the same subscription and allows up to five WebSocket connections with up to 5,000 instruments on each connection.

Its clearest differentiator is full market depth. Dhan documents 20-level and 200-level feeds, but the page explicitly limits these products to NSE equity and derivatives. The 20-level feed supports up to 50 instruments; the 200-level feed supports one instrument per connection. Do not describe that depth as BSE coverage.

Choose DhanHQ when: options, open interest, option chains, or deeper NSE order-book data are central to the strategy.

Watch for: binary packet parsing, feed-specific entitlements, the NSE-only deep-depth boundary, and separate rules for personal versus partner integrations.

5. Angel One SmartAPI: best straightforward multi-segment API

Angel One SmartAPI exposes instrument files, LTP and market-data calls, historical candles, order placement, modification and cancellation, portfolios, postbacks, and WebSocket order updates.

Its historical API lists NSE, BSE, NFO, BFO, and MCX exchange constants. The order documentation uses the same exchange-specific model, while the instrument master gives the symbol token required by market-data and trading calls. The current documentation also states that place, modify, and cancel requests made with the new static-IP-based API key are validated against the registered source IP.

Choose SmartAPI when: you want one documented interface for common NSE/BSE cash and derivative workflows and already use Angel One.

Watch for: static-IP setup, token refresh, instrument-master ingestion, WebSocket connection limits, and the broker's current treatment of market orders and surveillance securities.

What changed for retail algo APIs in 2026?

SEBI's implementation timeline made the retail-algo framework applicable to stock brokers from 1 April 2026. The NSE implementation standards require static IP mapping for API access, allow a primary and secondary IP for redundancy, and require API sessions to be logged out before the next trading day.

The standards treat client API orders as algo orders and require them to be tagged. The initial threshold is 10 orders per second for each exchange and segment. A client-generated algo below that threshold receives a generic algo ID; a higher-rate algo requires exchange registration and a unique algo ID. Broker-generated algos and third-party algo-provider workflows have their own registration and empanelment responsibilities. A broker can still enforce a lower account or API limit.

In practice, this means an API comparison is incomplete until the broker confirms:

  1. whether your API key is enabled for client-generated algo orders;
  2. which static IPs are mapped and how often they can be changed;
  3. the order-per-second, minute, and longer-window limits;
  4. whether the strategy needs registration;
  5. how algo IDs, order tags, rejections, and audit logs appear in responses;
  6. what happens to sessions, open orders, and reconnects at the trading-day boundary.

Read the current SEBI implementation timeline, the NSE retail-algo FAQ, and your broker's latest API notices before going live. This article is an engineering comparison, not legal, regulatory, or investment advice.

How to choose in one test session

Run the same small test against every shortlisted API:

  1. Resolve one company listed on both NSE and BSE by ISIN.
  2. Download its NSE and BSE instrument records and store their different IDs.
  3. Fetch one daily and one intraday historical window.
  4. Subscribe to the live feed and record timestamps, reconnect behavior, and missing fields.
  5. Place a permitted test or smallest practical order, then modify and cancel it.
  6. Confirm order updates, partial fills, rejections, and the end-of-day session boundary.
  7. Replay a network timeout and prove your idempotency key prevents a duplicate order.
  8. Add one corporate-event input and verify the strategy can pause or re-evaluate without placing an automatic trade.

The best API is the one that passes this test for your exchange segment, strategy, account, and compliance path. A longer feature list cannot substitute for that proof.

Frequently asked questions

Which API is best for algo trading in India?

Upstox is a strong general starting point, while Kite Connect suits Zerodha users, DhanHQ fits options and deeper NSE depth, and SmartAPI fits Angel One accounts. The right choice depends on the exact NSE/BSE segment, data fields, order rate, and account you will use.

Can one API trade both NSE and BSE?

Yes, several broker APIs support NSE and BSE cash instruments, and some support derivatives on both exchanges. Coverage is not identical across segments or feed modes. Verify the broker's current instrument master and entitlements for NSE_EQ, BSE_EQ, NSE_FO, and BSE_FO instead of assuming “NSE/BSE” covers everything.

Do I need a static IP for an algo-trading API in India?

The NSE retail-algo implementation standards require static-IP mapping for client API access, with a primary and optional secondary IP. Brokers implement onboarding and validation in their own systems, so follow the current broker instructions and test failover before live trading.

Is Drishti an execution API?

No. Drishti provides structured Indian-market data and event streams for announcements, earnings, news, conference calls, block deals, alerts, and agent workflows. Pair it with a broker API when the system also needs positions, margins, or order execution.

Start with the data contract

Write down the exact NSE and BSE fields, intervals, depth, order operations, and regulatory path your strategy needs. Then test two broker APIs with the same instrument and failure cases.

If company events are part of the signal, inspect the Drishti documentation and add that feed beside—not inside—the execution layer. Keeping market events, strategy logic, risk checks, and broker orders separate makes the first production version easier to test and audit.

Keep exploring