Historcial equity Data

I am getting JSONDecodeError: Expecting value error while trying to download equity historical data

NSEPython
NSEPython is a Python wrapper created to scrap the NSEIndia APIs. It is an educational project.

Use appropriate threads for -

  • Documentation
  • Feature Request
  • Bug Reporting

Link: NSE Python - Unofficed

Write some more details.

Like you are in PC or… Server…

Specs…

hi Dexter

i am working on PC

system specs you want to know …?

Tell the OS. Always tell the OS. It helps.

Windows 11 home
python version

this is the program which i am using and have attached the ss for you reference, please help me to sort out this

import nselib
import pandas

from nsepython import *

tickers = 'INFY'

start_date = "01-03-2024"
end_date = "07-06-2024"

with pd.ExcelWriter('D:/data.xlsx', engine='xlsxwriter') as writer:
     for ticker in tickers:
         stock_data = equity_history(ticker,'EQ',start_date,end_date)
         stock_data.to_excel(writer, sheet_name=ticker)
         

print('Done')

python version 3.12…

more interestingly this error only occurs while fetching the equity histororical data, working good with indices historical fetching.

tickers = ‘NIFTY 50’, ‘NIFTY AUTO’,‘NIFTY BANK’,‘NIFTY FMCG’,‘NIFTY IT’,‘NIFTY MEDIA’,‘NIFTY METAL’,‘NIFTY PHARMA’,‘NIFTY PSU BANK’,‘NIFTY REALTY’,‘NIFTY OIL AND GAS’

start_date = “01-Mar-2024”
end_date = “07-Jun-2024”

with pd.ExcelWriter(‘E:/FinAnalysis/Nifty NSE Sectoral Indices/NiftySectorReturn.xlsx’, engine=‘xlsxwriter’) as writer:
for ticker in tickers:
stock_data = index_history(ticker,start_date,end_date)
stock_data.to_excel(writer, sheet_name=ticker)

1 Like

same thing happening with me. were you able to solve it?

I will update the patch for NSEPython’s Local Edition.

For some reason, the current NSE Update only affected the persons using “Windows” computer

See everything I update and fix something I must ensure it is not screwing up with something that is already working…

yes even i’m on windows.
thanks for the update. cheers.

Update the package.

Thanks its working now

thanks alot. working. so i had a noob question. i have a script that scrapes FNO stocks data. yesterday i ran the same script on google colab with nsepythonserver and it completed the task in 1/5th the time. was just curious as to why that was faster than running the same script locally. i would like to apologize in advance if this question is too basic but I’m a complete noob. TIA.

They turned off gzip compression for Windows People. So some of their engineers have fucked up.