DhanHQ Superfast Trading APIs Update: Trading APIs are now FREE for all

Hi @t7support

For your reference.

“dhanClientId”: “1000000401”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_FNO”,
“productType”: “MARGIN”,
“orderType”: “MARKET”,
“validity”: “DAY”,
“tradingSymbol”: “”,
“securityId”: “4641”,
“quantity”: 50,
“disclosedQuantity”: ,
“price”: 0,
“triggerPrice”: 0,
“afterMarketOrder”: false,
“amoTime”: “”

Hope this helps!

Hello @Naman @Dhan_Help

I wish to use Algo trading thru a 3rd party webhook.
I searched for the webhook integration on your help pages but they all talk about TV webhooks.
Can you forward me details of any independent webhook implementation? Thanks

Thanks. Now it works.

hello. is api for trading view in Mac available ? found only for windows above.

Hi, How can I get the LTP of a security?

Hello @stanly_thomas

Welcome to Dhan Community! You can use the Intraday Historical data API to fetch 1 min OHLC data for any security. Hope this helps!

1 Like

@Hardik @Naman @PravinJ

DhanHQ Python documentation is to be updated and enriched.
documentation is very much required for proper implementation of code.

Hello @bsjhala

Thank you for the feedback. We have already added sample code on GitHub and PyPi. Also, we are looking into adding detailed Python Client documentation soon as well.

1 Like

Why don’t you map it internally and just get the trading symbol from us. Isn’t it just a database dump, that runs every morning ?

1 Like

How do we fetch the CMP / LTP of any scrip, So that i can dynamically take SL / TGT and SquareOff my options position. I am trying to do this programattically because, there is no OCO (only for intraday) now on API.

1 Like

Hello @Mohan
First of all, welcome to Dhan Community. To answer your question, Security ID is an exchange level standard and all our systems are built on the same. However, we have duly noted and will evaluate this.

@Mohan You can create different types of order at your end using custom scrips and Dhan APIs. For SL/TGT to square off positions, you can place SL order/ Limit order respectively.

Thanks for providing the API’s, I want to develop my own strategy in .net/ powershell using the API’s. I have a question on how to test the code which I am writing? Is there any access token for testing the features? The access token which I tried points to the live environment.

Hello @deepakrobot

Welcome to Dhan Community! It’s awesome to know that you are looking to build on Dhan APIs.
Currently, we do not provide any sandbox for API testing. However, our users do test these APIs on live environment either by placing after market orders or limit orders and later cancelling them from frontend.

Hope this helps! Feel free to reach out to @Dhan_Help if you face any issues while integrating.

1 Like

@Hardik @Naman

When will be market Feeds available .
Without Real time market feeds how can we set conditions and hecne orders.

Pls do it on priority basis.

Hey @bsjhala
We understand the need for Market Feed API and working towards it on a priority basis. I have explained our approach here.


Can you please provide sample request which works for Bracket Order. I am trying with below request but getting 400 bad request everytime. Also if I set afterMarketOrder to true and amoTime to ‘OPEN’, then that request should work even when market is closed?

    "transactionType":  "BUY",
    "securityId":  "11703",
    "disclosedQuantity":  10,
    "exchangeSegment":  "NSE_EQ",
    "boProfitValue":  3317,
    "orderType":  "MARKET",
    "afterMarketOrder":  false,
    "correlationId":  "test-ALKEM",
    "validity":  "DAY",
    "tradingSymbol":  "",
    "drvExpiryDate":  "",
    "price":  0,
    "quantity":  10,
    "triggerPrice":  0,
    "dhanClientId":  "xyz",
    "drvStrikePrice":  "",
    "productType":  "BO",
    "boStopLossValue":  3060,
    "amoTime":  "",
    "drvOptionType":  ""

Hello @deepakrobot

In the request structure, fields “boStopLossValue” and “boProfitValue” represent change in price between Stop Loss/Target and order price. So, you only need to enter the price difference there. The same is mentioned in the documentation.

Also, in the “disclosedQuantity” field, you can enter 0 if you want to disclose all of the order quantity. On an exchange level, Disclosed Quantity needs to be more than 10% and less than 30% of the actual order quantity.

Thanks for quick response. I was referring to Dhan API and there it was just mentioned price for bracket orders, please update the documentation here.

Noted, will update the documentation at Dhan API.

For now, hope you were able to place the order successfully. Do reach out to @Dhan_Help at help@dhan.co if you face any issues.