I am experiencing an issue with the /v2/charts/rollingoption API endpoint. While retrieving historical data for index options (OPTIDX) works fine, I consistently receive an HTTP 400 error when attempting to fetch data for stock options (OPTSTK).
Here are the key details:
- API Endpoint: api. dhan .co /v2 /charts /rollingoption
- Error: HTTP 400 (No detailed error message)
- Stock Symbols Tested: RELIANCE, TCS, INFY, SBIN, HDFCBANK, and others
- Index options data works fine with the same API, while stock options return the 400 error.
I’ve tested various combinations of parameters (expiryFlag, strike price, date ranges). Despite this, the issue persists.
Could you kindly confirm:
- Does the endpoint support stock options (OPTSTK)?
- Are there any known limitations or restrictions for stock options data?
- Is there an alternative method to fetch stock options data?
Request Structure for Stock Options Historical Data (HTTP 400 Error)
POST https:// api .dhan .co /v2 /charts /rollingoption
{
“access-token”: “YOUR_ACCESS_TOKEN”,
“Content-Type”: “application/json”
}
Request Body (Stock Options - FAILING with HTTP 400):
{
“securityId”: “2885”,
“exchangeSegment”: “NSE_FNO”,
“instrument”: “OPTSTK”,
“expiryFlag”: “M”,
“expiryCode”: 0,
“strike”: “ATM”,
“drvOptionType”: “CALL”,
“requiredData”: [
“open”,
“high”,
“low”,
“close”,
“volume”,
“oi”,
“iv”,
“strike”,
“spot”
],
“fromDate”: “2025-09-01”,
“toDate”: “2025-09-30”
}
Result: HTTP 400 ![]()
