Connect R to Bloomberg with the RBlpapi package

June 15, 2015

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

For anyone who works with financial data and has access to a Bloomberg terminal, there is a new R package to interface to Bloomberg data services: RBlpapi. (If you had searched for an R connection to Bloomberg you wouldn’t have found this one — Bloomberg is happy to have software that connects to its public API, but not to use its name, apparently.)

One of the authors, Dirk Eddelbuettel, gave a presentation at at the R/Finance conference last month (you can take a look at the slides here). Here are a few examples of the types of queries you can perform, which generate time series data objects in R:

bdp(c("ESA Index", "SPY US Equity"), c("PX_LAST", "VOLUME"))
bdh("SPY US Equity", c("PX_LAST", "VOLUME"),
getBars("ESA Index", startTime=ISOdatetime(2015,1,1,0,0,0))
getTicks("ESA Index", "TRADE", Sys.time()-60*60))

The package is fast and lightweight (no Java required), and works well on Linux-based systems. Dirk reports that it's currently tricky to build on Windows, though: suggestions welcome in the comments or via the Github project linked below.

Github: RBlpapi, R Access to Bloomberg API

To leave a comment for the author, please follow the link and comment on their blog: Revolutions. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)