This guide walks you through installing kiteconnect-ts, authenticating with the Kite Connect API, and making your first API call. By the end you will have a working session and know how to stream live market ticks usingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/anurag-roy/kiteconnect-ts/llms.txt
Use this file to discover all available pages before exploring further.
KiteTicker.
KiteConnect quickstart
Install the package
Add
kiteconnect-ts to your Node.js project using your preferred package manager.Initialize KiteConnect
Import the
KiteConnect class and create an instance with your API key. You can get your API key from the Kite Connect developer portal.Get the login URL
Generate the login URL and redirect your user to it. After a successful login, Zerodha redirects the user back to your registered redirect URL with a
request_token in the query parameters.You configure the redirect URL in the Kite Connect developer portal when you create your app. Your server must be listening at that URL to receive the
request_token after login.Generate a session
Once your server receives the
request_token from the redirect callback, exchange it for an access_token using generateSession(). This call also sets the access token on the kc instance automatically.KiteTicker quickstart
KiteTicker connects to Zerodha’s WebSocket endpoint and streams real-time market ticks. You need a valid access_token before connecting.
Register event handlers
Register handlers for the
ticks and connect events before calling connect(). The connect event fires once the WebSocket connection is established — subscribe to instruments from inside this handler.Next steps
Authentication
Learn how to persist your access token, handle expiry, and implement logout.
Place orders
Place, modify, and cancel equity and derivative orders.
Market data
Fetch live quotes, OHLC, LTP, and historical candle data.
WebSocket events
Handle all ticker events including ticks, reconnect, and order updates.