Skip to main content

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.

KiteConnect provides four methods for live market data (instruments master, full quote, OHLC, and LTP) and one method for historical candles. You identify instruments using the exchange:tradingsymbol format (e.g., NSE:INFY) for quote methods, and by numeric instrument_token for historical data.

getInstruments

Download the full list of tradeable instruments across all exchanges, or filter by one or more exchanges.
// All instruments across every exchange
const all = await kc.getInstruments();

// Only NSE instruments
const nse = await kc.getInstruments(['NSE']);

// Multiple exchanges
const fno = await kc.getInstruments(['NFO', 'BFO']);
Returns Promise<Instrument[]>.
The instruments master is a large dataset — often several hundred kilobytes with tens of thousands of entries. Fetch it once at application startup or cache it, rather than calling it on every request.
instrument_token
string
Numerical identifier used to subscribe to live market data via the WebSocket API (returned as a string from the CSV source).
exchange_token
string
The numerical identifier issued by the exchange.
tradingsymbol
string
Exchange trading symbol (e.g., RELIANCE, NIFTY23DECFUT).
name
string
Company or contract name (populated for equity instruments).
last_price
number
Last traded market price at the time of the master download.
expiry
Date
Expiry date for derivatives instruments. Empty for equity.
strike
number
Strike price for options contracts. 0 for non-options.
tick_size
number
Minimum price movement (price tick).
lot_size
number
Quantity of a single lot (relevant for F&O).
instrument_type
string
EQ (equity), FUT (futures), CE (call option), or PE (put option).
segment
string
Segment the instrument belongs to (e.g., NSE, NFO-FUT, NFO-OPT).
exchange
string
Exchange where the instrument is listed.

getQuote

Retrieve full market depth and quote data for one or more instruments.
const quotes = await kc.getQuote(['NSE:INFY', 'NSE:RELIANCE']);

const infy = quotes['NSE:INFY'];
console.log(infy.last_price, infy.volume);
console.log(infy.ohlc.open, infy.ohlc.high, infy.ohlc.low, infy.ohlc.close);
console.log(infy.depth.buy[0].price, infy.depth.sell[0].price);
Returns Promise<Record<string, Quote>>. The response is keyed by the exchange:tradingsymbol string you passed in.
instrument_token
number
Numerical exchange instrument identifier.
timestamp
string
Exchange timestamp of the quote packet.
last_trade_time
string | null
Timestamp of the last trade.
last_price
number
Last traded market price.
last_quantity
number
Quantity of the last trade.
average_price
number
Volume-weighted average price (VWAP) for the session.
volume
number
Total volume traded today.
buy_quantity
number
Aggregate pending buy order quantity at the exchange.
sell_quantity
number
Aggregate pending sell order quantity at the exchange.
open_interest
number
Open interest (F&O only).
oi
number
Current open interest for the session.
oi_day_high
number
Highest open interest recorded during the day.
oi_day_low
number
Lowest open interest recorded during the day.
net_change
number
Absolute change from the previous close to the last price.
lower_circuit_limit
number
Current lower circuit breaker price.
upper_circuit_limit
number
Current upper circuit breaker price.
ohlc
object
depth
object

getOHLC

Retrieve OHLC and last price for one or more instruments. Lighter than a full quote when you don’t need order book depth.
const ohlc = await kc.getOHLC(['NSE:INFY', 'BSE:RELIANCE']);

const infy = ohlc['NSE:INFY'];
console.log(infy.last_price);
console.log(infy.ohlc.open, infy.ohlc.close);
Returns Promise<Record<string, { instrument_token: number; last_price: number; ohlc: { open: number; high: number; low: number; close: number } }>>.

getLTP

Retrieve only the last traded price for one or more instruments. Use this for the most lightweight market-data call.
const ltp = await kc.getLTP('NSE:NIFTY 50');
console.log(ltp['NSE:NIFTY 50'].last_price);

// Multiple instruments
const ltps = await kc.getLTP(['NSE:INFY', 'NSE:TCS']);
Returns Promise<Record<string, { instrument_token: number; last_price: number }>>.

getHistoricalData

Retrieve OHLCV candle data for an instrument over a date range.
const candles = await kc.getHistoricalData(
  '408065',          // instrument_token for NSE:INFY
  '5minute',
  '2024-01-01 09:15:00',
  '2024-01-31 15:30:00',
  false,             // continuous — set true for continuous futures contracts
  false              // oi — set true to include open interest data
);

candles.forEach((c) => {
  console.log(c.date, c.open, c.high, c.low, c.close, c.volume);
});
Signature:
getHistoricalData(
  instrument_token: string,
  interval: 'minute' | 'day' | '3minute' | '5minute' | '10minute' | '15minute' | '30minute' | '60minute',
  from_date: string | Date,
  to_date: string | Date,
  continuous?: boolean,
  oi?: boolean
): Promise<{ date: Date; open: number; high: number; low: number; close: number; volume: number; oi?: number }>
instrument_token
string
required
The numeric instrument token from the instruments master. Retrieve it via getInstruments() and look up your symbol.
interval
string
required
Candle interval. Supported values:
  • minute — 1-minute candles
  • 3minute — 3-minute candles
  • 5minute — 5-minute candles
  • 10minute — 10-minute candles
  • 15minute — 15-minute candles
  • 30minute — 30-minute candles
  • 60minute — 60-minute candles
  • day — Daily candles
from_date
string | Date
required
Start of the date range. Pass a Date object or a string in yyyy-mm-dd HH:MM:SS format.
to_date
string | Date
required
End of the date range. Same format as from_date.
continuous
boolean
default:"false"
When true, returns a continuous back-adjusted series for futures and options instruments instead of the front-month contract.
oi
boolean
default:"false"
When true, each candle includes an oi field with the open interest at that timestamp (F&O instruments only).
Each returned candle object has these fields:
FieldTypeDescription
dateDateCandle open timestamp
opennumberOpening price
highnumberHighest price in the interval
lownumberLowest price in the interval
closenumberClosing price
volumenumberVolume traded in the interval
oinumberOpen interest (only present when oi: true)
To look up the instrument_token for a symbol, call getInstruments() once, filter by tradingsymbol, and cache the token locally. Avoid fetching the instruments master on every historical data request.

Build docs developers (and LLMs) love