Getting KeyError: 'data' when using NSEPython

Hi,

I am a first time user of NSEPython. In calls to fnolist() or equity_history() and others, I get 'KeyError: ‘data’.

Code snippet below is from the documentation, which I tried running

from nsepython import *
print(fnolist())

I am running this on Python IDLE. Python & NSEPython versions are the latest.

Is there anything that I need to do differently?

Platform: Windows 11

Python 3.13.7

Hi, this was a real bug on my end, not something you did wrong.

NSE’s Akamai Bot Manager started blocking the old requests/curl-based transport this library used
outright (403/404 challenge pages instead of real JSON) — every call to fnolist(), equity_history(),
and most other functions was silently getting back a blocked/garbage response, and the old code just
did payload["data"] on whatever came back without checking, which is exactly the KeyError: 'data'
you hit. Nothing wrong with your code or your Python/Windows setup.

Fixed as of v2.98 (transport rewrite onto curl_cffi with real browser TLS fingerprinting), with
two more rounds of fixes since (v2.99, v2.100 — full audit pass, a new section=X support fix,
and a new nse_annual_reports() function from another forum request). Please upgrade:

pip install --upgrade nsepython

Then re-run your exact snippet — fnolist() and equity_history() should both return real data now,
not raise. Full technical writeup of what broke and what changed:

Let me know if upgrading doesn’t fix it for you specifically — Windows 11 / Python 3.13 isn’t a
combination I’ve tested directly, so I want to know if something’s different there.