Hi Team,
Can you please check the error below, where the SmartConnect Python SDK is not able to handle the response from the server?
Tue, 02-Jun 14:56:06 COFORGE ------------------------------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ec2-user/angelone/lib64/python3.11/site-packages/SmartApi/smartConnect.py", line 230, in _request
data = json.loads(r.content.decode("utf8"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/angelone/top_gainers_losers.py", line 429, in <module>
hist_data = smartApi.getCandleData({"exchange": "NFO","symboltoken": str(opt_token),"interval": "FIVE_MINUTE","fromdate":fromdate ,"todate": todate})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ec2-user/angelone/lib64/python3.11/site-packages/SmartApi/smartConnect.py", line 465, in getCandleData
getCandleDataResponse=self._postRequest("api.candle.data",historicDataParams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ec2-user/angelone/lib64/python3.11/site-packages/SmartApi/smartConnect.py", line 263, in _postRequest
return self._request(route, "POST", params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ec2-user/angelone/lib64/python3.11/site-packages/SmartApi/smartConnect.py", line 233, in _request
raise ex.DataException("Couldn't parse the JSON response received from the server: {content}".format(
SmartApi.smartExceptions.DataException: Couldn't parse the JSON response received from the server: b'Access denied because of exceeding access rate'