Dhan's DhanHQ API is built for traders who automate. Sniper AI Algo Trader Bot connects to it with a long-validity access token, so once you set it up you are not logging in every morning.
The bot runs your selected strategy on Nifty, Bank Nifty or Sensex and routes orders to your Dhan account with your stop-loss, target and trailing-stop rules attached. Funds stay in your Dhan account the whole time.
Capital stays in your Dhan accountOfficial Dhan APIPaper mode before liveStop-loss & trailing on every trade
▶ How Sniper AI Algo Trading Bot Works — Automated Nifty, Bank Nifty & Sensex Trading
Connect Dhan (DhanHQ) step by step
Open dhanhq.co/app/developers and click Generate new API Key (any app name; Redirect URL can be https://localhost).
Open the Trading APIs tab and enable Trading APIs.
Add the two Allowed IPs shown in your Sniper broker screen (your dedicated primary and backup static IPs). Live orders are rejected without this step.
Click Generate new Access Token and set validity to 30 days.
Paste your Client ID, Access Token and API Key into Broker → Dhan in Sniper, save, then Test Connection and Set Active.
Dhan-specific tips
The IP whitelist is the most common reason for rejected Dhan API orders — use the exact IPs shown in your dashboard (copy buttons avoid stray spaces).
Renew the access token before its validity ends; the bot will alert you if the token stops working.
Dhan supports NSE and BSE index options and equities; enable the segments you want to trade in your Dhan account.
How orders are placed on Dhan
Where possible the bot uses Dhan's Super Order, which links the entry with its stop-loss and target at the broker. If a super order cannot be placed, the bot falls back to a standard entry and manages the exit legs itself.
Disclaimer: Sniper AI Algo Trader Bot (VYOM IT SOLUTIONS, GSTIN 10AYYPT2812R1ZN) is software that executes the rules you configure through your broker's official API. It is not investment advice and not a SEBI-registered investment adviser. Trading in futures & options carries high risk; past performance and backtests do not guarantee future results. Your capital always remains in your own Dhan account. Broker API features, charges and requirements can change — confirm on Dhan's official website.