npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nse-data

v2.0.0

Published

NSE (National Stock Exchange) - Stock & Indices Data API

Readme

NSE Data Project

Overview

This project provides a set of APIs to interact with the National Stock Exchange (NSE) data, allowing users to access various market and equity information.

Available APIs

Market APIs

  • marketStatus: Retrieve the current market status. Source

    • Route URL: /marketStatus
    • HTTP Method: GET
  • searchSymbol: Search for a specific stock symbol. Source

    • Route URL: /search/autocomplete?q=
    • HTTP Method: GET

Equity APIs

  • equityHistory: Get historical data for equities. Source

    • Route URL: /historical/cm/equity?series=["EQ"]&symbol=
    • HTTP Method: GET
  • equityInfo: Retrieve detailed information about a specific equity. Source

    • Route URL: /equity-meta-info?symbol=
    • HTTP Method: GET
  • equityOptionChain: Access the options chain for equities. Source

    • Route URL: /option-chain-equities?symbol=
    • HTTP Method: GET
  • equityQuote: Get the latest quote for a specific equity. Source

    • Route URL: /quote-equity?symbol=
    • HTTP Method: GET

Index APIs

  • indexDetails: Retrieve details about a specific index. Source

    • Route URL: /allIndices
    • HTTP Method: GET
  • indexInfo: Get information about the index. Source

    • Route URL: /equity-stockIndices?index=
    • HTTP Method: GET
  • indexList: Access a list of indices. Source

    • Route URL: /index-names
    • HTTP Method: GET
  • indexOptionChain: Retrieve the options chain for indices. Source

    • Route URL: /option-chain-indices?symbol=
    • HTTP Method: GET

Installation

Install using 'npm'

npm install nse-data

or

Install using 'yarn'

yarn add nse-data

Usage

Sample Code

// ES5 Syntax using var and function declaration
const nseDataES5 = require('nse-data');

function fetchMarketStatusES5() {
    // Access marketStatus correctly through nseData
    nseDataES5.nseData.marketStatus(function(err, status) {
        if (err) {
            console.error('Error fetching market status (ES5):', err);
        } else {
            console.log('Market Status (ES5):', status);
        }
    });
}

fetchMarketStatusES5();

// CommonJS Syntax using require
const nseDataCJS = require('nse-data');

const fetchMarketStatusCJS = () => {
    nseDataCJS.nseData.marketStatus().then(status => {
        console.log('Market Status (CJS):', status);
    }).catch(err => {
        console.error('Error fetching market status (CJS):', err);
    });
};

fetchMarketStatusCJS();

// Anonymous Function using IIFE
(async () => {
    try {
        const status = await nseDataCJS.nseData.marketStatus();
        console.log('Market Status (Anonymous Function):', status);
    } catch (error) {
        console.error('Error fetching market status (Anonymous Function):', error);
    }
})();

// Top-Level Await (ES Module Context)
// Note: This will only work if the file is treated as an ES Module
import {nseData} from 'nse-data';
const status = await nseData.marketStatus();
console.log('Market Status (Top-Level Await):', status);

Sample Output

{
  "marketState": [
    {
      "market": "Capital Market",
      "marketStatus": "Closed",
      "tradeDate": "04-Feb-2025 15:30",
      "index": "NIFTY 50",
      "last": 23739.25,
      "variation": 378.2000000000007,
      "percentChange": 1.62,
      "marketStatusMessage": "Normal Market has Closed"
    },
    {
      "market": "Currency",
      "marketStatus": "Closed",
      "tradeDate": "04-Feb-2025",
      "index": "",
      "last": "",
      "variation": "",
      "percentChange": "",
      "marketStatusMessage": "Market is Closed"
    },
    {
      "market": "Commodity",
      "marketStatus": "Open",
      "tradeDate": "04-Feb-2025",
      "index": "",
      "last": "",
      "variation": "",
      "percentChange": "",
      "marketStatusMessage": "Market is Open"
    },
    {
      "market": "Debt",
      "marketStatus": "Closed",
      "tradeDate": "04-Feb-2025",
      "index": "",
      "last": "",
      "variation": "",
      "percentChange": "",
      "marketStatusMessage": "Market is Closed"
    },
    {
      "market": "currencyfuture",
      "marketStatus": "Closed",
      "tradeDate": "04-Feb-2025",
      "index": "",
      "last": "87.2475",
      "variation": "",
      "percentChange": "",
      "marketStatusMessage": "Market is Closed",
      "expiryDate": "25-Feb-2025",
      "underlying": "USDINR",
      "updated_time": "04-Feb-2025 17:00",
      "tradeDateFormatted": "04-Feb-2025 17:00",
      "slickclass": "slick-item"
    }
  ],
  "marketcap": {
    "timeStamp": "04-Feb-2025",
    "marketCapinTRDollars": 4.85,
    "marketCapinLACCRRupees": 422.59145349194324,
    "marketCapinCRRupees": 42259145.35,
    "marketCapinCRRupeesFormatted": "42,259,145.35",
    "marketCapinLACCRRupeesFormatted": "422.59",
    "underlying": "Market Cap"
  },
  "indicativenifty50": {
    "dateTime": "04-Feb-2025 15:30",
    "indicativeTime": null,
    "indexName": "NIFTY 50",
    "indexLast": null,
    "indexPercChange": null,
    "indexTimeVal": null,
    "closingValue": 23739.25,
    "finalClosingValue": 23739.25,
    "change": 378.16,
    "perChange": 1.62,
    "status": "CLOSE"
  },
  "giftnifty": {
    "INSTRUMENTTYPE": "FUTIDX",
    "SYMBOL": "NIFTY",
    "EXPIRYDATE": "27-Feb-2025",
    "OPTIONTYPE": "-",
    "STRIKEPRICE": "-",
    "LASTPRICE": 23781,
    "DAYCHANGE": "8.50",
    "PERCHANGE": "            0.04",
    "CONTRACTSTRADED": 73138,
    "TIMESTMP": "04-Feb-2025 19:43",
    "id": "4/NIFTYFUTIDX27-Feb-2025--"
  }
}