LTP issue on rate limit

Hi Sir,

Most of times i am getting below message to track LTP. Which is best method to get ltp websocket or real API call (tsl.get_ltp_data(names=[symbol]))
xception in Getting OHLC data as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-904’, ‘error_type’: ‘Rate_Limit’, ‘error_message’: ‘Too many requests on server from single user breaching rate limits. Try throttling API calls.’}, ‘data’: {‘errorType’: ‘Rate_Limit’, ‘errorCode’: ‘DH-904’, ‘errorMessage’: ‘Too many requests on server from single user breaching rate limits. Try throttling API calls.’}}
Exception in Getting OHLC data as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-904’, ‘error_type’: ‘Rate_Limit’, ‘error_message’: ‘Too many requests on server from single user breaching rate limits. Try throttling API calls.’}, ‘data’: {‘errorType’: ‘Rate_Limit’, ‘errorCode’: ‘DH-904’, ‘errorMessage’: ‘Too many requests on server from single user breaching rate limits. Try throttling API calls.’}}
Warning: historical_data_1min for ADANIENT is not a DataFrame. Assigning an empty DataFrame.
Warning: historical_data_5min for ADANIENT is not a DataFrame. Assigning an empty DataFrame.
Fetched historical data for ADANIENT: 1min type: <class ‘pandas.core.frame.DataFrame’>, 5min type: <class ‘pandas.core.frame.DataFrame’>
Exception in Getting OHLC data as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-904’, ‘error_type’: ‘Rate_Limit’, ‘error_message’: ‘Too many requests on server from single user breaching rate limits. Try throttling API calls.’}, ‘data’: {‘errorType’: ‘Rate_Limit’, ‘errorCode’: ‘DH-904’, ‘errorMessage’: ‘Too many requests on server from single user breaching rate limits. Try throttling API calls.’}}

Hi @Suraj_Kannake
This rate limit issue is in get_historical_data.
Do use this codebase file : Dhan_Tradehull_V2.py - Google Drive

Also are you running 2 algo at the same time ?

Thanks for quick reply!
Yes, Two algo with different strategy

See solution link : Learn Algo Trading with Python | Codes | Youtube Series - #2129 by Tradehull_Imran