google-stocks
Get stocks using Google Finance API
Install
$ npm install google-stocks --save
Usage
Callbacks
var googleStocks = require('google-stocks');
googleStocks(['AAPL'], function(error, data) {
console.log(data);
});
googleStocks(['TSE:WJA', 'NASDAQ:GOOG', 'AAPL'], function(error, data) {
console.log(data);
});
Promises
var googleStocks = require('google-stocks');
googleStocks(['AAPL'])
.then(function(data) {
})
.catch(function(error) {
});
googleStocks(['TSE:WJA', 'NASDAQ:GOOG', 'AAPL'])
.then(function(data) {
})
.catch(function(error) {
});
ES2015
import googleStocks from 'google-stocks';
googleStocks(['AAPL'])
.then(data => {
})
.catch(error => {
});
googleStocks(['TSE:WJA', 'NASDAQ:GOOG', 'AAPL'])
.then(data => {
})
.catch(error => {
});
returned format looks like this:
Example
npm run example
License
MIT license; see LICENSE.