Historic API stops working
-
NSE:MPHASIS-EQ
Exception in thread Thread-22:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/smartapi/smartConnect.py", line 188, in _request
data = json.loads(r.content.decode("utf8"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/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 "/Users/yashchotrani/Desktop/untitled folder 2/Finalised/Most_Probably_Final.py", line 173, in getHistoricalAPI
candel_json = credentials.SMART_API_OBJ.getCandleData(historicParam)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/smartapi/smartConnect.py", line 403, in getCandleData
getCandleDataResponse=self._postRequest("api.candle.data",historicDataParams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/smartapi/smartConnect.py", line 220, in _postRequest
return self._request(route, "POST", params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/smartapi/smartConnect.py", line 191, 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'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1394, in run
self.function(*self.args, **self.kwargs)
File "/Users/yashchotrani/Desktop/untitled folder 2/Finalised/Most_Probably_Final.py", line 191, in checkSingnal
candel_df = getHistoricalAPI(token)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yashchotrani/Desktop/untitled folder 2/Finalised/Most_Probably_Final.py", line 176, in getHistoricalAPI
print("Historic Api failed: {}".format(e.message))
^^^^^^^^^