Fetch stock data from Yahoo! Finance
$ npm install --save yahoo-stocks
import { lookup, history } from 'yahoo-stocks';
lookup('AAPL').then(response => {
console.log(response);
});
history('AAPL').then(response => {
console.log(response);
});
Returns a Promise
that resolves the data for the symbol.
Type: String
The stock symbol.
Returns a Promise
that resolves the price history for the symbol.
Type: String
The stock symbol.
Type: Object
A dictionary of customizable options
interval
- Set the interval for the price changes, e.g.1m
,1d
,5d
,1mo
,1y
.range
- Set the range of dates to include in the output, value values are:1d
,5d
,1mo
,3mo
,6mo
,1y
,2y
,5y
,10y
,ytd
,max
MIT © Vu Tran