How to Connect Zerodha Kite API with Excel for Real-time Stock Data

M
MarketXLS Team
Published
Connect Zerodha Kite API with Excel - live NSE stock data streaming and real-time market data in Excel with MarketXLS India

Master the power of live NSE data streaming directly into your Excel spreadsheets with MarketXLS India and Zerodha integration

Introduction

If you're one of Zerodha's 6+ million users, you've probably wished for a way to get live market data directly into Excel for analysis, tracking, or automated trading strategies. The good news? MarketXLS India makes this incredibly simple.

This comprehensive guide will walk you through connecting Zerodha's Kite API with Excel to stream real-time stock prices, options chains, and futures data directly into your spreadsheets—no coding required.

What This Guide Covers

✅ Installing MarketXLS India add-in ✅ Connecting to your Zerodha Kite account ✅ Streaming live NSE stock data ✅ Building dynamic options chains ✅ Tracking futures contracts ✅ Creating automated trading dashboards


What You'll Need

Before we begin, make sure you have:

  • Microsoft Excel (Windows, Mac, or Office 365 Online)
  • Active Zerodha trading account with Kite login credentials
  • MarketXLS India subscription (Get your login credentials)
  • Internet connection for real-time data streaming

Time Required: 10-15 minutes for complete setup


Why Connect Zerodha with Excel?

The Traditional Problem

Most traders face these challenges:

  • ❌ Manually copying stock prices from Kite to Excel
  • ❌ No way to build automated options analysis
  • ❌ Spreadsheets with static, outdated data
  • ❌ Complex coding required for API integration

The MarketXLS Solution

With Zerodha + MarketXLS integration, you get:

  • Live streaming data that updates automatically
  • Zero coding - simple Excel formulas
  • Full market coverage - stocks, options, futures, indices
  • Persistent connections - data refreshes even when you reopen Excel
  • Build custom dashboards with your Zerodha live data

Step-by-Step Installation Guide

Step 1: Access Excel Add-ins Store

  1. Open Microsoft Excel on your computer
  2. Navigate to the Insert tab in the ribbon
  3. Click on Add-insGet Add-ins (or "More Add-ins")
  4. You'll see the Office Add-ins store open

Step 2: Search for MarketXLS India

  1. Click the Store tab in the add-ins window
  2. In the search box, type "MarketXLS"
  3. You'll see two versions - select MarketXLS India (specifically for Indian markets)
  4. Click Add or Continue to install

Important: Make sure you select the India version, not the global MarketXLS add-in. The India version is optimized for NSE/BSE data and broker integrations.

Step 3: Launch the Add-in

  1. After installation completes, you'll see a confirmation message
  2. The MarketXLS India panel will appear on the right side of Excel
  3. If it doesn't appear automatically, go to InsertMy Add-insMarketXLS India

Connecting Your Zerodha Account

Now comes the exciting part - connecting your Zerodha Kite account to stream live data.

Step 1: Login to MarketXLS India

  1. In the MarketXLS India panel, click the Login button
  2. A login dialog will appear
  3. Enter your MarketXLS credentials:
    • Username: Found in your purchase confirmation email
    • Password: Found in your purchase confirmation email
  4. Click Allow Access when prompted

Don't have credentials? Get MarketXLS India subscription here

Step 2: Select Zerodha as Your Broker

  1. After logging into MarketXLS, you'll see a broker selection dropdown
  2. Click the dropdown and select Zerodha (Kite)
  3. Click the Connect button next to the broker selection

Step 3: Authenticate with Zerodha Kite

This is where MarketXLS securely connects to your Zerodha account:

  1. A Zerodha login page will open in your browser
  2. Enter your Kite user ID and password
  3. Complete 2FA authentication (PIN or TOTP)
  4. You'll see a request for API access - click Authorize
  5. If prompted, enter your App Code (found in your Zerodha developer console)

Security Note: MarketXLS uses OAuth 2.0 authentication. Your Zerodha password is never stored - only a secure access token is used.

Step 4: Confirm Connection

  1. After authorization, you'll be redirected back to Excel
  2. The MarketXLS panel will show "Connected to Zerodha" status
  3. You'll see options to Save Login or Disconnect
  4. Click Save Login to persist the connection for future sessions

🎉 Success! You're now connected and ready to stream live data from Zerodha into Excel.


Getting Real-time Stock Data

Let's start by streaming live stock prices from NSE into your Excel spreadsheet.

Quick Start: Create Example Sheet

The fastest way to get started:

  1. In the MarketXLS India panel, click "Create Examples Sheet"
  2. A new worksheet will be created with sample data including:
    • Ticker symbols (TCS, Reliance, HDFC Bank, etc.)
    • Last Price (real-time)
    • Open, High, Low
    • Previous Close
    • Change %
    • Last Update Time
    • Volume

This gives you a working template to understand the formula structure.

Understanding the Formula Format

MarketXLS India uses simple Excel formulas to fetch live data:

=MXLS.IN.0_last(A2)

Breaking it down:

  • MXLS.IN - MarketXLS India namespace
  • 0_last - Function name (last traded price)
  • A2 - Cell reference containing the ticker symbol

Ticker Symbol Format

All tickers must follow this format:

SYMBOL:IN

Examples:

  • TCS stock: TCS:IN
  • Reliance Industries: RELIANCE:IN
  • HDFC Bank: HDFCBANK:IN
  • NIFTY 50 Index: NIFTY:IN
  • Bank NIFTY: BANKNIFTY:IN

Available Stock Data Functions

Here are the most commonly used real-time data functions:

FunctionDescriptionExample
=MXLS.IN.0_last(A2)Last traded price3,456.75
=MXLS.IN.0_open(A2)Opening price3,420.00
=MXLS.IN.0_high(A2)Day's high3,478.50
=MXLS.IN.0_low(A2)Day's low3,415.20
=MXLS.IN.0_close(A2)Previous close3,440.30
=MXLS.IN.0_volume(A2)Volume traded1,234,567
=MXLS.IN.0_change(A2)Price change+16.45
=MXLS.IN.0_changepercent(A2)Change %+0.48%
=MXLS.IN.0_lasttime(A2)Last update time15:29:58

Building Your First Live Watchlist

Let's create a custom watchlist from scratch:

1. Set up your ticker column (Column A):

A1: Ticker
A2: TCS:IN
A3: RELIANCE:IN
A4: HDFCBANK:IN
A5: INFY:IN
A6: NIFTY:IN

2. Add column headers (Row 1):

B1: Last Price
C1: Change
D1: Change %
E1: Volume
F1: High
G1: Low

3. Add formulas (Row 2, then copy down):

B2: =MXLS.IN.0_last(A2)
C2: =MXLS.IN.0_change(A2)
D2: =MXLS.IN.0_changepercent(A2)
E2: =MXLS.IN.0_volume(A2)
F2: =MXLS.IN.0_high(A2)
G2: =MXLS.IN.0_low(A2)

4. Copy formulas down for all tickers (drag from row 2 to row 6)

Result: You now have a live-updating watchlist that refreshes automatically during market hours! 📈


Working with Options Data

Options traders, this is where MarketXLS India truly shines. Build live NSE options chains with full Greeks support.

Understanding Options Symbol Format

Unlike stocks, options require a special symbol constructor function.

Four Required Inputs:

  1. Underlying Ticker (e.g., "NIFTY", "BANKNIFTY", "TCS")
  2. Expiration Date (e.g., "28-May-2025")
  3. Option Type ("CALL" or "PUT")
  4. Strike Price (e.g., "24000")

Creating an Option Symbol

Step 1: Set up input cells

A1: Ticker
A2: NIFTY

B1: Expiry
B2: 28-May-2025

C1: Type
C2: CALL

D1: Strike
D2: 24000

Step 2: Generate the option symbol

E1: Option Symbol
E2: =MXLS.IN.optionsymbol(A2, B2, C2, D2)

Result in E2: NIFTY25MAY24000CE (the complete option contract symbol)

Fetching Options Data

Now that you have the option symbol, fetch any metric:

FunctionDescriptionExample
=MXLS.IN.0_last(E2)Last traded price (premium)125.50
=MXLS.IN.0_oi(E2)Open Interest45,680
=MXLS.IN.0_volume(E2)Volume traded12,345
=MXLS.IN.0_bid(E2)Bid price124.75
=MXLS.IN.0_ask(E2)Ask price125.25
=MXLS.IN.0_iv(E2)Implied Volatility18.45%

Complete example row:

F2: =MXLS.IN.0_last(E2)       // Premium
G2: =MXLS.IN.0_oi(E2)          // Open Interest
H2: =MXLS.IN.0_volume(E2)      // Volume
I2: =MXLS.IN.0_iv(E2)          // IV

Building a Full Options Chain

Want to see all strikes for an expiry? Here's how:

Step 1: Create strike ladder

D1: Strike
D2: 23000
D3: 23100
D4: 23200
D5: 23300
... (continue for all strikes)

Step 2: Generate symbols for each strike

E2: =MXLS.IN.optionsymbol($A$2, $B$2, $C$2, D2)
E3: =MXLS.IN.optionsymbol($A$2, $B$2, $C$2, D3)
... (copy down)

Note: Using $A$2 (absolute reference) means ticker, expiry, and type stay fixed while strike (D2, D3...) changes.

Step 3: Add data columns

Copy your data formulas down for each strike:

F2: =MXLS.IN.0_last(E2)    // Drag down
G2: =MXLS.IN.0_oi(E2)      // Drag down
H2: =MXLS.IN.0_volume(E2)  // Drag down

Step 4: Repeat for PUTS

Create a mirror table with C2: PUT and repeat the same structure.

Pro Result: You now have a live NSE options chain that updates every second during market hours! 🚀


Streaming Futures Data

Futures traders need just two inputs to track contracts.

Creating a Futures Symbol

Required Inputs:

  1. Underlying Ticker (e.g., "NIFTY", "BANKNIFTY")
  2. Expiration Date (e.g., "28-May-2025")

Step 1: Set up inputs

A1: Ticker
A2: NIFTY

B1: Expiry
B2: 28-May-2025

Step 2: Generate futures symbol

C1: Futures Symbol
C2: =MXLS.IN.futuresymbol(A2, B2)

Result: NIFTY25MAY or similar format

Fetching Futures Data

Use the same data functions as stocks:

D1: Last Price
D2: =MXLS.IN.0_last(C2)

E1: Open Interest
E2: =MXLS.IN.0_oi(C2)

F1: Volume
F2: =MXLS.IN.0_volume(C2)

Advanced Tips & Tricks

1. Persistent Data Connection

The Magic: Your Zerodha connection persists across Excel sessions.

When you save your workbook with "Save Login" enabled:

  • Close Excel completely
  • Reopen the file tomorrow
  • Data automatically reconnects and starts streaming

No need to re-authenticate every time!

2. Error Handling

Wrap formulas in IFERROR to handle disconnections gracefully:

=IFERROR(MXLS.IN.0_last(A2), "Connecting...")

Shows "Connecting..." instead of #VALUE! during brief disconnects.

3. Conditional Alerts

Use Excel's conditional formatting with formulas to highlight opportunities:

Example: Alert when NIFTY moves >1%

// In Change% column, create a rule:
=ABS(D2) > 1

Apply red fill when triggered.


Troubleshooting Common Issues

Issue 1: "Connection Failed" Error

Symptoms: Cannot connect to Zerodha after entering credentials

Solutions:

  1. Verify you're using the India version of MarketXLS add-in (not global)
  2. Check your Zerodha API subscription is active
  3. Clear browser cache and retry authentication
  4. Ensure your Kite password and 2FA are correct
  5. Try DisconnectConnect again

Issue 2: Formulas Showing #NAME? Error

Symptoms: Formulas display #NAME? instead of data

Solutions:

  1. Verify the add-in is loaded and running (check the panel on the right)
  2. Check for typos in function names (should be MXLS.IN.0_last, not MXLS.IN.last)
  3. Ensure ticker symbols have :IN suffix (e.g., TCS:IN not just TCS)
  4. Reload the add-in: Insert → My Add-ins → MarketXLS India → Reload

Issue 3: Data Not Updating

Symptoms: Prices are frozen or not changing

Solutions:

  1. Check market hours - NSE trades 9:15 AM - 3:30 PM IST
  2. Verify connection status shows "Connected" in the panel
  3. Check if the specific symbol is trading (some stocks have no trading volume)
  4. Press F9 to force recalculation (if using Manual calc mode)
  5. Reconnect: Click Disconnect → Connect in the MarketXLS panel

Video Tutorial

Watch this complete step-by-step walkthrough:

Watch on YouTube: MarketXLS India Installation & Usage Guide

The video covers:

  • ✅ Complete installation process
  • ✅ Zerodha authentication flow
  • ✅ Creating stock watchlists
  • ✅ Building options chains
  • ✅ Futures symbol creation
  • ✅ Live demonstration with real data

Next Steps

Now that you've mastered the Zerodha + Excel integration, here's what to explore next:

1. Build Your First Trading Dashboard

Create a comprehensive dashboard with:

  • Live NIFTY/BANKNIFTY levels
  • Top gainers/losers from your watchlist
  • Options chain with max pain analysis
  • Your portfolio P&L tracker

2. Explore Advanced Functions

MarketXLS India has 100+ functions beyond the basics covered here:

  • Fundamental data (P/E ratios, market cap, etc.)
  • Technical indicators (RSI, MACD, moving averages)
  • Historical price data
  • Screener functions

Check the complete function reference.

3. Connect Angel One as Backup

Having issues with Zerodha? Learn how to connect Angel One SmartAPI as an alternative data source: Angel One Integration Guide

4. Compare Brokers

Not sure if Zerodha is right for you? Read our detailed comparison: Zerodha vs Angel One: Which is Best?


Conclusion

You've now unlocked the power of live NSE data streaming directly into Excel using your Zerodha account. Whether you're:

  • 📊 Building sophisticated trading dashboards
  • 📈 Analyzing options strategies in real-time
  • 💹 Tracking your portfolio with live P&L
  • 🔍 Screening stocks with custom criteria

...MarketXLS India + Zerodha integration gives you institutional-grade capabilities right in your spreadsheets.

Key Takeaways:

  • ✅ Installation takes under 10 minutes
  • ✅ No coding required - simple Excel formulas
  • ✅ Data updates every ~1 second during market hours
  • ✅ Works with stocks, options, futures, indices
  • ✅ Connections persist across sessions
  • ✅ Full options chain building capabilities

Ready to Get Started?

👉 Get MarketXLS India Subscription - Special launch offer: ₹3,500/month with lifetime price lock

👉 Download Sample Templates - Pre-built watchlists and options chains

👉 Watch Video Tutorial - Complete visual walkthrough


Last updated: February 2025 | Questions? Email support@marketxls.com

Keywords: Zerodha Excel integration, Kite API Excel, NSE live data Excel, real-time stock data Excel India, Zerodha API integration, Excel options chain, NIFTY data Excel, MarketXLS India, Zerodha Kite Excel add-in, live stock prices Excel

Interested in building, analyzing and managing Portfolios in Excel?
Download our Free Portfolio Template
I agree to the MarketXLS Terms and Conditions
Call: 1-877-778-8358
Ankur Mohan MarketXLS
Welcome! I'm Ankur, the founder and CEO of MarketXLS. With more than ten years of experience, I have assisted over 2,500 customers in developing personalized investment research strategies and monitoring systems using Excel.

I invite you to book a demo with me or my team to save time, enhance your investment research, and streamline your workflows.
Implement "your own" investment strategies in Excel with thousands of MarketXLS functions and templates.
MarketXLS provides all the tools I need for in-depth stock analysis. It's user-friendly and constantly improving. A must-have for serious investors.

John D.

Financial Analyst

I have been using MarketXLS for the last 6+ years and they really enhanced the product every year and now in the journey of bringing in AI...

Kirubakaran K.

Investment Professional

MarketXLS is a powerful tool for financial modeling. It integrates seamlessly with Excel and provides real-time data.

David L.

Financial Analyst

I have used lots of stock and option information services. This is the only one which gives me what I need inside Excel.

Lloyd L.

Professional Trader

Meet The Ultimate Excel Solution for Investors

Live Streaming Prices in your Excel
All historical (intraday) data in your Excel
Real time option greeks and analytics in your Excel
Leading data service for Investment Managers, RIAs, Asset Managers
Easy to use with formulas and pre-made sheets