API & Usage
getQuote( )
You can get a single stock quote using
getQuote()
:
var markitondemand = require('markitondemand');
markitondemand.getQuote('AAPL')
.then(data => console.log(data))
.catch(error => {
console.error(error.message);
});
getQuotes()
Want to lookup multiple stock symbols? Use
getQuotes()
:
var markitondemand = require('markitondemand');
markitondemand.getQuotes(['AAPL', 'GOOGL'])
.then(data => console.log(data))
.catch(error => {
console.error(error.message);
});
getQuotesObject()
Get multiple stock quotes back in a keyed object using
getQuotesObject()
:
var markitondemand = require('markitondemand');
markitondemand.getQuotesObject(['GOOG', 'AAPL', 'TSLA', 'NVDA'])
.then(data => console.log(data))
.catch(error => {
console.error(error.message);
});
getStock()
You can use either
getStock()
or
lookup()
to lookup symbols:
var markitondemand = require('markitondemand');
markitondemand.getStock('AAPL')
.then(data => console.log(data))
.catch(error => {
console.error(error.message);
});