BLOOMBERG OPEN API – CORE DEVELOPER GUIDE
©2016 BLOOMBERG L.P. ALL RIGHTS RESERVED 13
2.3. BUILDING A SUBSCRIPTION
Several typical subscription parts have default values:
• Service Name (e.g., “//blp/mktdata”): If the service name is not specified, the defaultSubscriptionService of the
SessionOptions object is used, which is “//blp/mktdata”.
• Topic: In the case of “//blp/mktdata,” the topic value consists of an optional topic prefix followed by an instrument
identifier. For example, “/cusip/097023105” and “/sedol1/2108601” include the topic prefix, whereas “IBM US
Equity” omits the topic prefix. If the topic prefix is not specified, the defaultTopicPrefix of the SessionOptions object is
used, which is “/ticker” by default. Therefore, if using a ticker, such as IBM, the security string would be “IBM US
Equity,” with the “/ticker” topic prefix is implied. Note: The topic’s form may be different for different subscription
services.
• Fields: API fields define the type of data to retrieve for the specified topic. These are required, comma-delimited and
are prefixed with a question mark immediately following the topic. Make sure that the fields being used are real-time
fields, indicated by white text on {FLDS <GO>} on the Bloomberg Professional® service. Otherwise, an invalid field
error within the response for that security’s subscription will be returned.
• Options: These are optional qualifiers that can affect the content delivered. Examples for
“//blp/mktdata” include specifying an interval for conflated data (i.e., interval=n, where n is measured in seconds) or
indicating receipt of delayed data, which is accomplished via the “delayed” option. They are prefixed by an ampersand
(&). If using the “//blp/mktvwap” service, specify one or more override field/value pairings. If using the Desktop API,
the “useGMT” option can be used—that will ensure that all time data being returned is converted to GMT/UTC. This
option is available only for the Desktop API because the streaming data is initially being adjusted based on the
Bloomberg Professional service’s {TZDF <GO>} settings. All other products will default to receiving time-specific
streaming data in GMT/UTC (unadjusted).
• Correlation ID (optional): Data for each subscription is tagged with a correlation ID, represented as a CorrelationID
object, that must be unique to the session. The customer application can specify that value when the subscription is
created. If the customer application does not specify a correlation ID, the Bloomberg infrastructure will supply a
suitable value. In practice, the internally generated correlation ID is rarely used. Most customer applications assign
meaningful correlation IDs that allow the mapping of incoming data to the originating request or subscription.
2.4. EXAMPLE OF BUILDING A SUBSCRIPTION
The Bloomberg API provides class methods that accept the subscription specification as a single string as well as
methods wherein the different elements of the subscription are specified as separate parameters. Subscriptions are
typically manipulated in groups so Bloomberg provides methods that operate on a list of subscriptions. To start with some
sample subscription strings:
“//blp/mktdata/cusip/097023105?fields=LAST_PRICE,LAST_TRADE_ACTUAL”: Represents a subscription
using the market data service for an instrument (Boeing Co.) specified by CUSIP where any changes to the fields
LAST_PRICE or LAST_TRADE_ACTUAL from the Bloomberg data model should generate an update.
“IBM US Equity?fields=BID,ASK&interval=2”: Represents a subscription using the market data service to an
instrument (IBM) specified by a Bloomberg Ticker where any changes to the fields BID or ASK from the Bloomberg data
model should generate an update subject to conflation restriction of at least two seconds between updates. In this case,
based on the assumption that the Session has a defaultSubscriptionService of “//blp/mktdata” and a defaultTopicPrefix of
“ticker/”.
“GOOG US Equity?fields=LAST_PRICE,BID,ASK&delayed”: Represents a delayed subscription using the market
data service to an instrument (GOOG) specified by a Bloomberg Ticker where any changes to the fields LAST_PRICE,
BID or ASK from the Bloomberg data model should generate a delayed update. As in the previous example, based on the
assumption that the Session has a defaultSubscriptionService of “//blp/mktdata” and a defaultTopicPrefix of
“ticker/.”