Issue with Daily Historical Data API endpoint - 400 Bad Request, DH-905 error

This morning I was running my daily scripts for data ingestion and ran into an issue with the daily historical data API endpoint.

Request:

curl --request POST \
  --url https:// api.dhan.co / v2 / charts / historical \
  --header 'access-token: [REDACTED]' \
  --header 'content-type: application/json' \
  --data '{
  "securityId": "13",
  "exchangeSegment": "IDX_I",
  "instrument": "INDEX",
  "expiryCode": 0,
  "oi": false,
  "fromDate": "2025-01-01",
  "toDate": "2025-12-31"
}'

Response:

400 Bad Request along with the following response:

{
  "errorType": "Input_Exception",
  "errorCode": "DH-905",
  "errorMessage": "Missing required fields, bad values for parameters etc."
}

This script has worked without issues until 24 hours ago. Something has changed in the API endpoint overnight.

I have already reached out to the support team via email [#4772731] and the suggested fix was that I include a timeframe field (which is now required, apparently) in the request. However, the issue remains unresolved.

The suggested request per support team below still produces the same error.

curl --request POST \
  --url https: // api.dhan.co / v2 / charts / historical \
  --header 'access-token: [REDACTED]' \
  --header 'content-type: application/json' \
  --data '{
    "securityId": "13",
    "exchangeSegment": "IDX_I",
    "instrument": "INDEX",
    "expiryCode": 0,
    "oi": false,
    "fromDate": "2025-01-01",
    "toDate": "2025-12-31",
    "timeframe": "1D"
  }'

There is no mention of this required timeframe field in the official documentation here /docs/v2/historical-data/.

Please advise.

1 Like

I have just tested this request with a few random indices i.e.

BANKNIFTY [ID: 25] :x:
FINNIFTY [ID: 27] :x:
BSE SENSEX [ID: 51] :white_check_mark:
BSE MIDCAP [ID: 64] :x:
BSE BANKEX [ID: 69] :x:

The only one this request seems to be working with is SENSEX.

Any luck ? was encountering same issue today, intraday API is working though. Historical was working until yesterday.

1 Like

Hi @kiran_pudi, nope, no luck so far. And yes, intraday is working fine on my end as well. The issue is with daily historical.

Email support (which I suspect is a bot response) suggested me to use the official Python library (which I am) and check my code (which was working without issues until yesterday).

Hopefully a real human from the support team can weigh in before market open.

Thanks for the quick response, I logged a request from my end too.

1 Like

This issue remains unresolved as of 2025-10-26 12:00 PM.

Even the official API playground fails at this. This is clearly an API endpoint issue.

https:// api . dhan . co /v2/#/operations/historicalcharts

The request only works for SENSEX (ID: 51), but not for NIFTY 50 (ID: 13), or for BANKNIFTY (ID: 25):

1 Like

same issue here too

not working here too

same issue…

Hello @sriv,

We’re checking this from our end and will get back to you shortly with an update.

@Trishul_Devadiga thank you.

Hey @sriv,

We request you to please try fetching the historical daily data again. Everything should be working fine now.

1 Like

Hi @Trishul_Devadiga, it’s working now. Thank you for your help.

If it’s not too much bother, could you please explain what went wrong? Just so that users can be better prepared should this issue reoccur.

Thanks again.

working but rate limit still there (slow)

again same issue rated limited, and no new data error

1 Like

Hi @Trishul_Devadiga, this issue is back on again. None of the indices are working. Please look into it when possible. Thank you.

The issue seems to have been resolved.

@pawanyadavdelhi could you please check?

Hey @sriv ,

It has been resolved. We request you to kindly re-run the data and check.

Hello @Shrutika_Poojari, yes, it has been resolved. Thank you for looking into it.

yes its resolved now, but its frequently creating problem, dhan should fix core issue as we are paying for data api,

1 Like