0.79%9,79,483 Clients
Dhan offers powerful, feature-rich APIs through its DhanHQ API suite, enabling traders, developers, and fintechs to build custom trading platforms and algorithmic strategies. The REST and streaming APIs provide access to live market data, historical data, positions, margins, portfolio, and fast order execution across major Indian exchanges.
The APIs are designed for online clients and are compatible with multiple programming languages. Dhan also provides SDKs, sample code, and detailed documentation, making it easier to integrate trading, data, and post-trade workflows into your own applications.
API benefits
| API Brokerage Charge | No additional charges for API access; standard brokerage applies |
| API Document Link | https://dhanhq.co/docs/v2/ |
| API Data Format | REST (JSON), Python SDK support |
| API Offer Type | Trading APIs, Market Data APIs, WebSocket APIs, Authentication APIs, Portfolio & Position APIs, Trader’s Control APIs, Forever Order APIs, Super Order APIs |
| API Exchange Support | NSE, BSE, MXC |
| API OS Support | Windows, macOS, Linux |
| API Support Features | Real-time order management, EDIS integration, Live Market Feed, and Historical Data |
| API Order Types | Market, Limit, SL, SL-M, Bracket (BO), Cover (CO), AMO, and Forever Orders |
To ensure system stability and fair usage, Dhan enforces the following rate limits
Individual traders can directly generate an Access Token from the Dhan web platform. All Dhan users get free access to Trading APIs.
Steps to Generate Access Token
Users can also generate tokens using the API endpoint if TOTP is enabled.
Renew Token
Users can renew their active token for another 24 hours using the Renew Token API.
Dhan also provides OAuth-based authentication using API Key and Secret credentials.
After generating the API Key and Secret, users must complete the following steps to generate the Access Token.
STEP 1: Generate Consent
This API validates the App ID and Secret and creates a login session for the user authentication process.
STEP 2: Browser-Based Login
STEP 3: Consume Consent
This API validates the:
After successful verification, the Access Token is generated, which is used for all API authentication and trading requests.
DhanHQ Ver 2.0 stands out as a developer-friendly, high-speed API suite that prioritises transparency and performance. With its "zero-cost" API model and extensive documentation, it provides both retail traders and institutional developers with the tools necessary to execute sophisticated trading strategies with precision.
Founded in 2021, Dhan is an online broking company offering financial services. Dhan offers online stock trading and investing services in India. Dhan has developed technologically advanced trading platforms.
Dhan allows its customers to open a 2-in-1 account. The account opening and account maintenance charges are Zero.
The company has a simple pricing model. Dhan charges Rs 20 per trade for intraday trading in Equity, ETF, Currency, F&O and Commodity segments. Dhan is offering a 50% discount to its female customers and charges a brokerage of Rs 10 per trade for intraday trades.
Dhan customers can generate API token using web.dhan.co. To create an API token, simply follow the instructions below:
Yes, Dhan APIs are free of charge. Dhan offers two APIs: Trading API and Data API. Trading APIs are absolutely free of cost. The data APIs are free if customers have executed 25 trades in the last 30 days. If they do not, they can get the data API access by paying Rs 499 + taxes.
Dhan offers trading API and data API to its clients.
Trading API - Trading APIs provide access to order placement, position, portfolio, funds, special orders and much more.
Data API - Data APIs allow access to historical data, data for any scrip or live market feeds.
Yes, there are no separate subscription charges for using the DhanHQ API.
The current limit for Order APIs is 7,000 requests per day.
Yes, the Live Market Feed API uses WebSockets to provide real-time tick-by-tick data.
Yes, Dhan provides a dedicated Historical Data API for fetching past candle information.
Information on this page was last updated on Monday, July 8, 2024
Zerodha (Flat Rs 20 Per Trade)
Special Offer - Invest brokerage-free Equity Delivery and Direct Mutual Funds (truly no brokerage). Pay flat Rs 20 per trade for Intra-day and F&O. Open Instant Account and start trading today.
Compare brokers side-by-side to choose the right one.
Are you a Dhan Customer?