Documentation

NSE India CLI

nse-india-pp-cli

Install

npx -y @mvanhorn/printing-press-library install nse-india

Installs the CLI binary and the agent skill for Claude Code, Codex, Cursor, Gemini CLI, Copilot, and more. Add --cli-only or --skill-only for one half. Requires Node.

Documentation

Every NSE equity data point in a single Go binary — live quotes, order book, filings, and a local SQLite store no other tool has.

nse-india-pp-cli fetches real-time NSE equity quotes, index constituents, corporate filings, and market status with just browser headers — no API key, no Python runtime, no setup friction. After sync, the local SQLite store powers cross-symbol analysis that is invisible in any single API call: delivery spikes, sector breadth, portfolio margin health, and index attribution.

Created by @lavs9 (Mayank Lavania).

Authentication

No authentication required. The CLI sends browser-compatible headers (User-Agent + Referer) that mirror what NSE's website uses. Options chain data may require a browser session cookie — use 'nse-india-pp-cli auth login --chrome' if those commands return empty data.

Quick Start

# Check if NSE is open before fetching data
nse-india-pp-cli market

# Live price, 52w H/L, sector PE, pre-market IEP
nse-india-pp-cli quote ADANIPORTS

# Order book, delivery%, VaR margin
nse-india-pp-cli depth RELIANCE

# Find today's biggest Nifty losers
nse-india-pp-cli index "NIFTY 50" --json | jq '.data[] | select(.pChange < -3)'

# Cache IT sector for offline analysis
nse-india-pp-cli sync --symbols INFY,TCS,WIPRO,HCLTECH

# Detect institutional accumulation signals
nse-india-pp-cli delivery-spike --threshold 2.0 --agent

Unique Features

These capabilities aren't available in any other tool for this API.

Local state that compounds

  • delivery-spike — Flags stocks where today's delivery-to-traded ratio is significantly above their 20-session rolling average — early signal of institutional accumulation.

    Use when you want to detect institutional accumulation before price follows — the delivery spike precedes moves 2-3 sessions earlier than price action alone.

    nse-india-pp-cli delivery-spike --threshold 2.0 --agent
    
  • iep-drift — Tracks how accurately each stock's pre-market IEP (Indicative Equilibrium Price) predicts the actual opening price over 30 sessions.

    Use in pre-market to know which IEP signals are reliable for that day's gap-open strategy.

    nse-india-pp-cli iep-drift --lookback 30 --min-gap 1.5 --agent
    
  • announcement-flood — Surfaces companies whose filing cadence has spiked above their own historical baseline — a leading indicator of imminent corporate actions like rights issues or mergers.

    Use when monitoring for surprise corporate actions — a flood of exchange filings reliably precedes announcements by 3-7 days.

    nse-india-pp-cli announcement-flood --window 7d --threshold 3 --agent
    
  • portfolio pnl — Tracks unrealized P&L, daily delta, and drawdown for a personal holdings file against the synced quote history.

    Use when an agent needs to report portfolio performance or trigger rebalancing alerts without a brokerage integration.

    nse-india-pp-cli portfolio pnl --holdings holdings.csv --agent
    
  • portfolio margin-health — Aggregates VaR margin, extreme loss margin, and adhoc margin across a full portfolio — shows total margin-at-risk and which holdings are the biggest margin consumers.

    Use before market open to check whether overnight VaR changes have pushed margin utilization above a safe threshold.

    nse-india-pp-cli portfolio margin-health --holdings holdings.csv --agent
    
  • delivery-divergence — Detects when price is rising but delivery % is falling (distribution signal) or price falling while delivery is rising (accumulation signal) — separates smart money from retail.

    Use when evaluating whether a trend is sustainable — delivery divergence at a peak is the single clearest distribution signal available from public data.

    nse-india-pp-cli delivery-divergence --lookback 10 --agent
    

Agent-native plumbing

  • sector-breadth — Computes advance/decline ratio, median pChange, and delivery breadth for every constituent of a named index — far richer than the index headline number.

    Use when deciding whether an index move is broad-based or driven by one or two large caps — changes the conviction of a trade.

    nse-india-pp-cli sector-breadth --sector IT --agent
    
  • index-driver — Decomposes any day's index move into per-stock point contributions — identifies the 3-5 stocks driving 80%+ of the index change.

    Use when the index move looks misleading — tells an agent whether a rally is concentrated (single-stock risk) or genuinely broad.

    nse-india-pp-cli index-driver --index "NIFTY 50" --agent
    

Usage

Run nse-india-pp-cli --help for the full command reference and flag list.

Commands

corporate

Corporate actions, filings, and financial data

  • nse-india-pp-cli corporate actions - Corporate actions history — dividends, bonuses, splits, rights with ex-dates and record dates
  • nse-india-pp-cli corporate announcements - Exchange filings — board meetings, results, AGM, investor meets, disclosure intimations
  • nse-india-pp-cli corporate annual_reports - Annual reports with direct PDF download URLs, going back multiple years
  • nse-india-pp-cli corporate financial_results - Quarterly and annual financial result filings with XBRL links
  • nse-india-pp-cli corporate insider_trading - SEBI PIT (Prohibition of Insider Trading) disclosures — promoter/director buy/sell with quantities, values, pre/post holding %

equity

Comprehensive equity quote data for NSE-listed stocks

  • nse-india-pp-cli equity derivatives - F&O data — futures (3 expiries with OI, volume, turnover) and options contracts (CE/PE by strike and expiry)
  • nse-india-pp-cli equity quote - Full equity quote — last price, 52w H/L, sector PE, order book (5 bid/ask levels), delivery%, VaR margin, index memberships, pre-open IEP

indices

NSE index data and constituents

  • nse-india-pp-cli indices constituents - Live prices for all constituent stocks in an index with 52w range, 1Y/30D% change
  • nse-india-pp-cli indices list - List all available NSE indices with short and long names

market

Market status and operational information

  • nse-india-pp-cli market status - Real-time market status for all segments (Capital Market, Currency, F&O, WDM) with current NIFTY level

movers

Market activity rankings

  • nse-india-pp-cli movers active - Most active intraday securities ranked by volume or traded value

symbol_lookup

Symbol search and autocomplete

  • nse-india-pp-cli symbol_lookup autocomplete - Search symbols by company name or ticker — returns equity, MF, index matches

Output Formats

# Human-readable table (default in terminal, JSON when piped)
nse-india-pp-cli indices list

# JSON for scripting and agents
nse-india-pp-cli indices list --json

# Filter to specific fields
nse-india-pp-cli indices list --json --select id,name,status

# Dry run — show the request without sending
nse-india-pp-cli indices list --dry-run

# Agent mode — JSON + compact + no prompts in one flag
nse-india-pp-cli indices list --agent

Agent Usage

This CLI is designed for AI agent consumption:

  • Non-interactive - never prompts, every input is a flag
  • Pipeable - --json output to stdout, errors to stderr
  • Filterable - --select id,name returns only fields you need
  • Previewable - --dry-run shows the request without sending
  • Read-only by default - this CLI does not create, update, delete, publish, send, or mutate remote resources
  • Offline-friendly - sync/search commands can use the local SQLite store when available
  • Agent-safe by default - no colors or formatting unless --human-friendly is set

Exit codes: 0 success, 2 usage error, 3 not found, 5 API error, 7 rate limited, 10 config error.

Health Check

nse-india-pp-cli doctor

Verifies configuration and connectivity to the API.

Configuration

Config file: ``

Troubleshooting

Not found errors (exit code 3)

  • Check the resource ID is correct
  • Run the list command to see available items

API-specific

  • options command returns empty JSON — Run 'nse-india-pp-cli auth login --chrome' to capture browser session cookie; options chain requires NSE session state
  • 429 Too Many Requests — The CLI auto-backs off at 3 req/sec; add '--rate-limit slow' for batch operations or wait 30 seconds
  • delivery-spike shows no results after sync — Need 20+ sessions of data: run 'nse-india-pp-cli sync --full' daily for 4 weeks before running delivery-spike

Sources & Inspiration

This CLI was built by studying these projects and resources:

Generated by CLI Printing Press

For agents: pass /documentation/nse-india/agents.md to install this CLI from a prompt.