Error code 'DH-905'

@Dhan

Please help error comes , what going wrong in code line 569, in get_intraday_data

– Processing Day: 2025-08-21 —
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-905’, ‘error_type’: ‘Input_Exception’, ‘error_message’: ‘System is unable to fetch data due to incorrect parameters or no data present’}, ‘data’: {‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘System is unable to fetch data due to incorrect parameters or no data present’}}
Traceback (most recent call last):
File “d:\Dhan Practice\Dhan_Tradehull.py”, line 569, in get_intraday_data
raise Exception(ohlc)
Exception: {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-905’, ‘error_type’: ‘Input_Exception’, ‘error_message’: ‘System is unable to fetch data due to incorrect parameters or no data present’}, ‘data’: {‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘System is unable to fetch data due to incorrect parameters or no data present’}}

Hello @DKS ,

Thank you for bringing this up. @Tradehull_Imran may be able to assist better here.

1 Like

Hi @DKS ,

tsl.get_intraday_data was a old method to get historical data… it gives data only for today, which makes problem if we want to create indicators on it.

Dhanhq was upgraded and now we can use get_historical_data which gives data for last 5 working days.

Retrieve historical or intraday data:

Get Historical Data

  • tsl.get_historical_data(tradingsymbol: str, exchange: str, timeframe: str, debug: str = “NO”)
    • Arguments:
      • tradingsymbol (str): The trading symbol for the instrument you want to fetch data for (e.g., ‘NIFTY’, ‘ACC’).
      • exchange (str): The exchange where the instrument is traded (e.g., ‘NSE’, ‘INDEX’).
      • timeframe (str): The timeframe for the data. It can be:
        • ‘1’ for 1-minute candles
        • ‘5’ for 5-minute candles
        • ‘15’ for 15-minute candles
        • ‘25’ for 25-minute candles
        • ‘60’ for 60-minute candles
        • ‘DAY’ for daily candles
      • debug (optional, str): Set to “YES” to enable detailed API response logging. Default is “NO”.
    • Sample Code:

data = tsl.get_historical_data(tradingsymbol='NIFTY', exchange='INDEX', timeframe="DAY") 
data = tsl.get_historical_data(tradingsymbol='ACC', exchange='NSE', timeframe="1")

Also do update to our latest codebase version 3.0.6:

  • Open Command Prompt: Press Win, type cmd, and press Enter.
  • Install Dhan-Tradehull: Run pip install Dhan-Tradehull
  • Confirm the installation by running pip show Dhan-Tradehull

Guide to use the updated codebase:
Refer the below pypi link for more details:
https://pypi.org/project/Dhan-Tradehull/
Video reference :

1 Like