Upgrade to Kite Connect 3.0

Kailash edited January 23 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
    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
    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
  • 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
    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
    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
    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
    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
    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
    After we completely migrate you won't be able to place orders. You need to migrate to Kite Connect 3.
  • tasklive
    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

    Is there any VB.net sample available for KiteConnect3.0 API.
  • sujith
    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
    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.

  • sujith
    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
    hey man, seems i m paying for the raising bugs in ur latest kite3 APIs.
    pls check this thread -
  • sujith
    sujith edited February 20
    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
Sign In or Register to comment.