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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nse-api-package

v2.3.0

Published

A Node.js wrapper for the NSE India API

Downloads

328

Readme

NSE Live API Wrapper

A Node.js wrapper for the NSE India API, providing easy access to stock market data, including stock quotes, market status, trade information, and more.

Installation

Install the package via npm:

npm install nse-api-package

Usage

Here's how you can use the NSE Live API Wrapper in your project:

const {NSELive,NSEArchive} = require('nse-api-package');
const nseArchive = new NSEArchive();
const nseLive = new NSELive();

// Example: Fetching stock quote for a specific equity

nseLive.stockQuote('LT')
  .then(data => console.log(data))
  .catch(error => console.error(error));

// Example: Fetching data of all Indices

nseLive.allIndices()
  .then(data => console.log(data))
  .catch(error => console.error(error));

// Example: Fetching trade information for a specific equity

nseLive.tradeInfo('LT')
  .then(data => console.log(data))
  .catch(error => console.error(error));

// Example: Fetching live F&O data for a specific equity

nseLive.stockQuoteFNO('NIFTY')
  .then(data => console.log(data))
  .catch(error => console.error(error));

//Example: Fetch chart data for the index 'NIFTY'

nseLive.chartData('NIFTY 50',true)
  .then(data => console.log(data));
  .catch(error => console.error(error));

//Example: Fetch EOD data From NSE

nseArchive.downloadEodDataBetweenDates('15052024','20062024','./output')
  

API

nseLive.stockQuote(symbol)

Fetches stock quote information for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the stock quote data.
nseLive.marketStatus()

Fetches the current market status.

  • Returns: A promise that resolves to the market status data.
nseLive.tradeInfo(symbol)

Fetches trade information for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the trade information data.
nseLive.stockQuoteFNO(symbol)

Fetches live F&O data for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the live F&O data.
nseLive.chartData(symbol)

Fetches chart data for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the chart data.
nseLive.marketTurnover(symbol)

Fetches marketTurnover for the given symbol.

Parameters:

  • symbol (string): The stock symbol. -Returns: A promise that resolves to the marketTurnover data.
nseLive.equityDerivativeTurnover(symbol)

Fetches equityDerivativeTurnover for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the equityDerivativeTurnover data.
nseLive.allIndices()

Fetches data of allIndices.

Parameters:

  • Returns: A promise that resolves to the allIndices data.
nseLive.liveIndex(symbol)

Fetches liveIndex for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the liveIndex data.
nseLive.indexOptionChain(symbol)

Fetches indexOptionChain for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the indexOptionChain data.
nseLive.equitiesOptionChain(symbol)

Fetches equitiesOptionChain for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the equitiesOptionChain data.
nseLive.currencyOptionChain(symbol)

Fetches currencyOptionChain for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the currencyOptionChain data.
nseLive.liveFNO(symbol)

Fetches liveFNO for the given symbol.

Parameters:

  • symbol (string): The stock symbol.
  • Returns: A promise that resolves to the liveFNO data.
nseLive.preOpenMarket(category)

Fetches preOpenMarket for the given category.

Parameters:

  • category (string): The category symbol.[NIFTY,BANKNIFTY,SME,FO,OTHERS,ALL]

  • Returns: A promise that resolves to the preOpenMarket data.

nseLive.holidayList()

Fetches holidayList for NSE.

Parameters:

  • Returns: A promise that resolves to the holidayList data.
nseArchive.downloadEodDataForDate(date, outputDir)

Fetches End of the day(EOD) data of stocks from NSE for the given date.

Parameters:

  • symbol (date, outputDir): date in the format ddmmyyyy [eg:2June2024 as '02062024'].outputDir for save the downloaded eod file [eg:'./output']

  • Returns: A promise that downloads and save the EOD data for the given date

nseArchive.downloadEodDataBetweenDates(startDateStr, endDateStr, outputDir)

Fetches End of the day(EOD) data of stocks daily from NSE for the given period.

Parameters:

  • symbol (startDateStr, endDateStr, outputDir): date in the format ddmmyyyy [eg:2June2024 as '02062024'].outputDir for save the downloaded eodfile [eg:'./output']

  • Returns: A promise that downloads and save the EOD data for a given period.

nseArchive.downloadTodayEodData(outputDir)

Fetches End of the day(EOD) data of stocks from NSE for today

Parameters:

  • symbol (outputDir): outputDir for save the downloaded eodfile [eg:'./output']

  • Returns: A promise that downloads and save the EOD data for today.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or support, please open an issue on the GitHub repository.

Note:

This package is not affiliated with or endorsed by NSE India.this package is created only for study purpose