API Documentation

Complete reference for Kite Connect API endpoints

Endpoints

Overview

1 endpoints

GET
/api/user/profile

Get user profile and margins

Example
const profile = await kite.fetchProfile();
console.log(profile);

Orders

3 endpoints

POST
/api/orders/regular

Place regular order

Example
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);
PUT
/api/orders/{order_id}

Modify order

Example
const modified = await kite.modifyOrder(order_id, {
  price: 1455.0,
  quantity: 2
});
DELETE
/api/orders/{order_id}

Cancel order

Example
await kite.cancelOrder(order_id);

Market Data

3 endpoints

GET
/api/instruments/{exchange}

Get instruments list

Example
const instruments = await kite.getInstruments('NSE');
console.log(instruments);
GET
/api/quote/{instrument}

Get quote for instrument

Example
const quote = await kite.getQuote('NSE:INFY');
console.log(quote.last_price);
GET
/api/ohlc/{instruments}

Get OHLC data

Example
const ohlc = await kite.getOHLC(['NSE:INFY', 'NSE:TCS']);
console.log(ohlc);

Historical Data

1 endpoints

GET
/api/historical/{instrument}/{interval}

Get historical candles

Example
const candles = await kite.getHistoricalData(
  'NSE:INFY',
  'day',
  '2024-01-01',
  '2024-01-31'
);

candles.forEach(candle => {
  console.log(candle.date, candle.ohlc);
});

Getting Started

To use the Kite Connect API, you'll need an API key pair. Follow these steps:

  1. Create an API key from the API Keys page
  2. Use the API key to initialize the Kite Connect client
  3. Start making requests to the endpoints
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);
  });