Unable to download NIFTY 50 index intraday 1 minute data

I am using the following code -
intraday =dhan.intraday_minute_data(
security_id=‘13’,
exchange_segment=‘NSE_EQ’,
instrument_type=‘INDEX’,
)
df = pd.DataFrame(intraday[‘data’])
temp=
for i in df[‘start_Time’]:

temp.append(dhan.convert_to_date_time(i))

df[‘date’]=temp

And getting following output -
open high low close volume start_Time date
0 8575.7 8575.7 8575.7 8575.7 1.0 1.404457e+09 2024-07-03 12:24:00

When I tried for TCS susing the following code -
intraday =dhan.intraday_minute_data(
security_id=‘11536’,
exchange_segment=‘NSE_EQ’,
instrument_type=‘EQUITY’,
)
I got correct output.

Mr Administrator , will you please have a look and bother to reply?
I have already posted two similar issues yesterday and yet to get any reply.

Hello @pinaki248

For index, you need to use exchange_segment as IDX_I. This should help you get data for indices.

You can refer to the same as part of documentation as well: here.

Thank you very much. It solved my problem. Hope any changes shall be duly notified to the subscribers.

1 Like