Getting an error


KeyError Traceback (most recent call last)
in <cell line: 4>()
2 start_date = “01-Mar-2011”
3 end_date = “07-Jun-2021”
----> 4 print(index_history(symbol,start_date,end_date))

/usr/local/lib/python3.10/dist-packages/nsepython/rahu.py in index_history(symbol, start_date, end_date)
747 payload = requests.post(‘https://niftyindices.com/Backpage.aspx/getHistoricaldatatabletoString’, headers=niftyindices_headers, data=data).json()
748 # print(payload)
→ 749 payload = json.loads(payload[“d”])
750 payload=pd.DataFrame.from_records(payload)
751 return payload

KeyError: ‘d’

1 Like