Tutorial

How to Connect Your Zerodha Account to TradeCraft (Free Kite Connect API)

Create a free Kite Connect app, register the static IP TradeCraft gives you, and paste two keys. Every screen, in order, plus what to do when Zerodha says no.

Written by Geet Ramchandani

Published 7 min read

To connect Zerodha to TradeCraft, you create a free Kite Connect Personal app in Zerodha's developer console, whitelist the static IP that TradeCraft gives you, and paste the app's API key and API secret into TradeCraft. It takes about 15 minutes once. After that, connecting is a 20-second Kite login each morning.

Before you start

  • A Zerodha account you can log in to with your password and 2FA.
  • A laptop or desktop. The Kite developer console works on a phone, but copying keys between tabs is much easier on a computer.
  • One sitting of about 15 minutes. TradeCraft holds your IP address for 90 minutes while you finish. If you need longer, reopen the connect window and the hold is extended.
  • No payment. The free Personal plan places orders, which is all TradeCraft needs from Zerodha.

You will move between two browser tabs: TradeCraft and Zerodha's developer console. Keep both open.

Step 1: Get your static IP from TradeCraft

Brokers only accept API orders from an IP address registered on your account. TradeCraft gives each account its own address, so start here.

  1. Log in to TradeCraft and open Brokers in the sidebar.
  2. Under Link a Broker Account, find Zerodha and click Connect.
  3. The Register your trading IP window opens with an address, such as 203.0.113.25. Click the copy button next to it.
TradeCraft Brokers page with the Connect button on the Zerodha card highlighted
1Brokers → Link a Broker Account → Connect on Zerodha.
The Register your trading IP window showing a reserved IP address with a copy button
1Copy the address. Leave this window open — you will come back to it.

Leave this tab open. You come back to it in Step 6.

Step 2: Sign up for the Kite developer console

The developer console is a separate account from your normal Kite login.

  1. Open developers.kite.trade/signup.
  2. Fill in E-mail, Your name, Password, Repeat password, Phone and State of residence. Use the email linked to your Zerodha account if you can.
  3. The form has an optional IP Whitelist box. Paste the IP from Step 1 here, one per line, to save yourself Step 3.
  4. Read the terms, tick I agree to the above terms and click Signup.

Already have a developer account? Log in at developers.kite.trade/login instead.

Kite Connect developer signup form with the IP Whitelist box highlighted
2The signup form. The IP Whitelist box is optional here, but saves a step.

Step 3: Whitelist your TradeCraft IP

Skip this if you pasted the IP during signup and it shows up on your profile.

  1. In the developer console, open your Profile.
  2. In the IP Whitelist section, paste the IP from Step 1 as your primary IP.
  3. Save.
Kite developer console profile page with the IP Whitelist section highlighted
3Profile → IP Whitelist. One entry covers every app on your developer account.

Step 4: Create a free Personal app

  1. Open My Apps and click Create New App.
  2. Choose Personal (free). Do not pick Connect — that is the ₹500-a-month plan with market data, which TradeCraft does not need.
  3. Fill in the form:
FieldWhat to enter
App NameTradeCraft (any name works)
Zerodha Client IDYour Kite user ID, such as AB1234
Redirect URLhttps://gettradecraft.com/auth/broker/zerodha/callback
Postback URLLeave empty
DescriptionAnything, such as Mirror trading with TradeCraft
  1. Click Create.
Kite Connect create app form with Personal selected and the Redirect URL filled in
4Personal, not Connect. The Redirect URL must match exactly.

Step 5: Copy your API key and API secret

  1. Open the app you just created from My Apps.
  2. Copy the API Key.
  3. Click Show API Secret and copy the API Secret.
Kite Connect app details page with the API Key and API Secret fields highlighted, values blurred
5Your API key and secret. Treat the secret like a password.

Never post the secret in a chat or a screenshot. Anyone with both values and a login to your Zerodha account could place orders through your app.

Step 6: Connect in TradeCraft

  1. Go back to the TradeCraft tab. In the Register your trading IP window, click I've registered it.
  2. The Connect Zerodha window opens. Paste your API Key and API Secret.
  3. Click Connect.
  4. Zerodha's login page opens. Log in with your Kite user ID, password and 2FA code.
  5. You come back to TradeCraft and see Connected!. A couple of seconds later you are on the Brokers page, with your Zerodha account listed under Connected Accounts.
The TradeCraft side, from I've registered it to Connected! (Zerodha's own login page is skipped here.)
The TradeCraft side, from I've registered it to Connected! (Zerodha's own login page is skipped here.)

That's it. Your Zerodha account can now take part in mirror trading and live strategies.

Every morning: log in again

Zerodha ends every API session at 6 AM the next day. This is a regulatory rule, and no platform can skip it. Until you log in again, TradeCraft cannot place orders in that account.

  1. Open Brokers in TradeCraft. The account shows Session expired (tokens reset daily at 6 AM).
  2. Click Reconnect. Your API key and secret are already filled in.
  3. Click Reconnect again and log in to Kite.

Logging out of Kite Web ends the session too, so avoid the Logout button on Kite during market hours if you rely on TradeCraft that day.

If something goes wrong

What you seeWhat it meansWhat to do
Kite shows Invalid api_keyThe API key was pasted wrongCopy it again from My Apps and reconnect
After logging in to Kite you land on the wrong pageThe app's Redirect URL does not matchEdit the app and paste the Redirect URL from Step 4 exactly
No authorization token received from brokerThe login was cancelled or did not return to TradeCraftStart again from Brokers → Connect
API credentials not foundYou finished the Kite login in a different tab, window or private windowStart again from the Brokers page, and finish in the same tab
Broker authentication failed: Token exchange failedThe login took more than a few minutes, or the API secret is wrongTry again straight away; if it repeats, copy the secret again
Orders rejected with IP … is not allowed to place orders for this appThe whitelisted IP does not match the one TradeCraft gave youCompare the two addresses in Profile → IP Whitelist
The IP address(es) you are trying to add are already linked to another accountThat address is on another Kite developer accountContact TradeCraft support before changing anything

Still stuck? Write to [email protected] with the exact error message. Never include your API secret.

Key takeaways

  • Use the free Personal Kite Connect plan — TradeCraft only needs to place orders.
  • Get the static IP from TradeCraft first, whitelist it under Profile → IP Whitelist, and only then connect.
  • The Redirect URL is https://gettradecraft.com/auth/broker/zerodha/callback, exactly.
  • Zerodha ends the session at 6 AM every day: click Reconnect each morning.

Frequently asked questions

Is the Kite Connect API free?
The Personal plan is. It lets software place orders and read your positions, holdings and funds, which is all TradeCraft needs from Zerodha. The paid Connect plan (₹500 a month) adds live and historical market data; you do not need it for TradeCraft.
Do I have to log in to Zerodha every day?
Yes. Zerodha ends every API session at 6 AM the next morning — a regulatory rule, not a TradeCraft one. Each morning, click Reconnect on your Zerodha account in TradeCraft and log in to Kite. It takes about 20 seconds.
Does TradeCraft see my Zerodha password?
No. You type your password and 2FA code on Zerodha's own login page. TradeCraft only receives the API key and secret of the app you created, and a session that Zerodha ends every morning.
Why do I need a static IP?
SEBI's rules for retail algo trading, enforced by Zerodha from 1 April 2026, require every order placed through an API to come from an IP address registered on your account. TradeCraft gives each account a dedicated address; you register it once in the Kite developer console.
Can I change the IP later?
Zerodha allows one change to your whitelisted IPs per calendar week, and the change takes effect immediately. Double-check the address before you save it.

Want to try this yourself?

TradeCraft lets you build a strategy, backtest it against historical data, and deploy it on paper before risking a rupee — using your own broker account.

About the author

Geet Ramchandani

Founder & Engineer, TradeCraft

Geet is the founder of TradeCraft, a platform built for retail traders to automate their strategies and mirror trades across broker accounts. With 5+ years of experience trading the markets and hands-on experience with algorithmic trading, he writes about trading systems, execution, backtesting, risk, and what it takes to build them in the real world.