Data API access for Trading DhanHQ APIs

I subscribed for data APIs in dhan, and it shows me subscribed but when i use the new generated access token in my python code. It gives me the response as:

{'status': 'failure', 'remarks': {'error_code': 'HTTP429', 'message': 'Your account is not authorize to use this API. Fulfill eligibility criteria or subscribe the plan.'}, 'data': ''}

I am trying to run this simple API:

tv2 = dhan.intraday_minute_data(
    security_id='11536',
    exchange_segment='NSE_EQ',
    instrument_type='EQUITY'
)

please help me here

Hello @sethg

Welcome to Dhan Comunity!

Are you still facing this issue? There was a bug which was not updating API subscription, now it is fixed. Do try once and let me know if you are still facing this issue.

Hi, I am also getting same error this is the code from dhanhq import dhanhq

from dhanhq import dhanhq

dhanhq(“xyz”,“abcdedfght…”)

print(dhan.historical_daily_data(
symbol=‘TCS’,
exchange_segment=‘NSE_EQ’,
instrument_type=‘EQUITY’,
expiry_code=0,
from_date=‘2022-01-08’,
to_date=‘2024-02-08’
)) Getting error {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘HTTP429’, ‘message’: ‘Your account is not authorize to use this API. Fulfill eligibility criteria or subscribe the plan.’}, ‘data’: ‘’}

I am also getting this error 451 Unavailable For Legal Reasons
{
“errorCode”: “INVALID_API_ACCESS”,
“httpStatus”: “UNAVAILABLE_FOR_LEGAL_REASONS”,
“internalErrorCode”: “HTTP429”,
“internalErrorMessage”: “Your account is not authorize to use this API. Fulfill eligibility criteria or subscribe the plan.”
}

Hello @manishru

It takes a few minutes to add access to your account. You can generate a new token and try again. Do let us know if you are still facing this issue.

I am still getting this error

rom dhanhq import dhanhq

from dhanhq import marketfeed

#import nest_asyncio
#nest_asyncio.apply()

#import asyncio

dhan = dhanhq(“xyzzz”,“eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJkaGFuIiwicGFydG5lcklkIjoiIiwiZXhwIjoxNzMyNjk4ODIwLCJ0b2tlbkNvbnN1bWVyVHlwZSI6IlNFTEYiLCJ3ZWJob29rVXJsIjoiIiwiZGhhbkNsaWVudElkIjoiMTEwMDYwNzk4MSJ9.Z6PjLNeppq4vagTrwZ9kXI8P_XIsxUDSNFNhVJiTx3xzOhJY7yaQ8MxwwtRrpp3LMrGyV6tsdsdsdsds”)
print(dhan)
dhan.get_holdings()

dhan.historical_daily_data(
symbol=‘TCS’,
exchange_segment=‘NSE_EQ’,
instrument_type=‘EQUITY’,
expiry_code=0,
from_date=‘2022-01-08’,
to_date=‘2024-02-08’
)

Giving me error like <dhanhq.dhanhq.dhanhq object at 0x1042270d0>

[6]:

{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘HTTP429’, ‘message’: ‘Your account is not authorize to use this API. Fulfill eligibility criteria or subscribe the plan.’}, ‘data’: ‘’}