nsepython

raw JSON →
2.97 verified Fri May 01 auth: no python

nsepython is a Python library that provides an interface to NSE India APIs, allowing users to fetch stock quotes, indices, derivatives, and other market data. The version is 2.97 with ongoing updates. Release cadence is irregular but frequent.

pip install nsepython
error ImportError: No module named 'nsequote'
cause Trying to import nsequote directly without using nsepython package.
fix
Use from nsepython import nsequote.
error ValueError: Invalid symbol
cause Symbol not found or incorrect format (e.g., missing '.NS' for NSE stocks).
fix
Use proper symbol format, e.g., 'INFY' or 'INFY.NS'.
breaking In v2.0, the import path changed from `nsepython.nsequote` to `nsepython`. Old code using `from nsepython.nsequote import nsequote` will break.
fix Use `from nsepython import nsequote`.
gotcha NSE API rate limiting: frequent requests may lead to temporary IP bans or CAPTCHA blocks.
fix Add delays between requests (e.g., `time.sleep(0.5)`).
deprecated The function `nseget` is deprecated in favor of `nsefetch`.
fix Replace `nseget` with `nsefetch`.

Fetch stock quote for INFY

from nsepython import nsequote
quote = nsequote('INFY')
print(quote)