Getting started with Zerodha KiteConnect API

·

4 min read

In India, Zerodha is one of the leading stock market brokers with a large number of active clients. And the services that are provided by this discount stock broker are well competitive and stand ahead among the peer stock brokers. And similarly, when it comes to Algorithmic trading, Zerodha provides API access to its users to help users make use of algorithmic trading. It has to be said that, among all the different brokers who provide API access to stock market data, Zerodha is one of the best and leading.

Of course, other stock brokers provide API access in India. Below is the list of brokers who provide API access

Stock BrokerChargesOpen AccountAPI Website
ZerodhaLive=₹2000/month + Historical=₹2000/monthOpen AccountVisit API Page

Edit Table

In this article, we will discuss how to get started with using Zerodha API. The API Provided by Zerodha is called as KiteConnect API or Kite API.

Requirements

  1. Zerodha Account

  2. Kite Trade account

  3. Payment methods ready for buying the credits

A Zerodha account is mandatory to trade using Zerodha API( Open Account ). As Kite Trade API will work with your Zerodha account to place orders and perform other operations. And hence you must have a Zerodha account opened. And also if you wanted to perform operations on Options and Futures data and place orders for the same, Zerodha must have Options and Futures enabled. Similarly for Commodities and Currency Derivatives.

After having a Zerodha account proceed to the Kite.Trade website to sign up for API access. On the homepage of the website, click on the signup button and provide the details as shown in the below image

After filling in all the necessary details click on sign up confirm your email address, login back into your Kite trade account. The Kite Trade account login page will be as shown below

Click on the Billing tab to buy the credits for getting the API access. When you click on the Billing Tab the page will be as shown below

Enter the number of credits that are required for you and pay the amount to buy the required credits.

Number of credits required

Each credit is equal to ₹1 and for accessing Kite live data, you will be charged 2000 credits. And if you also need historical data, then you need another 2000 credits. Combined you will need 4000 credits for both live and historical data.

2000 credits will be enough if you are not in requirement of historical data. When we say historical data, we mean that any data that is not live is historical. For example, if the time right now it 10 Hours 03 minutes and 21 seconds(10:03:21), then the data up to 10 hours 03 minutes and 20 seconds(10:03:20) is called Historical data. only the data at 10:03:21 is the live data.

So based on the requirement you buy the credits that are required. After buying the credits you can head back to the home page. and on the home page click on the Create New App button.

YOu will be asked to select the type of app you wanted to create. To get API access, you will need to select the Connect app. With the publisher type of app, you will not have any API access.

In the section of the type of apps, select connect app and click create.

Type the details of the app such as the App name and others.

  1. Give a name to your app in the App name column

  2. For the client name, type your Zerodha account client ID. The client ID will be found on your kite dashboard.

  3. In the redirect URL section, if you are unclear about what to type, just enter http://127.0.0.1/.

  4. In the description column, enter the details to understand what the app will do.

  5. You can leave the column of Postback URL empty.

Once you click on the create new app button, you will be asked to verify that you will be charged with 2000 credits for creating the app. Type ‘I UNDERSTAND’ in the pop-up box and click ok. Your app will be created and you will be asked to give the details of the app as below.

Once the app is created the page will look like as shown below

KiteConnect app

KiteConnect app

On this page the details of the app such as API secret and API key are visible. On the right side, you will see an option Historical data, You can click on enable historical data to also get access to Historical data also. but remember that enabling historical data will cost you another 2000 credits per month.

You will need the API key and API secret for accessing the app and to connect to kite api.

Once you have done with the app, now you can head back to your python console and start coding your script to connect to the app for algorithmic trading.

We will write about connecting to Kite API using python in the next article. You can visit the article by clicking here.

Until then have a happy trading.

Did you find this article valuable?

Support Nikhil by becoming a sponsor. Any amount is appreciated!