Kite Connect API

From WebNotes, a public knowledge base. Last updated . Reading time ~16 min.

Kite Connect is the application programming interface (API) platform operated by Zerodha that exposes the order management, market data, portfolio, and account functions of Kite to third-party developers, fintech companies, and individual algorithmic traders. The API is accessible at api.kite.trade and documented at kite.trade/docs/connect/. Kite Connect is structured as a REST API for transactional operations and a binary WebSocket endpoint for real-time streaming market data.

Kite Connect is used to build algorithmic trading systems, portfolio analytics platforms, strategy backtesting tools, brokerage white-label applications, and research dashboards. Zerodha charges a monthly subscription fee for Kite Connect access, distinct from the zero-commission brokerage model for retail clients trading manually through Kite Web or Kite Mobile. As of 2024, Kite Connect has been integrated by hundreds of third-party fintech applications and by a large community of individual developers building personal trading systems. The Kite Connect ecosystem article covers the developer community, official client libraries, and marketplace in detail.

History and development

Zerodha introduced Kite Connect in 2016, shortly after the Kite platform itself launched. The motivation, documented in Z-Connect, was that the Kite front end was itself built on an internal API, and opening that same API to external developers would allow a broader ecosystem to develop around Zerodha’s brokerage without requiring Zerodha to build every use case in-house. This philosophy was consistent with Zerodha’s general approach of partnering with and investing in complementary fintech products rather than building all verticals internally.

The initial Kite Connect offered order placement, order book retrieval, position retrieval, and a basic quote endpoint. Subsequent versions added:

  • Historical candle data endpoints (introduced under a separately priced subscription plan)
  • Streaming market data over WebSocket
  • Mutual fund transaction endpoints for Zerodha Coin
  • GTT (Good Till Triggered) order management endpoints
  • Margin and charge calculation endpoints
  • Basket order endpoint for multi-leg submissions

Kite Connect version 3 (current as of 2024) consolidated the endpoint nomenclature, aligned data models with the Kite 3 platform redesign, and introduced the iceberg order variety and auction order support. The official Python client library (pykiteconnect), maintained by Zerodha on GitHub, is the reference implementation; community-maintained clients exist for JavaScript (kiteconnect-js, maintained by Zerodha), Java, R, C#, and Go.

Authentication

Kite Connect uses a three-legged OAuth-style authentication flow designed to ensure that access tokens are user-authorised and day-scoped:

  1. The developer’s application redirects the user to Zerodha’s login URL with the application’s API key as a query parameter.
  2. The user completes Zerodha’s standard login (user ID, password, TOTP second factor). This is the standard Kite login flow.
  3. Zerodha redirects to the developer’s registered redirect URL with a one-time request token appended as a query parameter.
  4. The developer’s server makes a server-to-server call to Kite Connect’s session creation endpoint, passing the request token, API key, and API secret (SHA-256 hash). The server returns an access token.

The access token is valid until approximately 07:00 IST the following calendar day, after which a new token must be generated. This design ensures that each trading day’s API access requires a fresh, user-authorised login, preventing persistent unattended access indefinitely.

Each Kite Connect application (identified by an API key and API secret pair) can manage sessions for multiple end-users simultaneously. Each user has their own access token; the developer’s server stores and manages the per-user token. White-label platforms and advisory services use this multi-user capability to serve their client base through a single API key.

The API secret must never be transmitted client-side; the token exchange must occur server-to-server to prevent compromise of the API secret. The request token is single-use and short-lived (valid for a few minutes after issuance).

REST API endpoints

Order management

Order placement, modification, and cancellation are the core operations of Kite Connect.

POST /orders/{variety} places a new order. The variety path parameter specifies the order family:

  • regular: Standard limit, market, SL, or SL-M orders with day or IOC validity
  • amo: After-market orders, queued for submission at the next session open
  • co: Cover orders (two-leg intraday with mandatory stop-loss)
  • iceberg: Large orders split into smaller disclosed quantities submitted progressively
  • auction: For participating in NSE’s auction session for illiquid equities

Required parameters include exchange (NSE, BSE, NFO, BFO, CDS, BCD, MCX), tradingsymbol (the instrument’s exchange symbol), transaction_type (BUY or SELL), quantity (number of units), product (CNC, MIS, NRML, MTF), order_type (LIMIT, MARKET, SL, SL-M). Optional parameters include price (required for LIMIT and SL), trigger_price (required for SL and SL-M), validity (DAY, IOC, TTL), disclosed_quantity, and tag (a custom alphanumeric tag for order tracking).

The response returns an order_id if the order is accepted by Zerodha’s OMS. Order acceptance does not guarantee exchange submission; the OMS performs pre-checks (margin adequacy, instrument validity, order parameter validity) before submitting to the exchange.

PUT /orders/{variety}/{order_id} modifies a pending order’s price, quantity, order type, or validity. Not all modifications are permitted on all order types; for example, product type changes on executed orders require the position conversion endpoint.

DELETE /orders/{variety}/{order_id} cancels a pending order.

GET /orders retrieves the complete order book for the session, with status, price, quantity, and fill details for each order.

GET /orders/{order_id}/trades retrieves the individual trade fills (partial or full) for a specific order.

Portfolio endpoints

GET /portfolio/holdings returns the client’s demat account equity holdings with quantity, average cost, last price, current value, and P&L. Holdings data is sourced from CDSL or NSDL via Zerodha’s DP data feed; there may be an intraday lag in reflecting same-day demat credits.

GET /portfolio/positions returns open intraday (day) and carry-forward (net) positions with quantity, average price, last price, and unrealised P&L. Day positions reflect the current session’s intraday trades; net positions reflect carry-forward derivatives and any overnight delivery positions opened in the current session.

POST /portfolio/positions converts an open position from intraday (MIS) product type to carry-forward (NRML or CNC) or vice versa, subject to margin availability. This is used by strategies that decide intraday whether to carry a position overnight.

Market data endpoints

GET /quote returns a full quote for one or more instruments specified by their exchange:tradingsymbol pair. The response includes LTP, OHLC, volume, change, average traded price, OI (for derivatives), depth (five-level bid-offer), and last trade time.

GET /quote/ltp returns only the last traded price, useful for high-frequency polling of a large instrument list where full quote bandwidth is unnecessary.

GET /quote/ohlc returns OHLC and LTP for one or more instruments, a middle-ground between LTP-only and full quote.

GET /instruments downloads the complete instrument master list for all exchanges as a gzip-compressed CSV file. The instrument list maps trading symbols (human-readable) to numeric instrument tokens (used for WebSocket subscriptions and historical data requests). The instrument list is updated daily by Zerodha before market open; developers typically refresh it daily to capture new listings, expiry roll-overs for derivatives, and delistings.

The instrument list includes, per row: instrument_token, exchange_token, tradingsymbol, name, last_price, expiry (for derivatives), strike (for options), tick_size, lot_size, instrument_type (EQ, FUT, CE, PE, etc.), segment, and exchange.

GET /instruments/historical/{instrument_token}/{interval} returns historical OHLCV candle data. The interval can be minute, 3minute, 5minute, 10minute, 15minute, 30minute, 60minute, day, week, or month. The date range is specified by from and to query parameters. Access to this endpoint requires a Kite Connect subscription that includes historical data (separately priced from the basic API subscription).

The historical data store covers NSE instruments going back to 2000 for the day interval, and generally to 2010-2015 for intraday intervals, depending on the instrument. This is among the deepest historical data accessible to retail developers through any Indian broker API.

Mutual fund endpoints

The mutual fund endpoints expose Zerodha Coin’s direct mutual fund investment functionality via API:

POST /mf/orders places a mutual fund purchase or redemption order for a direct plan scheme. Parameters include tradingsymbol (the scheme’s Kite symbol), transaction_type (BUY or SELL), amount (for purchase) or quantity (for redemption), and tag.

GET /mf/orders retrieves the list of pending and completed mutual fund orders with status, NAV at which the order was processed, and units allotted or redeemed.

GET /mf/holdings retrieves the client’s mutual fund holdings with units, average NAV, and current value.

POST /mf/sips creates a new SIP instruction specifying the scheme, amount, frequency, start date, and the number of instalments (or indefinite duration).

PUT /mf/sips/{sip_id} modifies an existing SIP’s amount, frequency, or status (pause or resume).

DELETE /mf/sips/{sip_id} cancels an SIP instruction.

GET /mf/instruments downloads the list of available direct plan mutual fund schemes with their Kite trading symbols, AMFI codes, scheme names, and NAV.

GTT (Good Till Triggered) endpoints

POST /gtt/triggers creates a new GTT trigger. The payload specifies the type (single trigger or OCO, One Cancels Other), the trigger condition (instrument, trigger price, last price at time of creation), and the orders to be placed when triggered (instrument, transaction type, quantity, order type, and limit price).

GET /gtt/triggers retrieves all active GTT triggers with their status, creation time, and trigger condition.

GET /gtt/triggers/{trigger_id} retrieves a specific GTT trigger’s details.

PUT /gtt/triggers/{trigger_id} modifies a pending GTT trigger’s conditions or order parameters.

DELETE /gtt/triggers/{trigger_id} deletes a GTT trigger before it fires.

Margin and charge calculation endpoints

GET /user/margins returns the client’s margin summary, segmented by equity and commodity. Fields include available cash, available margin (including collateral), used margin (blocked by open positions), and net available balance.

GET /user/margins/{segment} returns the margin summary for a specific segment (equity or commodity).

POST /margins/orders computes the estimated margin required for a specified order or basket of orders before submission. Useful for pre-trade checks in algorithmic strategies to verify margin adequacy before placing an order.

POST /charges/orders computes the estimated brokerage and statutory charges (STT, exchange transaction charge, SEBI turnover fee, GST, stamp duty) for a basket of orders, based on the current charge schedule. Useful for P&L calculation in backtesting and strategy performance reporting.

WebSocket streaming

Kite Connect’s WebSocket endpoint (wss://ws.kite.trade) delivers real-time market data in binary frame format. The connection is established with the access token as an authentication parameter.

Subscription model

After connecting, the client sends a JSON subscribe message specifying a list of instrument tokens (numeric identifiers from the instrument list) and an optional mode (LTP, quote, or full). The server delivers quote packets for subscribed instruments at the exchange’s data dissemination rate (typically within 100-200 milliseconds of the exchange reporting the trade or quote change).

Instruments can be added or removed from the subscription list by sending additional subscribe or unsubscribe messages on the established connection. Mode changes for existing subscriptions are sent as set_mode messages.

Binary frame format

The binary format encodes each instrument’s data compactly:

LTP mode (8 bytes per instrument): Instrument token (4 bytes) and last traded price as a scaled integer (4 bytes).

Quote mode (~44 bytes per instrument): Instrument token, LTP, last traded quantity, average traded price, volume, buy quantity, sell quantity, open, high, low, close, change, and exchange timestamp.

Full mode (~184 bytes per instrument): All quote-mode fields plus five bid levels (price and quantity each) and five offer levels (price and quantity each), last trade time, and OI for derivatives.

Prices are transmitted as integers scaled by the tick size to avoid floating-point precision issues; the client divides by the divisor (100 for NSE equities, instrument-specific for commodities) to recover the decimal price.

Error handling and reconnection

The Kite Connect WebSocket server closes the connection with a specific error code if the access token is invalid or expired, if the subscription message is malformed, or if the server encounters an internal error. Well-designed client implementations handle these close codes and implement exponential backoff reconnection logic. Zerodha’s pykiteconnect library includes built-in reconnection support with configurable retry parameters.

Rate limits

Order placement requests are rate-limited per access token. Quote and WebSocket subscription requests are rate-limited by instrument count and call frequency. Historical data requests are rate-limited by date range and calls per minute or per hour, as specified in Kite Connect’s API documentation.

Rate limit responses return HTTP 429; well-designed clients implement rate-limit backoff using the Retry-After header value returned in the 429 response.

Pricing

As of 2024, Kite Connect offers a base subscription plan covering order management, portfolio, and market data quote endpoints. Historical data access (the instruments/historical endpoint) is an add-on with a higher monthly fee. Developers generating high order volumes may be eligible for volume-based pricing arrangements; Zerodha’s published rate card (kite.trade/plan/) is the current authoritative pricing source.

Regulatory considerations

SEBI’s circular on algorithmic trading (SEBI/MRD/DoP/SE/Cir-2/2012) requires that all algorithmic orders be routed through the broker’s OMS and that the broker maintain audit logs of all algorithmically generated orders. Kite Connect’s design satisfies this by routing all API-generated orders through Zerodha’s OMS; orders placed via API appear in the same trade book and contract notes as manually placed orders.

SEBI’s 2022 consultation paper on algorithmic trading by retail investors proposed additional measures including broker-side strategy whitelisting and exchange-level registration of algorithmic strategies used by retail clients through broker APIs. As of 2024-2026, aspects of this framework were being progressively implemented by SEBI and the exchanges.

Developers who build commercially deployed applications using Kite Connect are responsible for their own regulatory compliance, including any SEBI registration requirements applicable to their service (e.g., investment adviser or research analyst registration for platforms that provide personalised recommendations or research).

Instrument universe and token system

Kite Connect’s order management and market data endpoints reference instruments using a numeric instrument token assigned by Zerodha, rather than the NSE or BSE trading symbol directly. The instruments endpoint (GET /instruments) returns a CSV-format file listing all tradable instruments with their token, exchange-assigned symbol, ISIN, lot size, tick size, instrument type (equity, futures, options), and expiry date (for derivatives).

The full instruments CSV for NSE equity alone contains tens of thousands of rows; the complete file across NSE, BSE, NFO (NSE F&O), CDS (currency derivatives), BFO (BSE F&O), MCX (commodities), and other segments runs to several hundred thousand rows. Client applications typically download this file at the start of each trading day, build an in-memory lookup from symbol to token, and use the numeric token for all subsequent API calls and WebSocket subscriptions.

The instrument token scheme also handles the complexity of derivative contracts with multiple expiry dates and strikes: each combination of underlying, expiry, strike, and option type (call/put) is a distinct instrument with its own token. Correctly subscribing to the intended contract requires filtering the instruments list for the desired combination.

Mutual fund API

Kite Connect provides a separate set of endpoints for direct mutual fund order placement through Zerodha Coin. These endpoints allow third-party applications to submit mutual fund purchase (lump-sum and SIP) and redemption orders on behalf of an authenticated Zerodha client:

  • POST /mf/orders, Place a mutual fund purchase order.
  • GET /mf/orders, List all mutual fund orders.
  • POST /mf/sips, Create a SIP (Systematic Investment Plan).
  • GET /mf/sips, List all active SIPs.
  • DELETE /mf/sips/:id, Cancel a SIP.
  • GET /mf/holdings, Retrieve current mutual fund holdings.
  • GET /mf/instruments, Retrieve the list of tradable direct plan schemes.

The mutual fund API enables platforms like Smallcase and portfolio management applications to place mutual fund transactions on behalf of Zerodha clients, extending the ecosystem of applications beyond equity trading.

See also

References

  1. Zerodha. “Kite Connect API documentation”. kite.trade/docs/connect/. Accessed May 2026.
  2. Zerodha Z-Connect Blog. “Introducing Kite Connect”. z-connect.zerodha.com. 2016.
  3. Zerodha. “Kite Connect pricing”. kite.trade/plan/. Accessed May 2026.
  4. SEBI. “Circular on algorithmic trading”. SEBI/MRD/DoP/SE/Cir-2/2012. March 2012.
  5. SEBI. “Consultation paper on algorithmic trading by retail investors”. sebi.gov.in. August 2022.
  6. NSE. “Circular on algorithmic trading framework”. nseindia.com. Accessed May 2026.
  7. Zerodha GitHub. “pykiteconnect, Python client for Kite Connect”. github.com/zerodha/pykiteconnect. Accessed May 2026.
  8. Zerodha GitHub. “kiteconnect-js, JavaScript client for Kite Connect”. github.com/zerodha/kiteconnect-js. Accessed May 2026.

Reviewed and published by

The WebNotes Editorial Team covers Indian capital markets, payments infrastructure and retail investor procedures. Every article is fact-checked against primary sources, principally SEBI circulars and master directions, NPCI specifications and the official support documentation published by the intermediary in question. Drafts go through a second-pair-of-eyes review and a separate compliance read before publication, and revisions are tracked against the SEBI and NPCI rule changes referenced in the methodology section.

Last reviewed
Conflicts of interest
WebNotes is independent. No relationship with any broker, registrar or bank named in this article.