Broker integration · Zerodha

Zerodha Kite Connect development

Kite Connect is Zerodha’s API for placing orders, reading positions and streaming live prices. We build automated trading systems on it to your rules, for equities and F&O on NSE, BSE and MCX. This page covers what a Kite Connect system has to handle, from the morning login to Zerodha’s order limits, and the Zerodha work we have delivered.

  1. Your strategyyour rules, your limits
  2. Your trading enginerisk checks, orders, reconciliation
  3. Kite ConnectREST orders, WebSocket prices
  4. Your Zerodha accountNSE, BSE, MCX
A system we build on Kite Connect

The morning login and the access token

Every Kite Connect session starts with the account holder logging in on Zerodha’s own login page. The login returns a request token that lasts only a few minutes, and your system exchanges it, with a checksum made from your API key and secret, for an access token. That access token expires at 6 AM the next day, which Zerodha notes is a regulatory requirement, and a master logout from Kite web ends it sooner.

So a live system needs a morning routine: the account holder logs in before the open, the system confirms it holds a valid token, and it refuses to place a single order without one. We build that check in, with a clear alert if the token is missing or ends during the day.

Live prices over WebSocket

Kite streams prices over a WebSocket in three modes: the last traded price only, a quote without market depth, or a full packet with market depth. One connection carries up to 3,000 instruments and one API key can hold up to three connections, so a system that watches whole option chains plans its subscriptions instead of subscribing to everything.

The server sends a small heartbeat every couple of seconds. We treat a connection that goes quiet as dropped, reconnect, subscribe again, and refresh orders and positions before the strategy acts on new prices.

Orders, products and GTT

Kite orders come in varieties (regular, after market, cover, iceberg and auction), types (market, limit, stop loss and stop loss market) and products: CNC for equity delivery, NRML for futures and options, MIS for intraday positions squared off the same day, and MTF for margin trading. The product decides the margin and what happens at the close, so each of your strategy’s orders has to carry the right one every time.

Good Till Triggered (GTT) orders wait with Zerodha until a price is reached, either as a single trigger or as a two-leg OCO order, where one side cancels the other. They suit stops and targets that must hold even while your own system restarts.

Zerodha’s limits, built into the order layer

Zerodha publishes the limits an API user has to stay inside: 10 orders a second, 400 a minute and 5,000 a day for one user or API key, 25 changes to a single order before it has to be cancelled and placed again, one quote request a second and three historical data requests a second.

A strategy that moves its stop on every tick would use up those 25 changes within minutes, so we throttle and combine changes on our side, and the system knows how close it is to each limit before it sends the next order. If Zerodha does reject a request for rate, the system waits and retries in order rather than flooding the API.

Order updates and reconciliation

Order status changes reach your system as postbacks to a URL you register, or over the WebSocket, which Zerodha recommends for individual developers. Either way we confirm fills, partial fills included, against the order book and positions instead of assuming them, and reconcile what the system believes it holds against what Zerodha reports all day.

Historical data for testing

Kite’s historical data API returns candles from one minute to one day, with open interest on request and continuous daily data for NFO and MCX futures. The same feed can serve a backtest of your rules and the warm up of the live system each morning. Our guide on backtesting an options strategy covers what a fair test needs.

Within SEBI’s framework

Algorithmic trading through Indian brokers runs within SEBI’s framework and your broker’s terms. Under SEBI’s rules for retail algorithmic trading, brokers can require things such as a registered static IP and identification of algorithmic orders. We build to whatever your broker requires, and the strategy and every trading decision stay yours. What the rules mean in practice is in our guide to SEBI’s retail algo trading rules. More on the India page, and for other Indian brokers, see Indian broker API integration.

Examples from our work

  • One platform running a client’s six strategies for 20 accounts across Zerodha, Angel One, Dhan, Jainam and MasterTrust, where adding a broker means building only that broker’s connection. Read the case study.
  • A client’s system first built on Interactive Brokers in 2020 and extended over five years to MasterTrust, Zerodha Kite Connect and Angel One, keeping one order flow and one database across every broker.
  • One order flow across six brokers, Zerodha among them, each with its own login and order format.
  • A system for several accounts on Zerodha and other Indian brokers, where Kite’s live price stream reconnects cleanly after a drop, stops and targets are checked continuously, and open orders are adjusted as prices move.

Client names and results are withheld. This describes the engineering only.

We build software that runs your strategy. On this work the strategy is yours: we give no signals, we don’t manage money, and we make no claim about how any strategy performs. The rules and every trading decision stay yours.

Common questions

Why does a Kite Connect bot need me to log in every day?
Kite Connect access tokens expire at 6 AM the next day, so the account holder logs in each morning to start a new session. We build the system to make that quick and to stay idle until a valid session exists.
What happens if my strategy hits Zerodha’s order limits?
Kite Connect rejects requests above its limits, which include 10 orders a second, 400 a minute, 5,000 a day and 25 changes to one order. We build the order layer to stay inside them, to queue and retry in order when it must, and to alert you before a limit stops your strategy.
Can you automate F&O strategies on Zerodha?
Yes. We build your F&O strategy to your rules, including option chain handling, strike selection, multi-leg orders and expiry day logic. The strategy is yours; we give no F&O tips.
Do you also work with other Indian brokers?
Yes. We have delivered work on fourteen Indian brokers, and one system can trade through Zerodha and other brokers together. See our page on Indian broker API integration.

All broker and platform integrations →

start here

Tell us your market, your broker, and what you want automated.

Send us the requirement. We'll come back with the questions that turn it into a real scope, cost and timeline, usually within one working day.

Send us your brief

A few lines is enough to start: your rules in plain words, or a link to your script. We'll ask for the rest.

Or WhatsApp us, or book a call with us.

WhatsAppReplies Mon to Sat, 9 am to 6 pm IST