Skip to content
The official PHP client library for the Kite Connect trading APIs
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples docs(examples): Add a basic example Feb 20, 2018 Update README and CHANGELOG Jan 18, 2018
kiteconnect.php fix: upgrade version to 3.2.0 Nov 20, 2019

The Kite Connect API PHP client - v3

The official PHP client for communicating with the Kite Connect API.

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) 2018. Licensed under the MIT License.



Download kiteconnect.php and include() it in your application.


    include dirname(__FILE__)."/kiteconnect.php";

    // 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->login_url()
    try {
        $user = $kite->generateSession("request_token_obtained", "your_api_secret");

        echo "Authentication successful. \n";

    } 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";

    // Place order.
    $o = $kite->placeOrder("regular", [
        "tradingsymbol" => "INFY",
        "exchange" => "NSE",
        "quantity" => 1,
        "transaction_type" => "BUY",
        "order_type" => "MARKET",
        "product" => "NRML"

    echo "Order id is ".$o->order_id;

Refer to the PHP client documentation for the complete list of supported methods.



You can’t perform that action at this time.