Bloomberg API through Python or R
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Has anyone had any lucky connecting to a Bloomberg Terminal with either the R or Python tool? My org. does not allow for the utilization of some tools such as the download tool to make a connector. I also think that it would be more tedious even trying to build such a thing. But I am proficient in R and have read documentation for the API connection to the terminal using the package Rblpapi seen here.
My code:
r = getOption("repos")
r["CRAN"] = "http://cran.us.r-project.org"
options(repos = r)
install.packages("Rblpapi")
It should just be as simple as downloading the package into Alteryx, but when running the workflow I have a multitude of errors.
- R (1) Warning: unable to access index for repository http://cran.us.r-project.org/src/contrib:
- R (1) cannot open URL 'http://cran.us.r-project.org/src/contrib/PACKAGES'
- R (1) Warning: unable to access index for repository http://cran.us.r-project.org/bin/windows/contrib/3.6:
- R (1) cannot open URL 'http://cran.us.r-project.org/bin/windows/contrib/3.6/PACKAGES'
- Warning: R (1): package 'Rblpapi' is not available (for R version 3.6.3)
I'm wondering if it's not working for the same reason my org does not allow for the utilization of other tools or if it is because the base R is just not compatible with the package? If anyone has any experience connecting to Bloomberg via Python that would be extremely useful. I've read the documentation on how to install it via pip but didn't know if that was doable through Alteryx.
My end goal is to just run the workflow, have the R/Python script execute the bloomberg api functions so I can use the data later in my Alteryx workfow
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm running R 4.04 with 2021.2 and I've usually had success installing packages with the repos included in the install.packages() line... I was trying to install CallJulia a few days ago which may have crashed my Alteryx R install so it's not working for me right now - but hypothetically that usually works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I started with install.packages() by itself but as I'm sure you know how it goes, one error led me to a SO page that described the above code would work. When I run that above at least it doesn't bring up any errors- only warnings, not that it amounts to much since it's not doing what I want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
FYI - this worked for me:
install.packages("Rblpapi",repos="https://cran.r-project.org")
library(Rblpapi)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I would upgrade to 4.04 via 2021.2 if you are having problems. I removed and reinstalled R to get this to work because post Julia it wasn't letting me install anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you. It has to do with my org then, otherwise I'd be able to download such a thing. I appreciate this a lot
