Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start a Bloomberg session

Tags:

java

bloomberg

I'm currently trying to connect to the Bloomberg API but after trying for a day still not able to get it running.

Below is sample code from the API Guide, the part where I keep getting "Could not start session." when trying to connect.

public static void main(String[] args) throws Exception {
    SessionOptions sessionOptions = new SessionOptions();  
    sessionOptions.setServerHost("localhost"); // default value 
    sessionOptions.setServerPort(8194); // default value
    Session session = new Session(sessionOptions);
    if (!session.start()) {
        System.out.println("Could not start session.");
        System.exit(1);
    }
    if (!session.openService("//blp/refdata")) {
        System.out.println("Could not open service " +
                           "//blp/refdata");
        System.exit(1);
    }
}

I also tried the async example available in the guide, but no luck as well.

Is there anything that I missed in order to use the API? Or if I have to apply for an account in order to use the API, please do let me know :)

like image 675
shiawuen Avatar asked Apr 17 '12 05:04

shiawuen


People also ask

How do I connect to Bloomberg?

From the Windows Start menu, select START > All Programs > Bloomberg > BLOOMBERG. Once you open the application, the following Bloomberg panel (“window”) appears on your desktop. Once you open the Bloomberg Terminal application, you must log in with a login name and password. Click on one of the Bloomberg panels.

Is Bloomberg Open API free?

Bloomberg API MASTER RECORDThe established service provides free, unrestricted access to raw data for customers for its financial market information. The same publish/subscribe and request/response interactions available via its proprietary interface can be accessed via API.

Does Bloomberg have a REST API?

Bloomberg Industry Leaderboard Uses REST API for Financial Data Visualization; Imagine What You Could be Doing with Your Data Assets.


1 Answers

Your program runs fine on my machine. The few things you should check:

  • Are you on a Bloomberg terminal machine? (I assume you are using the desktop version)
  • Do you have a Bloomberg session open?
  • Is the bbcom.exe process running?

Just read the last line of your question: you need to have a Bloomberg account to be able to use their API and retrieve data.

like image 139
assylias Avatar answered Oct 15 '22 00:10

assylias