Complete reference for Kite Connect API endpoints
1 endpoints
/api/user/profileGet user profile and margins
const profile = await kite.fetchProfile();
console.log(profile);3 endpoints
/api/orders/regularPlace regular order
const order = {
exchange: 'NSE',
tradingsymbol: 'INFY',
transaction_type: 'BUY',
quantity: 1,
price: 1450.0,
product: 'NRML',
order_type: 'LIMIT'
};
const orderId = await kite.placeOrder(order);/api/orders/{order_id}Modify order
const modified = await kite.modifyOrder(order_id, {
price: 1455.0,
quantity: 2
});/api/orders/{order_id}Cancel order
await kite.cancelOrder(order_id);3 endpoints
/api/instruments/{exchange}Get instruments list
const instruments = await kite.getInstruments('NSE');
console.log(instruments);/api/quote/{instrument}Get quote for instrument
const quote = await kite.getQuote('NSE:INFY');
console.log(quote.last_price);/api/ohlc/{instruments}Get OHLC data
const ohlc = await kite.getOHLC(['NSE:INFY', 'NSE:TCS']);
console.log(ohlc);1 endpoints
/api/historical/{instrument}/{interval}Get historical candles
const candles = await kite.getHistoricalData(
'NSE:INFY',
'day',
'2024-01-01',
'2024-01-31'
);
candles.forEach(candle => {
console.log(candle.date, candle.ohlc);
});To use the Kite Connect API, you'll need an API key pair. Follow these steps:
const KiteConnect = require('kiteconnect').KiteConnect;
const kite = new KiteConnect({
api_key: 'your_api_key'
});
kite.generateSession('request_token', 'api_secret')
.then(response => {
console.log(response.access_token);
});