Barchart OnDemand features a diverse set of market data and information APIs. Pricing is based on the number of monthly queries and fields requested. They offer four packages: Small, Medium, Large, Enterprise.
Barchart.com have available a free API to retrieve quotes and historical data and they have a diverse premium set of market data and information APIs. See Barchart OnDemand
RBarchart package v0.2.1 implements getQuote, getHistory, getSymbolLookUp, getQuoteEod, getClosePrice, getFuturesExpirations, getFuturesSpecifications methods from Barchart API.
If you install from devtools you do not need to do anything else.
devtools::install_github("mariope/RBarchart")
library(RBarchart)
setAPIkey('<Your API key>', premium = FALSE)
When you load the library, you obtain three functions:
setAPIkey to set the Barchart API key and define if it is premium API.
GetHistory The getHistory API is used to request historical time series data on stocks, indexes, mutual funds, ETFs, futures, foreign exchange, or cryptocurrencies. Historical data is available as tick, minute bars or end-of-day data.
getSymbolLookUp The getSymbolLookUp API provides a list of all instruments based on the keyword being passed.
getQuote The getQuote API is used to request price data, either real-time, delayed or end-of-day, by symbol on stocks, indexes, mutual funds, ETFs, futures, foreign exchange, or cryptocurrencies.
getQuoteEod The getQuoteEod API is used to request end-of-day price data, by combined exchange and symbol, on stocks, indexes, mutual funds, ETFs, futures, foreign exchange, or cryptocurrencies. Historical data is available as tick, minute bars or end-of-day data.
getClosePrice The getClosePrice API provides the close price for given instruments for the given date.
getFuturesExpirations The getFuturesExpiration API from Barchart OnDemand provides first notice and last trade dates for futures contracts.
getFuturesSpecifications Barchart OnDemand's getFuturesSpecifications API provides contract information such as trading hours, contract size and tick size for futures contracts.
library(RBarchart)
The functions available are:
Set the API key and define if it is premium.
> setAPIkey('<Your API key>', premium = FALSE)
In order to get an API key, please, visit Barchart Ondemand
The getHistory API is used to request historical time series data on stocks, indexes, mutual funds, ETFs, futures, foreign exchange, or cryptocurrencies. Historical data is available as tick, minute bars or end-of-day data.
> getHistory(symbol = 'ESM19', type = 'dailyContinue')
The getSymbolLookUp API provides a list of all instruments based on the keyword being passed.
> getSymbolLookUp('Gold', limit = 100, exchanges = 'COMEX')
The getQuote API is used to request price data, either real-time, delayed or end-of-day, by symbol on stocks, indexes, mutual funds, ETFs, futures, foreign exchange, or cryptocurrencies.
> getQuote(symbols = 'ESM19')
> getQuote(symbols = 'NGM19,ESM19', fields = 'openInterest')
The getQuoteEod API is used to request end-of-day price data, by combined exchange and symbol, on stocks, indexes, mutual funds, ETFs, futures, foreign exchange, or cryptocurrencies. Historical data is available as tick, minute bars or end-of-day data.
The getClosePrice API provides the close price for given instruments for the given date.
The getFuturesExpiration API from Barchart OnDemand provides first notice and last trade dates for futures contracts.
Barchart OnDemand's getFuturesSpecifications API provides contract information such as trading hours, contract size and tick size for futures contracts.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
I use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the GPL-3 License - see the LICENSE file for details
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.