Skip to content

jkon/barchart-market-data-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Barchart OnDemand Market Data API Client

Barchart offers free Market data API on barchart.com/ondemand/free-market-data-api, to use the API you need an API key which is provided singing up on theirs website.

Barchart also offers a larger catalog of paid for APIs which you need an API key for that has been granted such access. This library currently only supports the free APIs, but I plan to eventually add support for some more of the paid ones as well.

This client offers access to free methods getQuote and getHistory.

This repo was forked from yagop/barchart-market-data-api and updated to es6

Example

const MarketData = require('barchart-market-data-api');

const 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);
});

MarketData(apiKey)

Creates a new client.

Kind: global function

Param Type Description
apiKey String API key provided by Barchart

marketData.getHistory(symbol, [type], [options]) ⇒ Promise

The getHistory API is used to request historical time series data on stocks, indices, mutual funds, ETFs, futures, indices or forex pairs. Historical data is available as tick, minute or end-of-day data.

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

marketData.getQuote(symbols, [fields], [mode])

The getQuote API is used to request price data, either real-time, delayed or end-of-day, by symbol. In addition to Last Price or Settlement, other fields such as Open, High, Low, Close, Bid, Ask, 52-week high and low, and more are available.

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")

About

Barchart OnDemand Market Data API Client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%