NineFifteenAM

Pillar guide · updated monthly

Zerodha Kite Connect: get your API key and refresh the token daily

2 min readBy NineFifteenAM

A short, practical guide to getting a Kite Connect API key and handling the access token that expires every morning.

Short answer

Sign up at developers.kite.trade, create an app to get your API key and secret, and pay ₹500/month if you need market data. The access token expires at 6 AM every day, so you need to log in again each trading morning, either by hand or with a scheduled script.

Getting a Kite Connect API key takes ten minutes. The part that catches everyone is that the access token expires every day at 6 AM. Here's how to handle both.

Step 1: Get your API key

  1. Sign up at developers.kite.trade/signup. This is separate from your normal Kite login.
  2. Choose a plan:
Plan Cost What you get
Personal Free Place orders, view positions, holdings and funds
Connect ₹500/month Everything above, plus live and historical market data
  1. Go to My Apps → Create New App and fill in your app name, Zerodha Client ID and a redirect URL (http://127.0.0.1:8000 works for personal use).
  2. You'll get an API key and API secret. Keep the secret private, like a password.

Step 2: Understand the daily token

Credential Lasts
API key and secret Until you regenerate them
Access token Until 6 AM the next day

Every API call needs a valid access token, so you need a new one each trading day.

Step 3: Refresh the token each morning

By hand:

  1. Open https://kite.zerodha.com/connect/login?v=3&api_key=YOUR_API_KEY and log in.
  2. Copy the request_token from the URL you're redirected to.
  3. Exchange it for an access token:
from kiteconnect import KiteConnect

kite = KiteConnect(api_key="YOUR_API_KEY")
data = kite.generate_session("REQUEST_TOKEN", api_secret="YOUR_API_SECRET")
kite.set_access_token(data["access_token"])

Automatically:

Most people script the login so they don't have to do it every morning. The script generates your 2FA code from your TOTP secret (using the pyotp library), completes the login, grabs the request_token and exchanges it as above. Schedule it to run every weekday before market open.

Stay safe

Sources

Questions people ask me

Why does my access token stop working every day?

Zerodha expires every Kite Connect access token at 6 AM the next day. It's a regulatory rule, so there's no way to keep one alive longer.

Is Kite Connect free?

Placing orders and reading your positions and holdings is free. Live and historical market data costs ₹500/month per API key.

What's the difference between the API key and the access token?

The API key and secret identify your app and don't change. The access token comes from a fresh login and expires every morning.

zerodhakite connectbroker apiaccess tokengetting started
N

NineFifteenAM

One trader building an options bot for Indian index markets since early 2026. I write down how it is built, what broke, and what it cost — no tips, no calls, no returns.

Related

26 Sept 2026
Algo trading in India: the rules, the cost, and what to do firstWhat the law requires of a retail algo trader in India, what a system costs to run after the April 2026 STT change, and the order to build it in.
Guides
25 Sept 2026
Seven bugs in my trading bot that never threw an errorA strategy that could never trade, an order that was silently never placed, a data feed that recorded zero rows for a session. The quiet failures from six months of running a trading bot, and the checks that catch them.
Mistakes that cost me
27 Sept 2026
Nine rules I use so my trading data can't fool mePoints instead of rupees, resampling days instead of trades, an out-of-sample findings register, and the other analysis rules I wrote after my own trade data misled me — each with the example that caused it.
Best practices