Hello Traders,
We have talked about our tech stack and approach about building Dhan in this community a lot of times. And as we scale Dhan, we continue to build awesome products and features which aim to make your trading and investing experience seamless.
We made trading APIs for our stack available to every Dhan user very early in our journey (within four months of launching) under DhanHQ and we have kept on improving the technology stack with every user feedback and suggestions each day. Our vision for building this API stack is to empower users to trade from their own systems, incorporating their unique customisations and thought processes and we serve as a reliable execution engine, facilitating a seamless trading experience for its users.
Our core transaction execution engine across all exchanges powers all Dhan products - not only our flagship products like Dhan and Options Trader but also our strategic partnerships with industry leaders such as TradingView and smallcase. On top of our execution engine are our APIs which process orders and transactions under seconds, handling millions of requests each day. With DhanHQ APIs, we have aimed to deliver everything that a tech geek or algotrader needs - speed, reliability, low latency and of course minimal or no additional costs.
However, one of the missing pieces, which has also been the most requested feature from Dhan, is Real-time Data as part of our API offering. Yes, this has been requested for a very long time, but building the infrastructure for all our products and extending it to Open API came with its own set of challenges. Our primary goal was to develop a reliable and faster solution that could scale effectively.
We are delighted to announce that we are now live with Live Market Feed as part of our DhanHQ Data API Stack.
Live Market Feed is available as part of Data APIs on the DhanHQ Superfast Trading & Investing API stack, which any user can subscribe to at a fees of just Rs. 499 per month + taxes. We have added a nominal subscription cost to the Market Feed APIs to cover the infrastructure cost of providing low-latency, reliable data with no limitations to API traders. This step is taken to prevent misuse while ensuring accessibility for legitimate users.
Live Market Feed will give you Real-time market data across all exchanges and segments over Websocket. Websocket is a bidirectional communication protocol over a single established TCP connection which you can learn more about here.
With DhanHQ Live Market Feed, you get following exchanges and segments:
- NSE - Equity, Futures, Options, Currency
- BSE - Equity, Futures, Options, Currency
- MCX - Commodity
To empower traders and tech geeks building systems on top of our API stack, we have enabled Live Market Feed users to,
- Subscribe upto 5000 instruments on a single websocket connection at this moment
- We have built systems robust to send multiple formats of data on a single connection on any number of scrips.
- Not just this, you can establish up to 5 connections of Market Feed as a Data API user.
On DhanHQ Live Market Feed, you can subscribe to different Market Data types as per your requirement:
- LTP and Trade Data
- Market Depth
- Volume
- OI
- Previous Close and others.
This data will be available in the following packet types via DhanHQ Libraries:
- Ticker Packet: LTP data
- Quote Packet: LTP + Best bid-ask + OHLC data
- Market Depth Packet: Bid-Ask up to level 5
So, here’s how you can get started with DhanHQ Live Market Feed:
- API Documentation : Live Market Feed - DhanHQ Ver 1.0 / API Document
- DhanHQ Python Library : GitHub - dhan-oss/DhanHQ-py: The official Python client for communicating with the Dhan API.
To access the Live Market Feed:
- Log in to web.dhan.co.
- Navigate to DhanHQ Trading APIs.
- Go to Data APIs and subscribe to Live Market Feed.
Once you have subscribed to Data APIs, your subscription will be auto-renewed every 30 days from your ledger, so that you do not need to worry about renewing subscription ever.
We are really excited to extend Market Feed to you on APIs, and we look forward to your feedback on the same. Also, if you want to contribute to any of our libraries on GitHub, feel free to do as we aim to make and maintain API libraries completely Open Source.
– Hardik
Product