KiteTicker is the WebSocket streaming client in kiteconnect-ts. It connects to Kite’s quote streaming service and delivers live market tick data for any set of instrument tokens you subscribe to. You can control how much data you receive per tick by choosing between three modes — from a minimal last-traded-price packet to a full market-depth snapshot — and the client handles reconnection automatically so your feed stays alive through transient network failures.Documentation 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.
Constructor
Create a ticker instance by passing aKiteTickerParams object to the constructor. Auto-reconnect is enabled by default.
Your Kite Connect API key.
The access token obtained after a successful login flow.
Enable or disable automatic reconnection on disconnect.
Maximum number of reconnection attempts before giving up. Accepted range: 1–300.
Maximum delay in seconds between reconnection attempts. Minimum acceptable value is 5.
Override the Kite WebSocket root URL. Use this only for testing or custom environments.
Quick start
The example below connects to Kite’s streaming service, subscribes to an instrument, and logs incoming ticks.Call connect()
Opens the WebSocket connection to
wss://ws.kite.trade/. The connect event fires when the handshake completes.Subscribe inside the connect handler
Call
subscribe() and setMode() inside your connect callback so they run after the socket is open and again after every reconnection.Tick modes
Each subscribed token streams data at the mode you assign. You can assign different modes to different tokens.| Mode | Constant | Packet size | Contents |
|---|---|---|---|
ltp | ticker.modeLTP | 8 bytes | Last traded price only |
quote | ticker.modeQuote | 44 bytes (tradable), 28 bytes (index) | LTP, OHLC, volume, buy/sell quantities |
full | ticker.modeFull | 184 bytes (tradable), 32 bytes (index) | Quote data + 5-level market depth + open interest |
Public mode constants
The ticker exposes three read-only constants you should use instead of raw strings:Auto-reconnect
Auto-reconnect is enabled by default and uses an exponential backoff algorithm. The reconnect interval starts at 2 seconds and doubles on each failed attempt —2^attempt seconds — until it reaches max_delay, after which it stays constant. Reconnection stops after max_retry attempts.
reconnect event fires on each attempt and the noreconnect event fires when retries are exhausted.
Subscribing
Subscribe to instruments, set tick modes, and manage your active subscriptions.
Events
Handle connection lifecycle, tick data, order updates, and reconnection events.