zerodha/phpkiteconnect
Composer 安装命令:
composer require zerodha/phpkiteconnect
包简介
The PHP client library for the Kite Connect trading APIs Resources
关键字:
README 文档
README
The Official PHP client for communicating with the Kite Connect API.
Note: For PHP version < 8.0. You can refer to our previous version.
Kite Connect is a set of REST-like APIs that expose many capabilities required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio and more, with the simple HTTP API collection.
Zerodha Technology (c) 2025. Licensed under the MIT License.
Documentation
Installing
Requirements
You can install the package via composer:
composer require zerodha/phpkiteconnect
Note: You can refer to our previous version here for PHP version < 8.0.
Usage
<?php require_once __DIR__ . '/vendor/autoload.php'; use KiteConnect\KiteConnect; // Initialise. $kite = new KiteConnect("your_api_key"); // Assuming you have obtained the `request_token` // after the auth flow redirect by redirecting the // user to $kite->getLoginURL() try { $user = $kite->generateSession("request_token_obtained", "your_api_secret"); echo "Authentication successful. \n"; print_r($user); $kite->setAccessToken($user->access_token); } catch(Exception $e) { echo "Authentication failed: ".$e->getMessage(); throw $e; } echo $user->user_id." has logged in"; // Get the list of positions. echo "Positions: \n"; print_r($kite->getPositions()); // Place order. $order = $kite->placeOrder("regular", [ "tradingsymbol" => "INFY", "exchange" => "NSE", "quantity" => 1, "transaction_type" => "BUY", "order_type" => "MARKET", "product" => "NRML" ]); echo "Order id is ".$order->order_id; ?>
Examples
Check examples folder for more examples.
Refer to the PHP client documentation for the complete list of supported methods.
Run unit tests
composer test
Generate documentation
$ apt-get install wget
$ wget https://phpdoc.org/phpDocumentor.phar
$ chmod +x phpDocumentor.phar
$ ./phpDocumentor.phar run -d ./src/ -t ./doc/
Changelog
zerodha/phpkiteconnect 适用场景与选型建议
zerodha/phpkiteconnect 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.99k 次下载、GitHub Stars 达 47, 最近一次更新时间为 2021 年 04 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zerodha」 「phpkiteconnect」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zerodha/phpkiteconnect 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zerodha/phpkiteconnect 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zerodha/phpkiteconnect 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A lightweight core PHP library for integrating Zerodha Kite Connect with AlgoTrig, providing a foundation for custom trading algorithms.
The PHP client library for the Kite Connect trading APIs Resources
Web Development repository for the AlgoTrig UI in PHP. Contains experimental features and connects to the core backend at algotrig/algotrig-php-core.
统计信息
- 总下载量: 3.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 47
- 点击次数: 6
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-07