Open Nemexot opened 7 months ago
Faced similar issues related to indices modules across many libraries. It is because nse made modifications to its request payload a few days back and the code isn't updated for the same.
You can track this alternative api for various stuff and not just data gathering: https://github.com/devfinwiz/Fin-Maestro-Kin It is presently in it's early stages of development. Active work on it is in progress. Once this is deployed, you can simply send your request to specific endpoints to receive results.
+1 Facing Same error for Equity data
from jugaad_data.nse import index_csv, index_df
import json
# Download as pandas dataframe
df = index_df(symbol="NIFTY 50", from_date=date(2020,1,1),
to_date=date(2020,1,30))
print(df.head())
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-7-11a563af62bc>](https://localhost:8080/#) in <cell line: 5>()
3
4 # Download as pandas dataframe
----> 5 df = index_df(symbol="NIFTY 50", from_date=date(2020,1,1),
6 to_date=date(2020,1,30))
7
8 frames
[/usr/local/lib/python3.10/dist-packages/jugaad_data/nse/history.py](https://localhost:8080/#) in _index(self, symbol, from_date, to_date)
311 }
312 r = self._post_json("index_history", params=params)
--> 313 return json.loads(self.r.json()['d'])
314
315 def index_raw(self, symbol, from_date, to_date):
KeyError: 'd'
Issue description
Any operations with the index returns an error
Example Code
Error snippet