DHAN Historical Intraday API not working as Expected

Hi @Hardik /Team

I find a strange behavior with Intraday API
URL: https://api.dhan.co/v2/charts/intraday

As you can see from the image below, I am only requesting for May 22 13:01:01 to 13:02:01, where I expect one candle data but I can see the list of all candle starting from 13:02 to current time candle data (i.e. till 14:08). The filter on toDate is not working as expected. Please take a look at this and fix this.

Also i would like to know, when is the appropriate time to hit this intraday API to get the one minute HLCV(high, low, close, volume) data. Can I hit immediately after a minute is completed, or should i wait a few seconds before sending the request. If so, how many seconds of wait is recommended.

API REQUEST:
{
“securityId”: 25,
“exchangeSegment”: “NSE_EQ”,
“fromDate”: “2025-05-22 13:01:01”,
“toDate”: “2025-05-22 13:02:01”,
“instrument”: “EQUITY”,
“expiryCode”: 0,
“oi”: false,
“interval”: 1
}

API RESPONSE:
{
“open”: [
2478.9,
2477.9,
2476.5,
2477.1,
2475.0,
2475.2,
2475.1,
2476.4,
2475.0,
2475.3,
2477.7,
2479.9,
2479.4,
2478.9,
2480.0,
2479.0,
2477.8,
2478.0,
2478.3,
2478.0,
2480.1,
2482.4,
2483.0,
2481.5,
2479.0,
2479.1,
2478.2,
2479.1,
2481.3,
2480.7,
2477.6,
2479.1,
2480.1,
2479.2,
2479.1,
2478.9,
2477.5,
2476.4,
2476.0,
2473.6,
2475.0,
2473.1,
2471.0,
2470.7,
2472.4,
2471.9,
2473.4,
2473.9,
2472.8,
2472.8,
2472.5,
2473.9,
2470.0,
2472.8,
2474.1,
2473.8,
2474.2,
2474.4,
2473.5,
2474.2,
2474.4,
2476.5,
2476.0,
2475.1,
2475.8,
2477.6,
2476.0
],
“high”: [
2479.0,
2477.9,
2477.1,
2477.1,
2476.2,
2476.6,
2476.8,
2476.4,
2476.4,
2477.9,
2480.0,
2479.9,
2480.0,
2479.9,
2481.6,
2479.0,
2479.3,
2479.5,
2479.5,
2479.8,
2482.9,
2482.8,
2483.0,
2481.5,
2479.9,
2479.9,
2480.0,
2481.8,
2481.8,
2481.0,
2478.7,
2481.1,
2480.1,
2479.3,
2479.5,
2479.6,
2477.5,
2478.5,
2476.4,
2475.0,
2475.0,
2473.2,
2471.6,
2473.4,
2472.4,
2473.9,
2475.4,
2473.9,
2472.8,
2474.3,
2473.1,
2474.4,
2472.1,
2474.3,
2474.7,
2474.2,
2474.4,
2474.4,
2474.4,
2475.0,
2476.9,
2476.8,
2476.6,
2476.6,
2477.4,
2478.0,
2476.0
],
“low”: [
2477.1,
2476.1,
2475.0,
2475.7,
2475.0,
2475.0,
2474.5,
2474.0,
2474.3,
2475.1,
2477.5,
2477.8,
2479.0,
2478.5,
2479.0,
2476.2,
2477.4,
2478.0,
2477.9,
2477.0,
2480.1,
2481.6,
2480.5,
2479.0,
2478.2,
2477.0,
2477.3,
2479.1,
2480.3,
2478.0,
2477.3,
2479.1,
2478.8,
2476.7,
2476.5,
2477.4,
2475.2,
2475.2,
2473.5,
2473.0,
2471.8,
2471.6,
2470.0,
2470.7,
2471.0,
2471.9,
2472.3,
2472.3,
2472.3,
2472.0,
2472.4,
2470.0,
2469.0,
2472.8,
2473.4,
2472.7,
2473.4,
2473.2,
2473.3,
2474.2,
2474.4,
2475.5,
2475.1,
2475.0,
2475.4,
2476.0,
2475.2
],
“close”: [
2477.9,
2476.5,
2477.1,
2476.1,
2475.5,
2475.2,
2475.6,
2474.0,
2475.3,
2477.9,
2478.1,
2479.4,
2479.7,
2479.0,
2479.0,
2477.8,
2479.3,
2478.5,
2478.0,
2479.8,
2482.6,
2482.5,
2481.4,
2479.5,
2478.6,
2478.0,
2478.5,
2480.5,
2480.7,
2479.0,
2478.1,
2479.7,
2479.2,
2477.8,
2478.9,
2477.4,
2475.6,
2476.5,
2473.8,
2474.6,
2472.7,
2471.6,
2470.7,
2472.4,
2471.9,
2472.5,
2473.9,
2472.3,
2472.7,
2472.4,
2473.1,
2470.1,
2472.1,
2474.1,
2473.8,
2474.1,
2474.4,
2473.2,
2474.3,
2474.4,
2475.5,
2476.0,
2476.5,
2475.8,
2476.9,
2476.0,
2475.4
],
“volume”: [
89.0,
1224.0,
1258.0,
464.0,
725.0,
1541.0,
661.0,
588.0,
996.0,
488.0,
560.0,
891.0,
188.0,
640.0,
1451.0,
709.0,
351.0,
1968.0,
209.0,
333.0,
811.0,
1120.0,
310.0,
1552.0,
255.0,
4265.0,
2555.0,
390.0,
1330.0,
1205.0,
132.0,
388.0,
190.0,
2283.0,
8606.0,
1138.0,
2314.0,
649.0,
3697.0,
5178.0,
4633.0,
10817.0,
5110.0,
700.0,
820.0,
2327.0,
2058.0,
2407.0,
177.0,
1363.0,
448.0,
1625.0,
1917.0,
1213.0,
289.0,
306.0,
159.0,
468.0,
294.0,
937.0,
577.0,
297.0,
572.0,
308.0,
985.0,
562.0,
151.0
],
“timestamp”: [
1.74789912E9,
1.74789918E9,
1.74789924E9,
1.7478993E9,
1.74789936E9,
1.74789942E9,
1.74789948E9,
1.74789954E9,
1.7478996E9,
1.74789966E9,
1.74789972E9,
1.74789978E9,
1.74789984E9,
1.7478999E9,
1.74789996E9,
1.74790002E9,
1.74790008E9,
1.74790014E9,
1.7479002E9,
1.74790026E9,
1.74790032E9,
1.74790038E9,
1.74790044E9,
1.7479005E9,
1.74790056E9,
1.74790062E9,
1.74790068E9,
1.74790074E9,
1.7479008E9,
1.74790086E9,
1.74790092E9,
1.74790098E9,
1.74790104E9,
1.7479011E9,
1.74790116E9,
1.74790122E9,
1.74790128E9,
1.74790134E9,
1.7479014E9,
1.74790146E9,
1.74790152E9,
1.74790158E9,
1.74790164E9,
1.7479017E9,
1.74790176E9,
1.74790182E9,
1.74790188E9,
1.74790194E9,
1.747902E9,
1.74790206E9,
1.74790212E9,
1.74790218E9,
1.74790224E9,
1.7479023E9,
1.74790236E9,
1.74790242E9,
1.74790248E9,
1.74790254E9,
1.7479026E9,
1.74790266E9,
1.74790272E9,
1.74790278E9,
1.74790284E9,
1.7479029E9,
1.74790296E9,
1.74790302E9,
1.74790308E9
]
}

Hey @lakshmi.s

Noted. This is because the data is not being filtered for the current day, something which we are working on.

Will let you know once this is fixed.

@Hardik it would also help me, if you can take a look at another concern that I had raised. Link Below:

Thanks in Advance :slight_smile:

@Hardik

I have also noticed that this issue(toDate filter not applied on Intraday historical API )only happens during real time market. the from and to filter works as expected for old/previous market days.

1 Like

Hey @lakshmi.s

Yes, this is true. Since the APIs were designed initially for only fetching current day data and primarily for charts and analysis, it sends packet upto last minute, as that is the most used method. But will be adding that filtering on the toDate as well and making sure you can get any candle data for current day as well.

@Hardik
Thanks for your response. Appreciate it.

1 Like