iran-stock
Nodejs package for live and historical Iran stock market status
Install
npm i iran-stock
API
status()
This method fetches latest status of iran stocks.
const iranStock = // get all stocks, then print count and information of the first stockiranStockstatus
history()
This method provides historical daily price information for a specific stock.
const iranStock = iranStockhistory // stock code code: '41302553376174581' // start date in yyyymmdd format startDate: '20200621' // end date in yyyymmdd format endDate: '20200623'
Example
Below example fetches price list of a specific stock in June 2020.
const iranStock = { try // get stock list const stocks = await iranStockstatus console // find the 'فجر' stock const myStock = stocks0 if !myStock console return; console // get price history for the stock const prices = await iranStockhistory // stock code code: myStockcode // start date in yyyymmdd format startDate: '20200601' // end date in yyyymmdd format endDate: '20200630' console catch err console }