Barchart OnDemand API servic have access to 15-minute delayed market data for BATS (US equities) and global Forex pairs, and end-of-day (including historical) market data for US equities from AMEX, NASDAQ, NYSE and futures from CBOT, CME, COMEX and NYMEX.
npm install barchart-market-data-apiBarchart offers free Market data API on freemarketdataapi.barchartondemand.com,
to use the API you need an API key which is provided singing up on theirs website.
This client offers access to free methods getQuote and getHistory.
``js
var MarketData = require('barchart-market-data-api');
var md = new MarketData(__YOUR_API_KEY__);
md.getHistory('IBM').then(function (history) {
console.log('History data:', history);
});
md.getQuote('IBM').then(function (quotes) {
console.log('Price data:', quotes);
});
``
Kind: global function
| Param | Type | Description |
| --- | --- | --- |
| apiKey | String | API key provided by Barchart |
* MarketData(apiKey)
* [.getHistory(symbol, [type], [options])](#MarketData+getHistory) ⇒ Promise
* [.getQuote(symbols, [fields], [mode])](#MarketData+getQuote)
Kind: instance method of MarketData
See: http://www.barchartondemand.com/api/getHistory
| Param | Type | Description |
| --- | --- | --- |
| symbol | String | [description] |
| [type] | String | [description] |
| [options] | Object | All additional options as key value |
Kind: instance method of MarketData
See: http://www.barchartondemand.com/api/getQuote
| Param | Type | Description |
| --- | --- | --- |
| symbols | String | A symbol or code that identifies a financial instrument. Multiple symbols separated by a comma may be used. |
| [fields] | String | The fields requested. |
| [mode] | String | Parameter to change quote type to real-time ("R"), delayed ("I") or end-of-day ("D") |