Option Chain Data via Dhan API

Hello, I’m currently working on a project that requires real-time access to the Option chain data using Dhan API, and I could use some guidance and insights from those who have experience with it. Here are a couple of questions I have:

  1. How can I access real-time Option chain data using Dhan API? Are there specific endpoints or methods I should be aware of to retrieve this information?
  2. What are the prerequisites for integrating Dhan API into my trading application to access Option chain data in real-time? Do I need any special permissions or subscriptions?
  3. Why do you personally find it beneficial to access real-time Option chain data from Dhan API or similar sources? What advantages does it offer in terms of trading strategies, risk management, or any other aspects?
  4. Are there any specific challenges or considerations I should be aware of when working with real-time data from Dhan API, such as handling data updates, latency, or reliability?

The short answer - real time data is not yet available with Dhan. Once they bring out the market feed api (hopefully soon) then your questions can be answered.

If you need the live option chain data to create auto strike price selection, then I can help you.

How to get live options chain data? I scalp data from NSE site but it is generally 2-3 minutes delayed.

I had created a code which will check banknifty ( or nifty) index value and fetch security ids of chosen strike price gaps for me without the need to access option chain. Yes, getting ‘LIVE’ optionschain data directly is still unknown for me.

1.Do we have update on " access real-time Option chain data using Dhan API ?

  1. What is the use of marketfeed.DhanFeed ?

The example provided in dhanhq · PyPI is giving error

" instruments
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Hello @MukeshM

Answering your queries below:

  1. No. We have beta launched our Live Market Feed. As mentioned by @joker-w, you can easily get almost all Option Chain data directly from Feed data itself.
  2. marketfeed.DhanFeed is a class. On the error part, there is a mistake in the pypi documentation. You can refer GitHub documentation for updated test code - here.
1 Like

@Hardik I am trying to foray into the options world now. Regarding point 1, how can I get the option data from the feed?

Hello @sv28

Similar to how you subscribe equity instruments over websockets, you can subscribe to option contracts as well. You will be getting price, depth, volume and OI data for the options over websockets.