Upgrade to Kite Connect 3.0

Kailash
Kailash edited April 4 in General
Dear developers,
We're happy to announce the public availability of Kite Connect 3.0 APIs. It's taken us over a year to rebuild everything from the ground up; the exchange backends, APIs, Kite Web platform and more. The new APIs are more robust and switching to them, you should be able to see immediate improvements in speed.

This is a major release with some breaking changes and hence, we'll all have to migrate away from the existing version to 3.0. We'll announce the migration deadlines soon, and you should have ample time to switch.

In addition to the obvious performance improvements, we've introduced several new features, some of which have been announced in phases over the last few months. Highlighting a few important ones:
  • New fields in the WebSocket streaming API: Trade timestamp, tick timestamp, Open Interest, Open Interest day high and low
  • Realtime order Postbacks and message updates over WebSockets
  • Subscribe to up to 1000 instruments on a single WebSocket connection
  • New /quote API that let's you fetch the complete market quote for up to 500 instruments in one go
  • New /quote/ohlc and /quote/ltp APIs that let you fetch up to 1000 instruments in one go
  • Brand new Kite Connect library for Rust
  • New order types - Bracket Order (SL), Cover Order (LIMIT)

What now?

  • Go through the new and improved Kite Connect 3.0 documentation, and most importantly, the Changelog section.
  • The breaking changes to most existing APIs are minimal, but the client libraries (Python, Java, .Net, Javascript, PHP) have been refactored and improved extensively. The new versions are on the "kite3" branch of the respective Github repositories. Be sure to go through the readme and changelog of the client library you use. The links are available here.
  • Kite Connect 3.0 is live and production ready. The older version will continue to function side by side until the migration deadline, which will be announced soon.

Client libraries and SDKs for 3.0

These are in a separate "kite3" branch on Github. They'll be merged with the main line when the old APIs are completely phased out.

What's next?

We have several more things on the road map for Kite Connect over the coming months. A mock sandbox for testing APIs, margin data for computing charges and more.

PS: Use the coupon code KITE300 on your Kite Connect developer console (billing page) to get 300 credits free (the coupon will only work on your existing account)!

Thank you for your continued support.
  • botany02
    @Kailash
    Thanks for the update.
    Can we get updates for orders placed on other platforms as such pi or kite web in websocket?
  • sujith
    Hi @botany02,
    Yes, you will get order updates via Kite Ticker even if the order is placed on Kite, Pi or any other platform.
  • botany02
    @sujith
    Great...
    I was waiting for this only
  • rayi
    When will the kite charts have open interest data?
  • asif09ansari
    How to get Realtime order Postbacks and message updates over WebSockets?
    Any code snippet?
  • moghgan
    Is simultaneous login now possible in both kite connect APIs and Zerodha PI ?
  • cisk
    Much relief! Still, got a long way to go :-)
  • Kailash
    @asif09ansari This is built into the all the 3.0 client libraries. Check the links on the documentation. Their respective READMEs have examples.

    @moghgan Pi, not yet, but this is being done by the Pi team. In the next major release of Pi next month, you'll see that it would have a unified login system with Kite.

    @cisk Absolutely. 3.0 lays a new foundation for us internally and makes a lot of new things possible. Stay tuned.
  • rayi
    @Kailash can I see open interest charts in Kite charts with this release ? or is this something you guys are working on?
  • Kailash
    @rayi The data team have been working on procuring historical OI data. It's not available yet, but should hopefully happen soon.
  • shailu
    This is nice, but whats the repository to have 3.0.0 through pom xml
  • krtrader
    I have upgraded my java client to 3.0
    Working all fine without any issues as of now
    thanks
  • moghgan
    Thanks for the update Kailash. Unified login will be great. Since we can now subscribe to up to 1000 instruments in one connection, Is the number of connections we can make (3 concurrent connections as of current kite spec) still the same ? Or only one connection is allowed now ?
  • sujith
    Hi @shailu,
    As of now, you can use the jar file which is provided here.
    We will update maven repository in coming weeks.
  • shailu
    shailu edited January 19
    @sujith - [RESOLVED] - this will be helpful to others.

    Here is how to do it - Just for local.

    mvn install:install-file -Dfile=/Users/shai/git/javakiteconnectkite3/dist/kiteconnect.jar \
    -DgroupId=com.rainmatter.kiteconnect -DartifactId=kiteconnect -Dversion=3.0.0-SNAPSHOT

  • sedhuait
    node js v3 upgarde issue
  • sedhuait
    sedhuait edited January 19
    { adapter: [Function: httpAdapter],
    2018-01-19T14:42:08.450694+00:00 app[worker.1]: transformRequest: { '0': [Function: transformRequest] },
    2018-01-19T14:42:08.450694+00:00 app[worker.1]: transformResponse: { '0': [Function: transformResponse] },
    2018-01-19T14:42:08.450696+00:00 app[worker.1]: timeout: 10,
    2018-01-19T14:42:08.450697+00:00 app[worker.1]: xsrfCookieName: 'XSRF-TOKEN',
    2018-01-19T14:42:08.450698+00:00 app[worker.1]: xsrfHeaderName: 'X-XSRF-TOKEN',
    2018-01-19T14:42:08.450699+00:00 app[worker.1]: maxContentLength: -1,
    2018-01-19T14:42:08.450699+00:00 app[worker.1]: validateStatus: [Function: validateStatus],
    2018-01-19T14:42:08.450700+00:00 app[worker.1]: headers:
    2018-01-19T14:42:08.450701+00:00 app[worker.1]: { common: { Accept: 'application/json, text/plain, */*' },
    2018-01-19T14:42:08.450702+00:00 app[worker.1]: delete: {},
    2018-01-19T14:42:08.450702+00:00 app[worker.1]: get: {},
    2018-01-19T14:42:08.450703+00:00 app[worker.1]: head: {},
    2018-01-19T14:42:08.450705+00:00 app[worker.1]: post: { 'Content-Type': 'application/x-www-form-urlencoded' },
    2018-01-19T14:42:08.450705+00:00 app[worker.1]: put: { 'Content-Type': 'application/x-www-form-urlencoded' },
    2018-01-19T14:42:08.450706+00:00 app[worker.1]: patch: { 'Content-Type': 'application/x-www-form-urlencoded' },
    2018-01-19T14:42:08.450707+00:00 app[worker.1]: 'X-Kite-Version': 3,
    2018-01-19T14:42:08.450708+00:00 app[worker.1]: 'User-Agent': 'kiteconnectjs/3.0.0',
    2018-01-19T14:42:08.450709+00:00 app[worker.1]: Authorization: 'token xye4ov29h:sdus8fbpo4do2b016' },
    2018-01-19T14:42:08.450710+00:00 app[worker.1]: baseURL: 'https://api.kite.trade',
    2018-01-19T14:42:08.450711+00:00 app[worker.1]: paramsSerializer: [Function: paramsSerializer],
    2018-01-19T14:42:08.450711+00:00 app[worker.1]: method: 'get',
    2018-01-19T14:42:08.450712+00:00 app[worker.1]: url: '/user/margins/equity',
    2018-01-19T14:42:08.450713+00:00 app[worker.1]: params: { segment: 'equity' },
    2018-01-19T14:42:08.450713+00:00 app[worker.1]: data: '' }
    2018-01-19T14:42:08.469300+00:00 app[worker.1]: Zerodha Login Error : {"message":"No response from server with error code: ECONNABORTED","error_type":"NetworkException","data":null}
  • sujith
    @sedhuait,
    Can you please create a new thread with your code and debug log?
  • sameer
    Congrats and Thanks Kite team
  • vardhan36397
    Is there any change in Historical API where we can send more than 3 requests per second?
  • sujith
    @vardhan36397,
    There is no change in Historical API.
    As of now, we haven't increased API rate limits. We may do it in future.
  • mukeshkumarsharma
    Awesome, It is going to be milestone.
  • Kailash
    @vardhan36397 We're revamping the entire historical data infrastructure. You should see increased limits soon after we sunset Kite 2.0 and 3.0 becomes the default. Revised rate limits will be a separate announcement.
  • Rahul
    @Kailash , since 1000 instruments can be subscribed to websocket , maximum websockets 3 will be continued ?
    however 1000 is good enough but just to make sure if the connection is limited to 1 websocket
  • Kailash
    @Rahul, we're still considering this and the revised rate limits will be announced soon.
  • koushik72
    Hi, I tried getting LTP for 500 stocks and it's just not working.
    It doesn't give any response at all. Sometimes it says, 'transfer closed with 22 bytes remaining to read'.
    Can you please explain what's going on?
  • razcads
    @Kailash @sujith
    Kite 3 upgrade is a step in right direction. There are many changes under the hood which is not captured in change logs especially for python apis. I can see a lot of naming changes etc.. this more or less forces a rewrite of all my code. some code changes were definitely avoidable - like changing names of variables - man why?!
    Anyway understand these happen.. but do you have better documentation that lists all such minor and major changes to python apis? Just want to spend less time on getting my app up and working on new code than go through each code snippet line by line.
  • Kailash
    @razcads The documentation only covers the changes to the API. The function/variable name changes, we've taken this opportunity make everything consistent.

    As mentioned in the announcement, the client lib changes are documented in their respective change logs on Github. Here's the Python one: https://github.com/zerodhatech/pykiteconnect/blob/kite3/CHANGELOG.md

    We understand that it's a bit of a pain, but down the line, it should make all our lives easier :) Thanks.
  • razcads
    @Kailash Thanks. Hope going ahead you make a conscious decision not to change variable names just to set some semantics right. You are now a well known api provider and many algo systems run off it. If every major release leads to big dev cycles for clients it wont be a pretty advertisement for you.
  • tonystark
    tonystark edited January 23
    @razcads Try creating a new function that fetches the API using requests library. You can find structure of API call from here.
  • razcads
    @tonystark thanks this looks good. will give it a shot
  • ansumanm
    So we dont need a postback url anymore? We get our postback updates over websockets itself? I just completed my postback url handler ..lol..
  • sujith
    @ansumanm,
    You will continue to get postbacks. Order updates via websockets is another feature that is added.
  • Kailash
    @ansumanm HTTP Postbacks and Postbacks over Websockets have some subtle differences. These are in the documentation.

    Firstly, HTTP Postbacks are meant for app developers / public platforms. You only get updates for orders placed by the api_key to which the Postback URL belongs.

    WebSocket Postbacks, on the other hand, are tied to trading client IDs. You'll get updates for all orders of the particular client ID no matter how/where they're placed from. Kite web, mobile, any app, dealer terminals etc. This is specifically for individual/personal use.
  • Guhan
    I think order_updates does not send data regarding second-leg order that gets created on successful completion of a first-leg BO order
  • sameer
    @Kailash any plan to increase current limit of 3 request per sec for historical_data ?
  • Kailash
    @sameer Yes. Major revamp on the historical data warehouse is underway. Once it's done, we'll announce the revised rate limits. We should see noticeable performance improvements too.
  • ksanth19
    Very nice to have new portal but unable to connect quickly
  • botany02
    botany02 edited January 25
    @sujith @Kailash
    Could pls clarify whether, will be getting order_updates for 2nd leg in BO/CO through web-sockets i.e. initial status and further updates?

    If place a LIMIT order in Kite Web and the status is OPEN, will get that order in websocket or it will be sent only when the order status changes to complete, rejected, cancelled or partially filling?
  • Kailash
    @botany02 "OPEN" is not sent on placement because when you get the order_id from the order API request, it means the order is open/placed. Subsequent changes that happen to it are sent as Postbacks.
  • botany02
    botany02 edited January 25
    @Kailash
    Thanks for the prompt reply.

    That's OK for the order placed through API where you get order_id immediately and we can assign initial status based on the order type LIMIT or SL (OPEN or TRIGGER PENDING).

    Suppose I placed BO/CO order and it is COMPLETE, now I got the main order id and OMS placed my second leg orders, but i'm not aware of those 2nd leg orders because they are OPEN and TRIGGER PENDING.

    If i want to modify my target or stoploss, where I will get the 2nd leg order id's.

    Fetching order book and searching for parent order id may work for one or two symbols, if I place 50 or so BO/CO orders, I think the 'fetching order book' will not be a good choice and lead to system collapse or if my system places averagely 2 orders/min and continuously fetching order book at an interval of 2 min to get 2nd leg orders will defeat the purpose of post-back and will add load at your end too if more users pulls.

    Kite should send all order_updates (Incl Open & Trigger Pending) at-least for second leg orders of BO/CO. It not only benefit the developers but also the Kite , because users will stop pulling the order book. I feel it is great drawback and gap.

    I hope you will address this on priority.
  • Kailash
    @botany02 You're right. We're discussing this internally and will make a decision soon.
  • botany02
    Thanks @Kailash
    Also consider initial updates for LIMIT and SL orders placed in other platforms
  • RP7220
    Correction in Kite Connect 3 / API documentation

    User --> Authentication and token exchange --> Response attributes --> api_key datetype is not string[] arrya, its string datatype.




  • RP7220
    Funds and margins --> Response attributes --> utilised.payout is missing...
  • RP7220
    Retrieving orders -> Response attributes -->order_type , market_protection & tag are missing.....
  • RP7220
    Holdings--> Response attributes --> realised_quantity is missing...

    Positions--> Response attributes --> sell_buy_quantity -> day_sell_quantity ,sell_buy_price -> day_sell_price , sell_buy_value -> day_sell_value

  • ramana
    Hi @Kailash,
    Could you please let us know, how to connect Kite Connect 3.0 API from Kite XL. Whether Kite XL will point latest version of Kite Connect API automatically or we have to get new Kite XL from the site.
  • botany02
    @ramana
    KiteXL uses the default kite version and the current default version is v1.
    KiteXL may cease to work when Kite Team makes kite3.0 as default version. We are working on the new release compatible with 3.0.
  • tonystark
    @RP7220 Thank you for notifying. We will update docs shortly. By the way, market_protection and market_protection are deprecated. They will be removed from API soon.
  • Shaha
    Too many different set of documentations leading to confusion. Is the example here updated? https://github.com/zerodhatech/pykiteconnect
  • tasklive
    I am using old version for sending orders only....And not using any other features. So, Will it be compulsory to upgrade to Kite3..? or I can use the old version itself?
  • sujith
    @tasklive,
    After we completely migrate you won't be able to place orders. You need to migrate to Kite Connect 3.
  • tasklive
    @sujith
    Thank you for your quick response. Please can I get some documentation / code snippets which is in vb.net. So it will help me to migrate as early as possible.
  • YM1284
    in Kite3, i find updation in BO with Order Type selection(i.e. LIMIT or SL) which is not available in old Kite version.
    For Kite connect, i am using KiteXL.
    Please guide me how i can place BO with Order Type selection through KiteXL.
    From where i can get latest KiteXL which is compatible with Kite3.
  • sujith
    Hi @YM1284,
    KiteXL is provided by the third party. It is developed by @botany02. I guess they are working on new version of KiteXL.
  • srreedhar2001
    Hi

    Is there any VB.net sample available for KiteConnect3.0 API.
  • sujith
    @srreedhar2001,
    We don't have VB.net samples. You can convert .NET examples to VB.net here.
  • archulysses
    I am just starting with kite connect API's, so which version of python should I work with 2 or 3.
    i.e pykiteconnect 3 is implemented in python 2 or 3?
  • sujith
    sujith edited February 12
    You can use Kite Connect 3(kite3 branch) and pykiteconnect is compatible with both python 2 and 3.
  • paragsatpute
    Hi,
    I am not sure if any one has faced similar issue with the Sample application for the C#.NET API.
    Getting errors as seen in the attached screen capture. Please can you advise if i am missing something.
    I have referenced the kiteconnect.dll.

    Help is greatly appreciated.




    Regards,
    Parag
  • sujith
    @paragsatpute,
    Please create a new thread for new queries. It might help others who are looking for the same.
  • ramatius
    The kiteconnect.php has old documentation, but heading says "Zerodha Technology (c) 2017. Version 3.0.0". Anyone looking to do quick dev will waste a lot of time before realizing that the examples given under "getting started" are invalid.

    Please update this (and other examples embedded in source libs) on priority. Yes, I do understand that there is separate 3.0 documentation on web.
  • shailu
    @sujith
    hey man, seems i m paying for the raising bugs in ur latest kite3 APIs.
    pls check this thread -
    https://kite.trade/forum/discussion/3403/important-kite3-api-bug-seems
  • sujith
    sujith edited February 20
    @ramatius,
    It is pointing to Kite Connect 3 only. There has been a couple of major commits after that. We will update documentation.
    Edit: It should be up by now.
  • ramatius
    Thanks for the quick response @sujith
  • RJ0958
    I have downloaded Java client for kiteconnect api from https://github.com/zerodhatech/javakiteconnect/tree/kite3/dist. The Jar file name doesn't have version number. Even though it is not major issue, but if you include version and subversion name (like kiteconnect-3.0.1.jar) officially, it would be more convenient.

  • sujith
    @RJ0958,
    You can go to releases page and download to avoid confusion.
  • srreedhar2001
    I just converted the c# code to VB.Net using the following converter (https://kite.trade/forum/discussion/3403/important-kite3-api-bug-seems) and getting this error. Any help on this please.



  • botany02
    @srreedhar2001

    You need to change
    ticker.OnTick += AddressOf OnTick

    To
    AddHandler ticker.OnTick, AddressOf OnTick

  • sujith
    @srreedhar2001,
    Can you please create new threads for new queries? It might help others who are searching for the same.
  • Twin_kim
    How many orders can be placed and executed per sec through the excel ?
  • sujith
    @Twin_kim,
    Please create new threads for new queries, it might help others who are searching for the same.

    You can check out API rate limits here.
  • snikam
    @sujith Please let us know when you are planning to deprecate existing Kite API and move to Kite 3.0?
  • Shaha
    @sujith /others, please response on "Please let us know when you are planning to deprecate existing Kite API and move to Kite 3.0?" .... as kite 3.0 is not at all resilent to go live with... Some of us are not even able to install the pip installations... permissions issue for certain windows versions.
  • Mahesh_Pune
    Hello Kailash, Good to see Kite 3.0. However if at sometime if i would like to use Kite 2.0, can i switch between 3.0 & 2.0 versions.

    In particular I like in Kite 2.0, we could open Holdings on one Tab & same time can open Full Width of Webpage for Marketwatch with Scrips. OR Can I get to see Marketwatch with full width of Webpage in 3.0 also. Right now Marketwatch is being shown only on Left hand side verticle.
    Please advice.
  • sujith
    @Mahesh_Pune,
    This forum is dedicated only to Kite Connect related queries. Please write to support for other platform related queries.
  • ramana
    Hi @sujith ,

    any update on getting OHLC data from KiteXL in new version.
  • sujith
    @ramana,
    KiteXL is a third party product offered by @botany02 and team. You can create a new thread and ask them for updates.
  • ssashita
    Hi, I would like to know if API calls made through older kiteconnect node packages such as version 1.2.2 will still work after May 20 2018. Also, I used to be able to get the stock quotes by connecting using the api key and a public access token provided to us by Zerodha. This is not working in kiteconnect 3.0. Is this expected behaviour? In 3.0, are we necessarily expected to login for quotes ?
  • sujith
    Yes, after 20th May 2018. We will be shutting down older versions of Kite Connect APIs.
    Users are expected to log in to use Kite Ticker to fetch live market data.
  • neil1422
    Dude, the Github Readme sucks. Link
    There are a hell lot of bugs, seems like the code has been refactored but this README is not.
    Just for an example,
    1. There is no class named - Kiteconnect but actually it is "KiteConnect"
    2. The is no class named - UserModel but actually it is "User"
    and many other.

    The README is supposed to be from the developer of the library and correct 100% of the time. You guys are developers are too and hope you can understand how frustrating this can become at times for the users of this codebase.
    I have resolved the issues for myself but other people may still face problems. Please fix the README bugs ASAP.

    Thanks and no hard feelings,
    Nilendu
  • sujith
    @neil1422,
    Thank you for notifying. We will update readme.
  • S_RAMESH
    @sujith sir kiteconnect 3.7 is not suitable for Mobile. I was comfortable with mobile. now all of a sudden I am forced to stop my trading through mobile using kiteconnect .
    Please do something. Don't stop previous version from may 20. It's humble request.
    Or at least extend deadline . Until we find some alternate solution.
    Sir which platform is best suited for using in Mobile for v 3 . All these days it was python for v 2. Now please suggest. For v 3
    Regards Ramesh.
  • sujith
    @S_RAMESH, Can you elaborate what you are doing on mobile?
  • S_RAMESH
    Sir I am using qpython app for using kiteconnect 3.6.in mobile. I tried to download 3.7 in mobile .it failed to download .
    then I contacted you through forum .
    U told me that It may not work in mobile hence I have to create my own python wrapper.
    So I started creating on my own .but i doubt whether I can finish all before 20 May.
    So requested to extend deadline.
  • S_RAMESH
    Refer our discussion
    "Kiteconnect 3.7.0b10 not installing in mobile"
  • sujith
    The above thread has a discussion about the issue. It doesn't have any information about what is the purpose of using pykiteconnect on mobile.
    Can you elaborate what you are doing there? What are the features you are using?
  • Ajax
    Ajax edited May 14
    Please check this thread. The close data seems to be incorrect for all instruments

    https://kite.trade/forum/discussion/4057/kite-3-quote-data-issues#latest
  • codezed
    where can I get the 300 credits? don't see any place to enter any credit code on billing page
  • codezed
    codezed edited May 21
    while at it, why didn't you guys improve the billing system ? it's horrible. 2000 credits? what is each credit worth? why is there a credit system instead of a monthly cost for using apis? UpStox api are cheaper and have a simplified billing system. just saying.
    even if there is some reason for "credits", it is still a very confusing way to position billing for APIs
  • sujith
    @codezed,
    This thread was created in JAN 2018 and the promo offer was there for only 30 to 45 days. It is not valid anymore.
    On developers console,1 credit is equal to 1 rupee. You need 2000 credits to create a Kite Connect app or renew Kite Connect app.
    Please create a new thread if you have any other queries. It might help others who are looking for the same.
This discussion has been closed.