Hi @bsjhala and @Gangavarapu
As promised, sharing the codes. Please check below GitHub link to access the Python code having custom functions created to get live NSE option chain data of any Index/Stock Option derivative and security id dynamically.
Python Code for FNO order placements using DhanHQ
Our code is very easy to understand and use with Dhan platform. It has following custom functions;
- get_option_chain_data() - To fetch live option chain data (in .json format) from NSE website
- process_option_chain_raw_data() - To process .json format raw data and return option chain as a Pandas data frame
- get_security_ID_and_LTP() - This is the only function that we need to call and above two functions are called automatically inside this one. After getting option chain as data frame, this function fetches data from api-scrip-master.csv file from Dhan servers and returns the security_id and it’s last trading price as output (in tuple format)
How to use the code? It’s simple, explained using two examples below 
Example 1 - Placing Nifty 18100 CE Intraday Limit Buy Order (10-Nov-2022 expiry):
security_id, security_ltp = get_security_ID_and_LTP(symbol='NIFTY', expiry_date='2022-11-10', strike_price=18100, option_type='CE')
dhan.place_order(security_id=security_id, exchange_segment=dhan.FNO, transaction_type= dhan.BUY, quantity=50, order_type=dhan.LIMIT,
product_type= dhan.INTRA, price=security_ltp)
Example 2 - Placing ITC 347.5 PE Intraday Limit Sell Order (24-Nov-2022 expiry):
security_id, security_ltp = get_security_ID_and_LTP(symbol='ITC', expiry_date='2022-11-24', strike_price=347.5, option_type='PE')
dhan.place_order(security_id=security_id, exchange_segment=dhan.FNO, transaction_type= dhan.SELL, quantity=3200, order_type=dhan.LIMIT,
product_type= dhan.INTRA, price=security_ltp)
Note:
- symbols must be in capital letters and should be as per NSE standards like NIFTY, BANKNIFTY, FINNIFTY, ITC, HDFCBANK etc
- expiry_date must be in ‘YYYY-MM-DD’ format
- strike_price must be a numerical value like 18100, 41200, 347.5 etc
- quantity parameter in dhan.place_order() function must be in multiples of the scrip lot size. For example, single lot of ITC has 3200 quantity and two lots have 3200x2=6400 quantity. Similarly, single lot of BANKNIFTY has 25 quantity and two lots have 25x2=50 quantity.
Hope this helps. 
Let me know in case of any queries or issues while accessing or executing the codes.
Best,
Ravi