一键导入
zerodha-kite
Zerodha Kite Connect: holdings, positions, orders, live quotes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Zerodha Kite Connect: holdings, positions, orders, live quotes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Search and download arXiv papers (no API key needed)
Delegate coding and file edits to Anthropic Claude Code CLI
Read/write Windows clipboard text, HTML, images, history (PowerShell)
Running scripts and code on Windows
Delegate coding tasks to OpenAI Codex CLI
Windows Defender: scans, threat history, signatures (PowerShell)
| name | zerodha-kite |
| description | Zerodha Kite Connect: holdings, positions, orders, live quotes |
| category | india |
| version | 1.0.0 |
| tags | zerodha, kite, broker, india, trading, orders, holdings, positions, equity, portfolio |
| license | Apache-2.0 |
Access your Zerodha account via the Kite Connect REST API — fetch portfolio, live quotes, place orders, and check order history. Requires a Kite Connect API subscription.
$env:KITE_API_KEY = "your_api_key"
$env:KITE_ACCESS_TOKEN = "your_access_token" # Obtained after daily login flow
$baseUrl = "https://api.kite.trade"
$headers = @{
"X-Kite-Version" = "3"
"Authorization" = "token $($env:KITE_API_KEY):$($env:KITE_ACCESS_TOKEN)"
}
$holdings = Invoke-RestMethod -Uri "$baseUrl/portfolio/holdings" -Headers $headers
$holdings.data | Select-Object tradingsymbol, quantity, average_price, last_price,
@{N='PnL';E={[math]::Round(($_.last_price - $_.average_price) * $_.quantity, 2)}}
$positions = Invoke-RestMethod -Uri "$baseUrl/portfolio/positions" -Headers $headers
$positions.data.net | Select-Object tradingsymbol, quantity, average_price, last_price, pnl
$symbols = "NSE:RELIANCE,NSE:INFY,NSE:TCS"
$quote = Invoke-RestMethod -Uri "$baseUrl/quote?i=$symbols" -Headers $headers
$quote.data.PSObject.Properties | ForEach-Object {
[PSCustomObject]@{
Symbol = $_.Name
LTP = $_.Value.last_price
Change = $_.Value.net_change
Volume = $_.Value.volume
}
}
$margins = Invoke-RestMethod -Uri "$baseUrl/user/margins" -Headers $headers
$margins.data.equity | Select-Object available, utilised, net
$orderBody = @{
tradingsymbol = "RELIANCE"
exchange = "NSE"
transaction_type = "BUY"
order_type = "MARKET"
quantity = 1
product = "CNC" # CNC = delivery, MIS = intraday, NRML = F&O
}
$resp = Invoke-RestMethod -Uri "$baseUrl/orders/regular" `
-Method POST -Headers $headers -Body $orderBody
Write-Host "Order ID: $($resp.data.order_id)"
$orders = Invoke-RestMethod -Uri "$baseUrl/orders" -Headers $headers
$orders.data | Select-Object order_id, tradingsymbol, transaction_type,
quantity, price, status, order_timestamp |
Sort-Object order_timestamp -Descending
"Show me my Zerodha portfolio with current P&L"
→ Fetch /portfolio/holdings, calculate P&L per position, sum for total portfolio gain/loss.
"What's the current price of HDFC Bank?"
→ GET /quote?i=NSE:HDFCBANK — returns LTP, OHLC, volume, and circuit limits.
"Place a buy order for 1 share of Infosys at market price"
→ POST to /orders/regular with INFY, NSE, BUY, MARKET, qty 1, product CNC.
product: CNC for delivery equity trades, MIS for intraday, NRML for F&O overnight positions