![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
nse-api-package
Advanced tools
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.
Install the package via npm:
npm install nse-api-package
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')
nseLive.stockQuote(symbol)
Fetches stock quote information for the given symbol.
nseLive.marketStatus()
Fetches the current market status.
nseLive.tradeInfo(symbol)
Fetches trade information for the given symbol.
nseLive.stockQuoteFNO(symbol)
Fetches live F&O data for the given symbol.
nseLive.chartData(symbol)
Fetches chart data for the given symbol.
nseLive.marketTurnover(symbol)
Fetches marketTurnover for the given symbol.
nseLive.equityDerivativeTurnover(symbol)
Fetches equityDerivativeTurnover for the given symbol.
nseLive.allIndices()
Fetches data of allIndices.
nseLive.liveIndex(symbol)
Fetches liveIndex for the given symbol.
nseLive.indexOptionChain(symbol)
Fetches indexOptionChain for the given symbol.
nseLive.equitiesOptionChain(symbol)
Fetches equitiesOptionChain for the given symbol.
nseLive.currencyOptionChain(symbol)
Fetches currencyOptionChain for the given symbol.
nseLive.liveFNO(symbol)
Fetches liveFNO for the given symbol.
nseLive.preOpenMarket(category)
Fetches preOpenMarket for the given category.
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.
nseArchive.downloadEodDataForDate(date, outputDir)
Fetches End of the day(EOD) data of stocks from NSE for the given date.
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.
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
symbol (outputDir): outputDir for save the downloaded eodfile [eg:'./output']
Returns: A promise that downloads and save the EOD data for today.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or support, please open an issue on the GitHub repository.
This package is not affiliated with or endorsed by NSE India.this package is created only for study purpose
FAQs
A Node.js wrapper for the NSE India API
We found that nse-api-package demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.