Hello Traders,
At Dhan, we continue our journey to improve your experience from time to time. It’s not just about features, but everything - one step at a time. This time we will talk about a major update to our Trading API stack - DhanHQ.
We have recently talked about Dhan Technology Stack and what powers our platform making it robust at scale - DEXT, which is our in-house proprietary trading system on the latest technology stack on top of which all Dhan platforms run. We continue to execute your trades extremely fast, it of course helps to provide you unparalleled experience in terms of execution speeds as well as introducing unique features for super traders and long term investors.
With DhanHQ, we wanted to extend the same tech stack to all algo traders and platforms for them to offer the Dhan experience. This was the reason for us to release DhanHQ APIs just a few months after we released Dhan to all users. And we saw the adoption of our APIs early on due to execution speed and simplicity - today about ~3% to 4% of all our trades are executed via APIs with over 10,000+ traders building their trade execution on top of DhanHQ APIs.
From the time we have launched DhanHQ APIs, we have introduced a range of new features and even optimised them to make it developer friendly - whether that be offering Unlimited Rate Limits on APIs or announcing industry first features like Kill Switch API. Currently, we offer <75 ms latency on our APIs that many of our users have experienced themselves. This has come from our focus on making execution fast for all our users across Dhan platforms - powered by DEXT.
Over the last two years, with the increasing adoption of APIs and tech stack upgradation at our end as well, we wanted to upgrade our API stack as well. From conversations with hundreds of API / Algo traders and our partners, we even realised there are some missing pieces in our API offering that we need to build.
To offer an enhanced API experience for all Dhan users, we are today announcing DhanHQ API Version 2.
This is the first versioning of Dhan APIs and we have introduced a range of new APIs for our users to build upon.
DhanHQ v2 extends execution capability with live order updates and forever orders on superfast APIs. Along with this, we have also added Market Quote APIs, built on top of Live Market Feed which can be integrated with ease. We have also made improvements, added bug fixes and increased stability with the new version.
Here are some key highlights from the DhanHQ V2:
-
Market Quote API
You can now fetch LTP, Quote (with OI) and Market Depth data directly via REST APIs, for upto 1000 instruments at once with Market Quote API.
We realised the developer efforts required to integrate websockets for Live Market Feed and introduced the same offering on APIs, making it simpler for our users to integrate in their code base.
-
Forever Orders API
This has been a long pending request for all algo based swing traders. You can now place, modify and manage your Forever Orders, including single and OCO orders to manage risk and trade efficiently with Forever Order API.
This adds new capability for all Swing Traders to now turn to systematic trading with this API category.
-
Live Order Update
We introduced Postback (link here) and removed Rate Limits from all GET APIs for you to get instant updates about your order. Now, taking this one step further, you can get live order updates via DhanHQ.
Live Order Updates are sent in real time via websockets, which will update order status of all your orders placed via any Dhan platform - Live Order Update.
-
Margin Calculator API
Margin Calculation simplifies order placement by providing details about required margin and available balances before placing order. This helps you reduce order failures and ensure smooth order management at your end - Margin Calculator API.
-
Intraday Historical Data for timeframes 1 min, 5 min, 15 min, 25 min and 60 min
Now, on DhanHQ Data APIs, you can fetch data for different timeframes for a period upto last 7 days. This can help you construct different indicators across multiple time frames and build comprehensive trading systems - Intraday Historical Data API.
-
Live Market Feed with JSON requests
You can now authorise Live Market Feed via Query Parameters and subscribe/unsubscribe to instruments via JSON messages on websockets with this version. Also, FULL packet is now available which will give LTP, Quote, OI and Market Depth data in a single packet.
This makes it simpler for all our users to integrate and get more data in a single packet.
And there are a range of other improvements and bug-fixes as well. You can find them under Releases in DhanHQ Ver 2.0 API Documentation - here.
This release is not just it. We are going to introduce another range of unique APIs on DhanHQ that will help you build better systems for trading, with added simplicity Also, you can check out entire DhanHQ V2 API Documentation in below link:
https://dhanhq.co/docs/v2/
You can go and check these APIs in live environment in action right now at our v2 API Playground, before making any changes to your code. Just head to Dhan API and try yourself.
We will soon be upgrading our DhanHQ Python library as well for v2.
Note: We insist you to shift to DhanHQ V2 from Version 1 before 31st December 2024, as there will not be any upgrades happening to earlier versions now.
You may already know that most of these features were requested by all our users on this community and across forums. We would love to hear your views and feedback on this new version of DhanHQ as well.
Thank you
Hardik