The nselib.capital_market module provides access to equity data, including price/volume, delivery positions, bulk/block deals, and index-specific data.
Key Functions:
price_volume_and_deliverable_position_data(symbol, from_date/to_date or period): Returns OHLCV + delivery data.price_volume_data(symbol, from_date/to_date or period): Returns OHLCV price volume data.deliverable_position_data(symbol, from_date/to_date or period): Returns delivery position data.bhav_copy_with_delivery(trade_date): Daily bhav copy with delivery.india_vix_data(from_date/to_date or period): India VIX historical data.index_data(index, from_date/to_date or period): Historical index OHLC data.top_gainers_or_losers(to_get): Returns top gainers or losers. Use 'gainers' or 'loosers' for to_get.
from nselib import capital_market
# Bhav copy for a specific date
df = capital_market.bhav_copy_with_delivery(trade_date='20-06-2024')
# India VIX for last 1 week
df = capital_market.india_vix_data(period='1W')
# CM daily volatility report
df = capital_market.daily_volatility(trade_date='17-04-2026')
# Historical index data
df = capital_market.index_data(index='NIFTY 50', from_date='01-01-2024', to_date='31-03-2024')
# Financial results (quarterly, F&O securities only)
df = capital_market.financial_results_for_equity(period='6M', fo_sec=True, fin_period='Quarterly')
# Top gainers in live market
df = capital_market.top_gainers_or_losers('gainers')