0.0.5 • Published 4 years ago

yahoo-finance-history v0.0.5

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

yahoo-finance-history

Historical price history data from Yahoo Finance including dividends and splits

Install

$ npm install yahoo-finance-history --save

Usage

var yahoo = require("yahoo-finance-history");
global.fetch = require('node-fetch');

(async () => {
    try {
        let data = await yahoo.getPriceHistory("MSFT");

        // Raw history data returned by Yahoo Finance in CSV format
        const priceHistory = data.priceHistory;
        const dividendHistory = data.dividendHistory;
        const splitHistory = data.splitHistory;

        for (const price of priceHistory.split("\n").sort().reverse()) {
            console.log(price);
        }

        for (const dividend of dividendHistory.split("\n").sort().reverse()) {
            console.log(dividend);
        }

        for (const split of splitHistory.split("\n").sort().reverse()) {
            console.log(split);
        }
    }
    catch (ex) {
        console.log('got error:' + ex);
    }
})();

License

MIT license; see LICENSE.

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago