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.

The KiteConnectParams interface defines the configuration object you pass to the KiteConnect constructor. Only api_key is required — all other fields have sensible defaults that work for most applications.
import { KiteConnect } from 'kiteconnect-ts';

const kc = new KiteConnect({
  api_key: 'YOUR_API_KEY',
  access_token: 'YOUR_ACCESS_TOKEN', // optional, set after login
  root: 'https://api.kite.trade',    // optional
  debug: false,                       // optional
  timeout: 7000,                      // optional, ms
});

Parameters

api_key
string
required
The API key issued to you by Zerodha when you registered your app. Every request to the Kite Connect API is authenticated using this key together with an access_token.
access_token
string
The session token obtained after a successful login flow in exchange for a request_token. Before the user logs in this is null. Once you obtain it you should persist it (database, session store, etc.) and pass it here on subsequent requests so you avoid a new login on every startup.Default: null
root
string
default:"https://api.kite.trade"
The base URL for all REST API calls. You only need to change this if you are testing against a staging environment or a custom proxy.Default: "https://api.kite.trade"
login_uri
string
default:"https://kite.trade/connect/login"
The URL to which users are redirected to complete the OAuth login flow. Override this only if Zerodha provides you with a custom login endpoint.Default: "https://kite.trade/connect/login"
debug
boolean
default:"false"
When set to true, the client logs every outgoing request and incoming response to the console. Useful during development; keep it false in production to avoid leaking tokens.Default: false
timeout
number
default:"7000"
The number of milliseconds the HTTP client waits for a response before rejecting the request with a network error. Increase this value if you are on a slow network or if you are fetching large instrument dumps.Default: 7000

Full example

import { KiteConnect } from 'kiteconnect-ts';

const kc = new KiteConnect({
  api_key: 'abc123',
  access_token: 'xyz789',
  root: 'https://api.kite.trade',
  login_uri: 'https://kite.trade/connect/login',
  debug: false,
  timeout: 7000,
});
Store api_key and access_token in environment variables rather than hard-coding them. Use process.env.KITE_API_KEY and process.env.KITE_ACCESS_TOKEN to load them at runtime.

Build docs developers (and LLMs) love