Unable to fetch LTP

C:\Users\rites\OneDrive\Desktop\Dhan\Session3>py “Dhan_codebase usage test.py”
-----Logged into Dhan-----
reading existing file all_instrument 2025-09-11.csv
Got the instrument file
[0] > c:\users\rites\onedrive\desktop\dhan\session3\dhan_codebase usage test.py(14)()
→ pdb.set_trace()
(Pdb++) ltp2 = tsl.get_ltp(‘NIFTY’)
(-2147023174, ‘The RPC server is unavailable.’, None, None)
(Pdb++)

Hi @Ritesh_Basu ,

Welcome to madefortrade,

Thanks for bringing this up. @Tradehull_Imran may be able to assist here

Hi @Ritesh_Basu ,

Refer the below code:

data = tsl.get_ltp_data(names=['CRUDEOIL', 'NIFTY'])

Do update to our latest codebase version:

  • 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:

Great Sir its working. Thanks a lot.

which one is official?
dhan-tradehull
or
githubdotcom/dhan-oss/DhanHQ-py

previous_hist_data = tsl.get_historical_data(‘ACC’,‘NSE’,12)
intraday_hist_data = tsl.get_intraday_data(‘ACC’,‘NSE’,1)

@Tradehull_Imran

unable to fetch historical and intraday data

for historical data you need paid api

I have subscribed paid api