Skip to main content

PNSEA - Python NSE API (v1.2.1)

PNSEA is a high-performance, stealthy Python library for fetching data from the National Stock Exchange of India (NSE). Powered by Stealthkit to bypass rate limits and blocks.

🛠 Usage Reference

Initialize

Python

from pnsea import NSE
nse = NSE()

🔍 Discovery & Debugging

Python

# Autocomplete search for symbols
print(nse.autocomplete("info"))

# Endpoint Tester (Debug any NSE API URL directly through the stealth session)
url = "https://www.nseindia.com/api/option-chain-indices?symbol=NIFTY"
print(nse.endpoint_tester(url).json())

📈 Equity Data

Python

# Get CMP (Current Market Price)
print(nse.equity.info("SBIN")['priceInfo']['lastPrice'])

# Get Full Info or specific blocks
print(nse.equity.info("SBIN"))
print(nse.equity.info("SBIN")['info'])

# All Stocks Snapshot & Market Status
print(nse.equity.all_stocks_data())
print(nse.equity.market_status())

# Snapshot: Snapshot for all indices (NIFTY 50, INDIA VIX, etc.)
print(nse.equity.all_indices())

# Find data for a specific index by name
vix_data = nse.equity.find_index("INDIA VIX")
print(vix_data)

# Historical Data (Returns DataFrame)
print(nse.equity.history("ESCORTS", "01-02-2025", "14-02-2025"))

# --- Institutional Tracking (Price & Delivery) ---

# 1. Default: Fetch Price & Delivery (Most common for accumulation analysis)
df_delivery = nse.equity.delivery_history("RELIANCE", "13-12-2025", "13-01-2026")

# 2. Advanced: Specific Data Types or Series
# Options for type: "priceVolumeDeliverable", "priceVolume", "deliverable"
df_only_deliv = nse.equity.delivery_history("RELIANCE", "13-12-2025", "13-01-2026", type="deliverable", series="ALL")

# 3. Example: Filter for high institutional accumulation (> 60% delivery)
# This uses the clean mapped column names
high_delivery = df_delivery[df_delivery['Delivery_Pct'] > 60]
print(high_delivery[['Date', 'Close', 'Delivery_Pct']])

🏢 Insider Trading & Corporate Actions

Python

# Insider Trading (All or Filtered)
print(nse.insider.insider_data())
print(nse.insider.insider_data("SBIN"))
print(nse.insider.insider_data("INFY", from_date="11-12-2023", to_date="14-02-2025"))

# Pledged Data
print(nse.insider.getPledgedData("ESCORTS"))

# SAST Data
print(nse.insider.getSastData("ESCORTS"))
print(nse.insider.getSastData("INFY", from_date="01-01-2024", to_date="01-02-2025"))

📉 Indices Options (NIFTY, BANKNIFTY, etc.)

Python

# Returns: [0] DataFrame, [1] Expiries List, [2] Underlying Value
print(nse.options.option_chain("NIFTY")[0])

# Filtered Calls
print(nse.options.option_chain("NIFTY", expiry_date="06-Mar-2025")[0])
print(nse.options.option_chain("NIFTY", strike_price=22000)[0])

# Helpers
print(nse.options.expiry_dates("NIFTY"))
print(nse.options.get_indices())

🏎 Equity Options (Stock FnO)

Python

# Get list of all FNO Stocks
print(nse.equityOptions.fno_stocks_list())

# Option Chain for Stocks
print(nse.equityOptions.option_chain("SBIN")[0])
print(nse.equityOptions.option_chain("SBIN", expiry_date="27-Mar-2025", strike_price=800)[0])

# Helpers
print(nse.equityOptions.expiry_dates("SBIN"))

💰 Mutual Fund Insider Data

Python

# Filter by date, ISIN, or Symbol
print(nse.mf.mf_insider_data(from_date="01-02-2025", to_date="02-02-2025"))
print(nse.mf.mf_insider_data(isin="INF879O01027"))
print(nse.mf.mf_insider_data(symbol="PPFAS Mutual Fund"))


🛡 Why PNSEA?

  1. Human-like Fingerprinting: Uses stealthkit to rotate TLS and headers, preventing 403 Forbidden errors.

  2. Analysis Ready: Complex nested JSON is automatically flattened into Pandas DataFrames.

  3. v3 API Support: Uses the most modern NSE endpoints for speed and reliability.

Metadata

Release files for pnsea 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pnsea 1.2.1
File Size Uploaded
pnsea-1.2.1.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pnsea 1.2.1
File Interpreter ABI Platform
pnsea-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / pnsea-1.2.1.tar.gz

Download URL pnsea-1.2.1.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fe846af5e49c91b02b7c434ac8fb23fef542bb9d57d4631ae0809e4fbbcdfae2
BLAKE2b-256 checksum
How to use checksums
aacee97631ca18a7c2fae763f148f1d418f22614cdd2eb8a8286db25932eb011
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / pnsea-1.2.1-py3-none-any.whl

Download URL pnsea-1.2.1-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2ea4801f1912164fc17f8a2b4d10039879277e8a183ad5cfe2c94ff44469d27
BLAKE2b-256 checksum
How to use checksums
23fd96d809d8d80951da47a596a883098384480886e25c6bed5854cb06e1a0b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.27

2 release files

0.2.26

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page