kiteconnect
The official Python client for the Kite Connect trading API
What it is and what it does
Kiteconnect is the official Python client for Zerodha's Kite Connect trading API, a REST-like service for building investment and trading platforms. It wraps HTTP endpoints and WebSocket connections to let you place orders, fetch portfolio data, stream live market quotes, and manage mutual fund transactions. The library handles session management, order placement (including auto-slicing for large orders that exceed exchange limits), instrument lookups, and real-time tick subscriptions via WebSocket callbacks.
The package is designed for developers building trading applications on the Zerodha platform. It abstracts away HTTP request construction and WebSocket frame handling, exposing a Python object interface with constants for order types, exchanges, and transaction modes. Recent versions dropped Python 2.7 support and added auto-slice order placement; the current release (v5.2.1) is actively maintained and carries no known security vulnerabilities.
Use it for:
- Build a retail trading dashboard that places equity and derivative orders on NSE/BSE/NFO exchanges in real time.
- Stream live market tick data via WebSocket to update price displays or trigger algorithmic trading signals.
- Automate portfolio rebalancing by fetching holdings and placing orders programmatically during market hours.
- Place mutual fund orders and track their status without manual broker interaction.
- Handle large order quantities that exceed exchange freeze limits using auto-slice order placement.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Official Python client for the Kite Connect trading API, enabling real-time order execution, portfolio management, and live market data streaming via REST and WebSocket.
Yes. Kiteconnect is the official, actively maintained client for Zerodha's trading API with no security vulnerabilities, permissive licensing, and low install friction. Install it if you are building a trading application on the Zerodha platform. Do not install if you do not have a Kite Connect API account or are targeting a different broker's API.
Install
kiteconnect on PyPI
pip
pip install kiteconnectuv
uv add kiteconnectpoetry
poetry add kiteconnectInstalling kiteconnect
Before you install
Low install friction with a pure-wheel distribution. Actively maintained with a recent release (22 days old) and 1293 repository stars. Depends on several C-extension libraries (pyOpenSSL, autobahn) that require system compilers on Linux/macOS or Visual C++ on Windows, but these are well-established packages.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely provided you include the original license notice.
Quickstart
from kiteconnect import KiteConnect
kite = KiteConnect(api_key="your_api_key")
data = kite.generate_session("request_token", api_secret="your_secret")
kite.set_access_token(data["access_token"])
order_id = kite.place_order(tradingsymbol="INFY", exchange=kite.EXCHANGE_NSE, transaction_type=kite.TRANSACTION_TYPE_BUY, quantity=1, variety=kite.VARIETY_AMO, order_type=kite.ORDER_TYPE_MARKET, product=kite.PRODUCT_CNC, validity=kite.VALIDITY_DAY)
Requires a Kite Connect API account with valid api_key and api_secret from Zerodha. C compiler (GCC on Linux/BSD/macOS, Visual C++ on Windows) needed for dependency compilation.
Verify before relying
- Whether the package works with Python versions beyond 3.7 (classifiers list 3.5–3.7 but requires_python is unspecified)
- Specific behavior and error handling for autoslice orders when child orders fail
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — service_identity, requests, six, pyOpenSSL, python-dateutil, autobahn, pywin32 |
| Maintenance | actively maintained — 22 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 330,670/month — #7,533 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: kiteconnect-5.2.1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
blackduckPython bindings for the Synopsys Black Duck Hub…
permissive · top 15,000 on PyPI
dhanhqPython client library for the Dhan trading API,…
permissive · top 15,000 on PyPI
smartapi-pythonA Python client library for Angel Broking's…
unclear · top 15,000 on PyPI
growwapiSDK for connecting to Groww's trading platform…
permissive · top 15,000 on PyPI
metatrader5Connects Python to MetaTrader 5 Terminal to…
permissive · top 15,000 on PyPI
ib_asyncib_async provides a Python interface to…
permissive · top 15,000 on PyPI
longbridgeLongbridge provides a Python SDK for accessing…
unclear · top 15,000 on PyPI
ib-insyncProvides a Python async/sync interface to…
permissive · top 15,000 on PyPI
python-binanceUnofficial Python wrapper for the Binance…
permissive · top 15,000 on PyPI
alpaca-trade-apiPython client library for the Alpaca Commission…
unclear · top 15,000 on PyPI