NSEPython & NSEPythonServer 2.98 — Akamai Fix (Oct 2026)

Major Update — Akamai Transport Fix (both NSEPython and NSEPythonServer)

NSE tightened their Akamai Bot Manager protection and it quietly broke nsefetch() across both
libraries — plain requests/curl got blocked outright (403/404 Akamai challenge pages on
basically every API call). Rewrote the transport onto curl_cffi with real Chrome TLS
impersonation + a cookie warm-up, and rerouted a bunch of endpoints NSE quietly retired or moved
in the process. Live-tested end to end against the real site, not mocked.


Transport Fix

  • nsefetch() now uses curl_cffi (Chrome TLS fingerprint impersonation) instead of plain
    requests/curl — this was the root cause, Akamai was blocking the old TLS fingerprint
    outright regardless of User-Agent header.
  • Raises a proper NSEEndpointError now instead of silently returning {} — if something’s
    actually broken you get a real exception instead of a confusing downstream KeyError.
  • New dependency: curl_cffi (already in requirements.txt / setup.py — a normal
    pip install -U nsepython / pip install -U nsepythonserver brings it along).
  • (NSEPythonServer only) the old mode="vpn" path shelled out via os.popen() — that’s gone,
    it was also a command-injection risk.

Endpoints NSE Moved/Retired, Now Rerouted

  • option-chain-indices, quote-equity, equity-stockIndices — all working again
  • Index family rerouted to /api/allIndices (old iislliveblob.niftyindices.com host is dead)
  • FNO lot sizes rerouted to nsearchives.nseindia.com’s new CSV layout
  • The /api/historical/* family (equity_history, derivative_history, expiry_history,
    nse_largedeals_historical, security_wise_archive) rerouted off the dead historical API onto
    its live replacement
  • nse_circular("latest") was hitting a dead no-www URL — fixed
  • nse_quote(section="trade_info") remapped onto the new quote endpoint’s own fields instead of
    the dead section= route
  • index_history, index_pe_pb_div, index_total_returns fixed against niftyindices’ new
    Sitefinity-CMS backend

Bug Fixes


Known Remaining Gaps (being upfront, not hiding anything)

  • nse_quote(section=...) for any value other than "trade_info" still hits a dead path — only
    trade_info got remapped this round.
  • pcr() and nse_quote_meta() can mis-handle the flat-vs-nested option-chain data shape for
    index/derivative symbols in some cases — noted in code comments, planned for a follow-up pass.

Links

If you hit anything still broken, reply here with the exact function call and the error —
I’d rather know now than have it sit silently broken for another year.