Index_history is not working

@dexter on slack you are unavailable on forum you are unavailable, should i wait for it to fix or just drop it ? No updates about nsepython no where, no fixes.its been a long time

can you replace the index_history function with the below in rahu.py-

def index_history(symbol,start_date,end_date):
     data = "{'name':'"+symbol+"','startDate':'"+start_date+"','endDate':'"+end_date+"'}"
     data = {'cinfo': data}
     payload = requests.post('https://niftyindices.com/Backpage.aspx/getHistoricaldatatabletoString', headers=niftyindices_headers,  data=json.dumps(data)).json()

     payload = json.loads(payload["d"])
     payload=pd.DataFrame.from_records(payload)
     print(payload.head(1))
     return payload

Could you share the rahul.py link

Uff. So Long. I am intervening. Wait.

Sorted. Refer Getting an error - #7 by dexter

1 Like

@dexter Can you combine api from Niftyindices.com and NSEindia.com to fetch the historical data that have OHLC, Volume, Turnove, PE/PB, Div yield, Index name, date.

Niftyindices API doesn’t limit the date range but nseindia limit the date range for 1 year.

Need help on this.

But it also throws different data sturcture. So solving one request will create another problem. If you have other solution. tell me in detail. i will sort out.

@dexter i am also trying to figure it out but the issue is both website uses different index names as a code so it is difficult to catch and mege it all. So, i thought you may have some idea.

I am fully into commodity trading at the moment. So unless it picks my interest, I will not look at it (selfishly). But if you manage to find out fork a PR:)