How to pull bond data from GOVSRCH using Codebook?
Hi, I would like to pull bond data from the GOVSRCH universe.
I have used the Codebook tutorial to pull Enterprise Value data from 3 universes as below:
df = rd.get_data(universe=['LSEG.L', 'VOD.L', 'GOOGL'], fields=['TR.EV','TR.EVToSales'])
From the filters, it seems that GOVSRCH like it is a universe on it's own.
So when attempting to pull a specific bond's data, for example GOOGL, I have tried searching with the Preferred RIC:
df = rd.get_data( universe = 'GOVSRCH', fields = ['02079KAB3='], parameters = ['ISIN']
This results in the following error:
Failure sending request with <refinitiv.data.content.fundamental_and_reference.Definition object at 0x7f57140dd340 {universe='['GOVSRCH']', fields='['TR.RIC']', parameters='['Coupon']', row_headers='None'}>
Traceback (most recent call last):
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/_fin_coder_layer/get_data.py", line 67, in get_adc_data
response = definition.get_data()
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/content/fundamental_and_reference/_definition.py", line 224, in get_data
response = super().get_data(session, on_response_filter)
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/content/_content_provider_layer.py", line 45, in get_data
return super().get_data(session, on_response)
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/delivery/_data/_data_provider_layer.py", line 106, in get_data
response = self._provider.get_data(
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/delivery/_data/_data_provider.py", line 74, in get_data
request = self.request.create(session, *args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/content/fundamental_and_reference/_data_provider.py", line 171, in create
body_parameters = self.get_body_parameters(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/content/fundamental_and_reference/_data_provider.py", line 194, in get_body_parameters
kwargs = validate_correct_format_parameters(*_, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/refinitiv/data/content/fundamental_and_reference/_data_provider.py", line 113, in validate_correct_format_parameters
raise ValueError(f"Arg parameters must be a dictionary")
ValueError: Arg parameters must be a dictionary
I also get a similar error when searching via the ISIN
How do I pull bond data using Codebook? Any assistance is greatly appreciated, thank you in advance.
Best Answer
-
Hi @oscar.guitet ,
Thank you for your question. You can't use GOVSRCH as universe in your request unfortunately.
Is all the fields you are after exist in your GOVSRCH output? If so, the best way I could think of is using Export query functionality of the Workspace:
Then a new window appears and clicking on the Codebook field you will get a python query with search capabilities which will allow you returning the same values you see in GOVSRCH via an API call:
In case you want other fields not available in GOVSRCH or you want time series data, we can retrieve the rics via search query and can request the fields/series via rd.get_data/rd.get_history function. Happy to help you on that if necessary.
Hope this was helpful. Please feel free to let me know should you have any further question.
Best regards,
Haykaz
2
Answers
-
Thank you very much for your response!
A follow-up if you don't mind:
Is there a way of searching the GOVSRCH environment for specific ISINs? I have an example export query below for ISIN US45766X2053. Is this a limitation of the license I am using? Thank you in advance.df =rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 100,
filter = "((DbType eq 'GOVT' or DbType eq 'CORP' or DbType eq 'AGNC' or DbType eq 'OMUN' or DbType eq 'OTHR') and IsActive eq true and (ISIN eq 'US45766X2053'))",
select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,InstrumentTypeDescription,RCSCouponTypeGenealogy,FaceIssuedUSD,RCSBondGradeLeaf"
)
0 -
You provided an example query that looks correct. For example, this is the result when I applied your request:
It's unclear what limitation you ran into? Are you suggesting there is a limitation of not being able to specify the ISIN within the GOVSRCH app within the desktop? You can specify the ISIN.
Or did you not get a result when you tried to execute your code segment?
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛