-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nse data fetch issue #38
Comments
I'm running into the same issue @aeron7 |
replace index_history function with below function body in rahu.py def index_history(symbol,start_date,end_date): |
This is working. Thanks |
Support and Beta Functions |
Issue:
can't able to fetch index history using index_history function
ERROR:
"""
KeyError Traceback (most recent call last)
in <cell line: 6>()
4 start_date_r = start_date.strftime("%d-%b-%Y")
5 print(end_date_r, start_date_r)
----> 6 df = index_history(symbol,start_date_r,end_date_r)
7 len(df)
/usr/local/lib/python3.10/dist-packages/nsepython/rahu.py in index_history(symbol, start_date, end_date)
746 data = "{'name':'"+symbol+"','startDate':'"+start_date+"','endDate':'"+end_date+"'}"
747 payload = requests.post('https://niftyindices.com/Backpage.aspx/getHistoricaldatatabletoString', headers=niftyindices_headers, data=data).json()
--> 748 payload = json.loads(payload["d"])
749 payload=pd.DataFrame.from_records(payload)
750 return payload
KeyError: 'd'
"""
note:
payload = requests.post('https://niftyindices.com/Backpage.aspx/getHistoricaldatatabletoString', headers=niftyindices_headers, data=data).json()
payload={'Message': 'There was an error processing the request.',
'StackTrace': '',
'ExceptionType': ''}
The text was updated successfully, but these errors were encountered: