Bloomberg API

Bloomberg API

Version 3.x Developer's Guide

June 30, 2014 Version 2.54

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The copyright notice below and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

BLOOMBERG is a registered trademark of Bloomberg Finance L.P. or its affiliates.

All other trademarks and registered trademarks are the property of their respective owners.

Table of Contents

Preface: About this Document .................................................................................................. 9 Purpose................................................................................................................................... 9 Audience ................................................................................................................................. 9 Document History ................................................................................................................... 9 Customer Support Information .............................................................................................. 10

1 Introduction to the Bloomberg API ..................................................................................... 12 1.1 Overview of the Bloomberg API ..................................................................................... 12 1.1.1 Features ................................................................................................................ 13 1.1.2 The Bloomberg Platform ....................................................................................... 15 1.1.3 B-PIPE .................................................................................................................. 16 1.1.4 The Desktop API and Server API.......................................................................... 17 1.2 APITypical Application Structure................................................................................... 20 1.3 Overview of this Guide ................................................................................................... 21

2 Sample Programs in Two Paradigms.................................................................................. 22 2.1 Overview ........................................................................................................................ 22 2.2 The Two Paradigms ....................................................................................................... 23 2.2.1 Request/Response................................................................................................ 23 2.2.2 Subscription .......................................................................................................... 24 2.3 Using the Request/Response Paradigm ........................................................................ 24 2.4 Using the Subscription Paradigm................................................................................... 28

3 Sessions and Services ......................................................................................................... 31 3.1 Sessions ........................................................................................................................ 31 3.2 Services ......................................................................................................................... 31 3.3 Event Handling.............................................................................................................. 31 3.3.1 Synchronous Event Handling................................................................................ 33 3.3.2 Asynchronous Event Handling .............................................................................. 34 3.4 Multiple Sessions ........................................................................................................... 38

4 Requests and Responses .................................................................................................... 39 4.1 The Programming Example ........................................................................................... 39 4.2 Elements ........................................................................................................................ 40 4.3 Request Details.............................................................................................................. 40 4.4 Response Details ........................................................................................................... 42

5 Subscriptions ........................................................................................................................ 47 5.1 Starting a Subscription ................................................................................................... 47

Table of Contents

2

5.2 Receiving Data from a Subscription .............................................................................. 49 5.3 Modifying an Existing Subscription ................................................................................ 50 5.4 Stopping a Subscription................................................................................................. 51 5.5 Overlapping Subscriptions............................................................................................. 51 5.6 Conflation and the Interval Option ................................................................................. 52 5.7 Delayed Data ................................................................................................................. 52 5.8 Subscription Life Cycle .................................................................................................. 52 6 Authorization and Permissioning Systems........................................................................ 54 6.1 Overview........................................................................................................................ 54 6.2 Underlying Concepts ..................................................................................................... 54

6.2.1 EIDs ...................................................................................................................... 54 6.2.2 Requirement for the Terminal ............................................................................... 54 6.2.3 The //blp/apiauth service....................................................................................... 55 6.2.4 The V3 Identity Object .......................................................................................... 55 6.2.5 V3 Permissioning Models ..................................................................................... 55 6.2.6 Authorization Lifetime ........................................................................................... 55 6.3 Server API Authorization ............................................................................................... 56 6.3.1 Authorization by IP Address.................................................................................. 56 6.4 B-PIPE Authorization ..................................................................................................... 62 6.4.1 Authentication ....................................................................................................... 63 6.4.2 Token Generation ................................................................................................. 65 6.4.3 Identity Object ....................................................................................................... 67 6.5 Authorization.................................................................................................................. 67 6.6 Permissioning ................................................................................................................ 69 6.6.1 Entitlements .......................................................................................................... 69 6.6.2 User Mode ............................................................................................................ 72 6.6.3 Content Based ...................................................................................................... 72 6.7 Specific Application Types (B-PIPE only) ...................................................................... 74 6.7.1 Single-User ........................................................................................................... 74 6.7.2 Multi-User.............................................................................................................. 74 6.7.3 Derived Data / Non-Display .................................................................................. 74 6.8 V2 Authorization and Permissioning Models ................................................................. 74 6.8.1 User Mode ............................................................................................................ 74 6.8.2 All-or-None............................................................................................................ 75 6.8.3 Content-Based / Per-Product / Per-Security ......................................................... 75 6.8.4 Validating Logon Status ........................................................................................ 76

Table of Contents

3

7 Core Services........................................................................................................................ 77 7.1 Common Concepts ........................................................................................................ 77 7.1.1 Security/Securities ................................................................................................ 77 7.1.2 Pricing Source....................................................................................................... 78 7.1.3 Fields .................................................................................................................... 79 7.1.4 Overrides .............................................................................................................. 79 7.1.5 Relative Dates....................................................................................................... 80 7.2 Reference Data Service................................................................................................. 81 7.2.1 Reference Data Request and Response Overview .............................................. 82 7.2.2 Historical Data Request ........................................................................................ 83 7.2.3 Intraday Tick Request ........................................................................................... 84 7.2.4 Intraday Bar Services............................................................................................ 85 7.2.5 Portfolio Data Request.......................................................................................... 86 7.2.6 BEQS Request...................................................................................................... 86 7.3 Market Data Service ...................................................................................................... 87 7.4 Custom VWAP Service.................................................................................................. 88 7.5 Market Bar Subscription Service ................................................................................... 88 7.6 API Field Information Service ........................................................................................ 90 7.6.1 Field Information Request..................................................................................... 90 7.6.2 Field Search Request ........................................................................................... 91 7.6.3 Categorized Field Search Request ....................................................................... 91 7.7 Page Data Service......................................................................................................... 93 7.8 Technical Analysis Service ............................................................................................ 96 7.8.1 Historical End of Day study request...................................................................... 96 7.8.2 Intraday bar study request .................................................................................... 98 7.8.3 Real time study request ...................................................................................... 100 7.9 API Authorization ......................................................................................................... 101 7.10 Instruments Service ................................................................................................... 101 7.10.1 Security Lookup Request.................................................................................. 101 7.10.2 Curve Lookup Request ..................................................................................... 102 7.10.3 Government Lookup Request ........................................................................... 102 7.10.4 Response Behaviors......................................................................................... 103 7.10.5 Code Example .................................................................................................. 105

8 Publishing ........................................................................................................................... 106 8.1 Overview...................................................................................................................... 106 8.2 The Programming Examples ....................................................................................... 106

Table of Contents

4

8.3 Simple Broadcast......................................................................................................... 106 8.3.1 Creating a Session.............................................................................................. 106 8.3.2 Authorization ....................................................................................................... 107 8.3.3 Creating a Topic.................................................................................................. 109 8.3.4 Publishing ........................................................................................................... 110

8.4 Interactive Publication.................................................................................................. 111 8.4.1 Registration......................................................................................................... 112 8.4.2 Event Handling.................................................................................................... 113 8.4.3 Publication .......................................................................................................... 115

9 B-Pipe ................................................................................................................................ 117 9.1 Overview...................................................................................................................... 117 9.2 B-Pipe Services ........................................................................................................... 117 9.2.1 Market Depth Service ......................................................................................... 117 9.2.2 Market List Service ............................................................................................. 138 9.2.3 Source Reference Service .................................................................................. 154

A Schemas ............................................................................................................................. 162 A.1 Overview ..................................................................................................................... 162 A.2 Reference Data Service //blp/refdata .......................................................................... 162 A.2.1 Operations .......................................................................................................... 162 A.2.2 ReferenceDataRequest: Sequence.................................................................... 162 A.2.3 ReferenceDataResponse: Choice ...................................................................... 164 A.2.4 HistoricalDataRequest: Sequence...................................................................... 165 A.2.5 HistoricalDataResponse: Choice........................................................................ 170 A.2.6 IntradayTickRequest: Sequence ................................................................ 171 A.2.7 IntradayTickResponse: Choice........................................................................... 173 A.2.8 IntradayBarRequest: Sequence ......................................................................... 175 A.2.9 IntradayBarResponse: Choice............................................................................ 177 A.2.10 PortfolioDataRequest: Sequence ..................................................................... 178 A.2.11 PortfolioDataResponse: Choice ....................................................................... 179 A.2.12 BEQSRequest: Sequence ................................................................................ 180 A.2.13 BEQSResponse: Choice .................................................................................. 181 A.2.14 Reference Data Service Response .................................................................. 182 A.3 Schema for API Field Service //blp//apiflds ................................................................. 185 A.3.1 Requests: Choice ............................................................................................... 185 A.3.2 Responses: Choice ............................................................................................ 185 A.3.3 Field Information Request .................................................................................. 185

Table of Contents

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download