'Why can't Bloomberg Api (blp) catch the data by correct field id?
I want to use python to catch the "ESG disclosure score " data in Bloomberg. It is my sample code :
from xbbg import blp
#1
blp.bdp(tickers='AAPL US Equity', flds=['Security_Name', 'GICS_Sector_Name','PX_last', 'HISTORICAL_MARKET_CAP'])
#2
blp.bdh(
...: tickers='AAPL US Equity', flds=['Security_Name','HISTORICAL_MARKET_CAP','ESG_DISCLOSURE_SCORE'],
...: start_date='2010-1-1', end_date='2020-12-31',
...: )
First code can be executed correctly. The output is like this:

But the second one is wrong, like this:

The columns of "ESG disclosure score" disappear! It seems like it can't catch the data from Bloomberg. I make sure the flds for ESG disclosure score is correct!
Cany somebody help me or suggest me for solving this ?problem ?
Thank you!
Solution 1:[1]
The Bloomi Terminal FLDS function should be the first port of call for any questions about the fields that might be available, their format, and any possible overrides. In a Terminal window, type:
AAPL US <Equity Yellow Key> FLDS <Go>
Where it says "Enter Query" type ESG_DISCLOSURE_SCORE and hit 'Go'. If you click on the returned match, you get this screen:

If you scroll down the text, you see:
API:
current value available, historical values available
So this field does, in general, provide history via bdh and bdp. The API (sometimes called DAPI by Bloomberg) is usually what Excel, xbbg, or client-based code is using to get data from Bloomberg. If you can't see the data in this screen, you can't get it via xbbg.
BUT, look at the current value for ESG_DISCLOSURE_SCORE for this security: it is N.A. That means that while the field exists, it has not been populated for AAPL. The text description of the field gives more information.
A feature of xbbg is that if a historical field has no data then it is not included in the returned dataframe of bdh at all (not even as a column of nan). That is why your dataframe does not have a 'ESG_DISCLOSURE_SCORE' column.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
