0

I am trying to use bloomberg API with python. I can make calls to the API when I am on windows with bloomberg terminal running. However, I would like to access the api from a mac/linux machine. I installed the API on my mac using the steps highlighted here:

How to install Bloomberg API Library for Python 2.7 on Mac OS X

Then I setup windows as on a virtual machine with virtualbox and used bridged connection so I can ping to the guest and launched bloomberg terminal However I still cant access bloomberg api

ERROR blpapi_platformtransporttcp.cpp:671 blpapi.session.transporttcp.{2}.<my-guest-ip-address:8194> Connection failed

has anyone done this?

Ajit
  • 667
  • 2
  • 14
  • 27
  • If you are using the Desktop API (you probably are), I believe you can only connect to localhost. One option you could try is to install a SSH server on the windows VM, connect to it from the host machine and open a tunnel that forwards port 8194. I haven't tried it though, so not sure if that will work. – assylias Apr 18 '18 at 09:10
  • Thanks for the comment. I will try it. However, it says here , https://www.bloomberg.com/professional/support/api-library/ that mac and linux apis are only compatible with "Bloomberg Server API and B-Pipe data feed products". I am not entirely sure what those are – Ajit Apr 18 '18 at 09:18
  • The server API needs a server to get the data - if you don't know what it is then you probably can't use it. Not sure if that warning means that you can't run the terminal on Mac/Linux or that the desktop API won't work. – assylias Apr 18 '18 at 10:32
  • No I meant, I am not sure what's the difference between bloomberg server API and bloomberg Desktop API is – Ajit Apr 18 '18 at 13:17

2 Answers2

3

There is a way but it's not easy. You do need to run the terminal/bbcomm in windows, but connect to it from Linux via port forward. I ran it in VM(VBox) inside Linux but it can probably be done on a separate physical PC. The gory details are here.

novitk
  • 31
  • 2
  • I've been wondering if this allowed by the Bloomberg licenses. As long as no data is stored on disk. Do you know any official Bloomberg references online that states that this is allowed? – Nordlöw Mar 19 '21 at 16:47
2

DesktopApi does not support your particular use case and should not be used in such way. You may consider ServerApi or B-Pipe solution for that purpose.

Bloomberg DesktopApi (DAPI) is meant to run on desktop of Bloomberg Terminal user, it connects to the local process bbcomm.exe at port 127.0.0.1 (localhost) and port 8194. On the other hand, ServerApi can connect to a remote host running ServerApi process, it's provided for Server applications for retrieving and disseminating data to Terminal users after performing entitlement checks. ServerApi and B-Pipe require implementing additional coding for Authentication and Authorization.

You can download the ServerApi and/or B-Pipe from WAPI -> API Download Center.

Mourad Barakat
  • 661
  • 3
  • 6