SlideShare uma empresa Scribd logo
1 de 16
Bloomberg API
POINT PERFECT TECHNOLOGY SOLUTIONS
WWW.PPTSSOLUTIONS.COM
Overview of the Bloomberg API
 The Bloomberg API provides developers with 24x7 programmatic access to data
from the Bloomberg Data Centre for use in customer applications.
 The established service provides free, unrestricted access to raw data for customers
for its financial market information.
 The Bloomberg API lets you integrate streaming real-time and delayed data,
reference data, historical data, intraday data, and Bloomberg derived data into
your own custom and third-party applications.
What kind of data?
 Infrastructure for high-performance worldwide delivery of arbitrary structured data
from multiple distributed sources
 Many different services, with "market data" most heavily used
 Prices, trades, volumes, etc. delivered directly from exchanges
 Real-time subscriptions to live data
 Query interface to database of historical data
Features of the Bloomberg API
 Interfaces in C, C++, Java, .NET, Perl, and Python
 Linux, Windows, Solaris, Mac OS X
 Full set of example applications—easy starting point
http://openbloomberg.com/open-api/
 Lightweight Interfaces
 32- and 64-bit Programming Support
 Pure Java Implementation: The Java API is implemented entirely in Java. Bloomberg
did not use JNI to wrap either our existing C library or the new C++ library.
Real-time prices in Python
session = blpapi.Session()
session.start()
subscriptions = blpapi.SubscriptionList()
subscriptions.add("IBM US Equity", "LAST_PRICE,BID,ASK", "", blpapi::CorrelationId(1))
session.subscribe(subscriptions)
while (True):
event = session.nextEvent()
for msg in event:
print("IBM: ", msg)
Application Structure
 The Bloomberg API object model contains a small number of key objects which
applications use to request, receive and interpret data.
 Session: An application creates a Session object to manage its connection with the
Bloomberg infrastructure.
 Service: Using the Session object, an application creates a Service object and then
‘opens’ each Bloomberg service that it will use.
 Request: The client can make individual requests for data.
 Subscription: the client can start a subscription with the service for on-going data
updates.
 Event: Programmatically, the customer application obtains Event objects for the
Session and then extracts from those Event objects one or more Message objects
containing the Bloomberg data.
Bloomberg API - Two Paradigms
Using the Request/Response
Paradigm - 1
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);
}
Using the Request/Response
Paradigm - 2
CorrelationID requestID = new CorrelationID(1);
Service refDataSvc = session.getService("//blp/refdata");
Request request =
refDataSvc.createRequest("ReferenceDataRequest");
request.append("securities", "IBM US Equity");
request.append("fields", "PX_LAST");
session.sendRequest(request, requestID);
boolean continueToLoop = true;
Using the Request/Response
Paradigm - 3
while (continueToLoop) {
Event event = session.nextEvent();
switch (event.eventType().intValue()) {
case Event.EventType.Constants.RESPONSE: // final event
continueToLoop = false; // fall through
case Event.EventType.Constants.PARTIAL_RESPONSE:
handleResponseEvent(event);
break;
default:
handleOtherEvent(event);
break;
}
}
}
Services
Core: Reference Data Service "//blp/refdata"
Market Data Service "//blp/mktdata"
Additional: Custom VWAP Service "//blp/mktvwap"
Market Bar Subscription Service "//blp/mktbar"
API Field Information Service "//blp/apiflds"
Page Data Service "//blp/pagedata"
Technical Analysis Service "//blp/tasvc"
API Authorization "//blp/apiauth"
Authorization and Permissioning
Systems
 Authentication: Who is the consumer?
 Authorization: What data is the consumer entitled to see?
Publishing
 The Bloomberg API allows customer applications to publish data as well as consume
it. Customer data can be published for distribution within the customer’s enterprise,
contributed to the Bloomberg infrastructure, distributed to others, or used for
warehousing.
 Publishing applications might simply broadcast data or they can be “interactive”,
responding to feedback from the infrastructure about the currently active
subscriptions from data consumers.
Simple Broadcast
 Creating a session.
 Obtaining authorization.
 Creating the topic.
 Publishing events for the topic to the designated service.
Interactive Publication
 Creating a session.
 Obtaining authorization.
 Registering for subscription start and stop messages.
 Handling subscription start and stop events, which add and remove topics to the
active publication set.
 Creating a topic.
 Publishing events for the active topics of the designated service.
Questions?

Mais conteúdo relacionado

Semelhante a Bloomberg API Open Source Development and Solution Providers India

Events, Picos, and Microservices
Events, Picos, and MicroservicesEvents, Picos, and Microservices
Events, Picos, and MicroservicesPhil Windley
 
Streaming Visualisation
Streaming VisualisationStreaming Visualisation
Streaming VisualisationGuido Schmutz
 
Understanding Business APIs through statistics
Understanding Business APIs through statisticsUnderstanding Business APIs through statistics
Understanding Business APIs through statisticsWSO2
 
Platform Events by Tim Taylor
Platform Events by Tim TaylorPlatform Events by Tim Taylor
Platform Events by Tim TaylorChristine Smith
 
What's New in the Winter '16 Release (4.2)
What's New in the Winter '16 Release (4.2)What's New in the Winter '16 Release (4.2)
What's New in the Winter '16 Release (4.2)AppDynamics
 
Streaming Visualization
Streaming VisualizationStreaming Visualization
Streaming VisualizationGuido Schmutz
 
Serverless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData SeattleServerless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData SeattleJim Dowling
 
Scaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabScaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabRoman
 
Notification Service 2005
Notification Service 2005Notification Service 2005
Notification Service 2005shram2k
 
Building event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka EcosystemBuilding event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka EcosystemGuido Schmutz
 
Building Event-Driven (Micro)Services with Apache Kafka
Building Event-Driven (Micro)Services with Apache KafkaBuilding Event-Driven (Micro)Services with Apache Kafka
Building Event-Driven (Micro)Services with Apache KafkaGuido Schmutz
 
Subscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsSubscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsdbpublications
 
Picos, CloudOS, and Connecting Things
Picos, CloudOS, and Connecting ThingsPicos, CloudOS, and Connecting Things
Picos, CloudOS, and Connecting ThingsPhil Windley
 
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInventPros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInventSudhir Tonse
 
Connecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixConnecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixIBM
 
[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0camunda services GmbH
 
Microservices with Kafka Ecosystem
Microservices with Kafka EcosystemMicroservices with Kafka Ecosystem
Microservices with Kafka EcosystemGuido Schmutz
 
Streaming Visualization
Streaming VisualizationStreaming Visualization
Streaming VisualizationGuido Schmutz
 

Semelhante a Bloomberg API Open Source Development and Solution Providers India (20)

Events, Picos, and Microservices
Events, Picos, and MicroservicesEvents, Picos, and Microservices
Events, Picos, and Microservices
 
Streaming Visualisation
Streaming VisualisationStreaming Visualisation
Streaming Visualisation
 
Understanding Business APIs through statistics
Understanding Business APIs through statisticsUnderstanding Business APIs through statistics
Understanding Business APIs through statistics
 
Platform Events by Tim Taylor
Platform Events by Tim TaylorPlatform Events by Tim Taylor
Platform Events by Tim Taylor
 
What's New in the Winter '16 Release (4.2)
What's New in the Winter '16 Release (4.2)What's New in the Winter '16 Release (4.2)
What's New in the Winter '16 Release (4.2)
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Streaming Visualization
Streaming VisualizationStreaming Visualization
Streaming Visualization
 
Serverless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData SeattleServerless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData Seattle
 
Scaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabScaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at Grab
 
Notification Service 2005
Notification Service 2005Notification Service 2005
Notification Service 2005
 
Building event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka EcosystemBuilding event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka Ecosystem
 
Building Event-Driven (Micro)Services with Apache Kafka
Building Event-Driven (Micro)Services with Apache KafkaBuilding Event-Driven (Micro)Services with Apache Kafka
Building Event-Driven (Micro)Services with Apache Kafka
 
Subscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsSubscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robots
 
Async
AsyncAsync
Async
 
Picos, CloudOS, and Connecting Things
Picos, CloudOS, and Connecting ThingsPicos, CloudOS, and Connecting Things
Picos, CloudOS, and Connecting Things
 
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInventPros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
 
Connecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixConnecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in Bluemix
 
[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0
 
Microservices with Kafka Ecosystem
Microservices with Kafka EcosystemMicroservices with Kafka Ecosystem
Microservices with Kafka Ecosystem
 
Streaming Visualization
Streaming VisualizationStreaming Visualization
Streaming Visualization
 

Mais de Point Perfect Technology Solutions (7)

Importance of goal
Importance of goalImportance of goal
Importance of goal
 
CRM solution provider India
CRM solution provider IndiaCRM solution provider India
CRM solution provider India
 
Android app development India
Android app development IndiaAndroid app development India
Android app development India
 
Simple Marketing Tips for Small Business
Simple Marketing Tips for Small BusinessSimple Marketing Tips for Small Business
Simple Marketing Tips for Small Business
 
How to boost your creativity
How to boost your creativityHow to boost your creativity
How to boost your creativity
 
SEO / Internet Marketing Process Tips
SEO / Internet Marketing Process TipsSEO / Internet Marketing Process Tips
SEO / Internet Marketing Process Tips
 
Branding-SEO, SMO, SEM, Internet Marketing
Branding-SEO, SMO, SEM, Internet MarketingBranding-SEO, SMO, SEM, Internet Marketing
Branding-SEO, SMO, SEM, Internet Marketing
 

Último

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Bloomberg API Open Source Development and Solution Providers India

  • 1. Bloomberg API POINT PERFECT TECHNOLOGY SOLUTIONS WWW.PPTSSOLUTIONS.COM
  • 2. Overview of the Bloomberg API  The Bloomberg API provides developers with 24x7 programmatic access to data from the Bloomberg Data Centre for use in customer applications.  The established service provides free, unrestricted access to raw data for customers for its financial market information.  The Bloomberg API lets you integrate streaming real-time and delayed data, reference data, historical data, intraday data, and Bloomberg derived data into your own custom and third-party applications.
  • 3. What kind of data?  Infrastructure for high-performance worldwide delivery of arbitrary structured data from multiple distributed sources  Many different services, with "market data" most heavily used  Prices, trades, volumes, etc. delivered directly from exchanges  Real-time subscriptions to live data  Query interface to database of historical data
  • 4. Features of the Bloomberg API  Interfaces in C, C++, Java, .NET, Perl, and Python  Linux, Windows, Solaris, Mac OS X  Full set of example applications—easy starting point http://openbloomberg.com/open-api/  Lightweight Interfaces  32- and 64-bit Programming Support  Pure Java Implementation: The Java API is implemented entirely in Java. Bloomberg did not use JNI to wrap either our existing C library or the new C++ library.
  • 5. Real-time prices in Python session = blpapi.Session() session.start() subscriptions = blpapi.SubscriptionList() subscriptions.add("IBM US Equity", "LAST_PRICE,BID,ASK", "", blpapi::CorrelationId(1)) session.subscribe(subscriptions) while (True): event = session.nextEvent() for msg in event: print("IBM: ", msg)
  • 6. Application Structure  The Bloomberg API object model contains a small number of key objects which applications use to request, receive and interpret data.  Session: An application creates a Session object to manage its connection with the Bloomberg infrastructure.  Service: Using the Session object, an application creates a Service object and then ‘opens’ each Bloomberg service that it will use.  Request: The client can make individual requests for data.  Subscription: the client can start a subscription with the service for on-going data updates.  Event: Programmatically, the customer application obtains Event objects for the Session and then extracts from those Event objects one or more Message objects containing the Bloomberg data.
  • 7. Bloomberg API - Two Paradigms
  • 8. Using the Request/Response Paradigm - 1 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); }
  • 9. Using the Request/Response Paradigm - 2 CorrelationID requestID = new CorrelationID(1); Service refDataSvc = session.getService("//blp/refdata"); Request request = refDataSvc.createRequest("ReferenceDataRequest"); request.append("securities", "IBM US Equity"); request.append("fields", "PX_LAST"); session.sendRequest(request, requestID); boolean continueToLoop = true;
  • 10. Using the Request/Response Paradigm - 3 while (continueToLoop) { Event event = session.nextEvent(); switch (event.eventType().intValue()) { case Event.EventType.Constants.RESPONSE: // final event continueToLoop = false; // fall through case Event.EventType.Constants.PARTIAL_RESPONSE: handleResponseEvent(event); break; default: handleOtherEvent(event); break; } } }
  • 11. Services Core: Reference Data Service "//blp/refdata" Market Data Service "//blp/mktdata" Additional: Custom VWAP Service "//blp/mktvwap" Market Bar Subscription Service "//blp/mktbar" API Field Information Service "//blp/apiflds" Page Data Service "//blp/pagedata" Technical Analysis Service "//blp/tasvc" API Authorization "//blp/apiauth"
  • 12. Authorization and Permissioning Systems  Authentication: Who is the consumer?  Authorization: What data is the consumer entitled to see?
  • 13. Publishing  The Bloomberg API allows customer applications to publish data as well as consume it. Customer data can be published for distribution within the customer’s enterprise, contributed to the Bloomberg infrastructure, distributed to others, or used for warehousing.  Publishing applications might simply broadcast data or they can be “interactive”, responding to feedback from the infrastructure about the currently active subscriptions from data consumers.
  • 14. Simple Broadcast  Creating a session.  Obtaining authorization.  Creating the topic.  Publishing events for the topic to the designated service.
  • 15. Interactive Publication  Creating a session.  Obtaining authorization.  Registering for subscription start and stop messages.  Handling subscription start and stop events, which add and remove topics to the active publication set.  Creating a topic.  Publishing events for the active topics of the designated service.