Node-Js module for downloading NSE bhavcopy from NSE server.
To use, follow the below instructions:
const BhavCopy = require('nse-bhavcopy');
const options = {
type: 'json' // optional. if not specified, zip file will be downloaded. Valid TYPES: ['json', 'csv', 'zip']
dir: "xxxx" // optional. if not specified, files will be downloaded under NSE folder
};
const request = new BhavCopy(options);
request
.download({
month: "MAY", // required (values can be anything as given below under MONTH CODES)
year: 2016, // required (values can be anything as given below under YEAR CODES)
day: 10 // optional (values can be anything in range: 1 - 31)
})
.then(data => {
console.log(data); // Wait! Files are downloading...
})
.catch(err => {
console.log(err);
});
TYPES:
'json',
'csv',
'zip'
MONTH CODES:
"JAN",
"FEB",
"MAR",
"APR",
"MAY",
"JUN",
"JUL",
"AUG",
"SEP",
"OCT",
"NOV",
"DEC"
YEAR CODES:
2018,
2017,
2016
- Download bhavcopy for a specified day
- Or Download bhavcopy for entire month of a specified year
v1.0.0 now supports csv & json format as well.
nse-bhavcopy requires Node.js v8+ to run.
npm test
Please post your issues for further improvement or fixes if any: Github