Dhan · about 3 min · Needs Dhan's Data API subscription

How to create a Dhan API key (DhanHQ)

You create the app once. AlgoStripe uses it to read prices for you only: it never places orders, and your data is never shown to anyone else. Have AlgoStripe's Data source page open beside these steps. It shows your exact Redirect URL with a copy button.

  1. 1
    Log in to web.dhan.co, open My Profile, then choose Access DhanHQ APIs.
  2. 2
    Switch to API key and enter any app name.
  3. 3
    Redirect URL: AlgoStripe gives every user their own for Dhan. Paste the one shown on your Data source page, exactly as it is.
  4. 4
    Leave the Postback URL empty and choose Generate. Dhan shows an API key and an API secret. They stay valid for 12 months.
  5. 5
    Prices need Dhan's Data API subscription (₹499 a month plus taxes). Subscribe on the same page, under Data APIs.
  6. 6
    Your Dhan Client ID is shown in My Profile.
  7. 7
    Copy the API key, the API secret and your Client ID into AlgoStripe's Data source page and choose Save app.
  8. 8
    Choose Log in to Dhan. Sessions last up to 24 hours, and AlgoStripe asks you to log in again each morning.

If something goes wrong

No prices after logging in
Your Dhan account has no Data API subscription. Subscribe to Data APIs under My Profile, Access DhanHQ APIs, then log in again.
Redirect URL error
The Redirect URL in your Dhan API key must match the one on your Data source page exactly: no space and no / at the end.
Client ID not accepted
Use the Client ID shown in My Profile on web.dhan.co. It is digits only.
The login stopped working after a year
Dhan API keys last 12 months. Generate a new one and save it on the Data source page.

Still stuck? Inside AlgoStripe, choose Get help from us on the Data source page and the team will set it up with you. We never ask for your broker password, PIN or OTP.

Connect Dhan.

Create your free account and open Data source. Your Redirect URL is there, ready to copy, with these steps beside it.

Start freeFree plan, no card needed
Other guides: Fyers · Upstox · Zerodha · Gemini