question

Upvotes
Accepted
16 1 5 6

dataplatform search for corporate bonds/cds's with filters

Hi,

can one use Python-datastream to do a Rsearch on, say, a couple of corporate bonds/cds's with filters? (e.g. Maturity Date between D1 and D2 dates, Coupon Type is AAA or BBB). If not with Python, is that possible in C++ ?

Thanks

rdp-apirefinitiv-data-platformrefinitiv-data-platform-libraries
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

13 Answers

Upvotes
Accepted
39.3k 76 11 27

Datastream does not provide criteria search service. If you have access to Eikon or Refinitiv Workspace or RDP, then you can use Search service on RDP. See the article titled "Building Search into your Application Workflow" for details and examples of using this service.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
16 1 5 6

Hi, thanks for the feedback. Where can we find the full list of search fields (things like

CouponTypeDescription, IssuerLegalName, CouponRate, MaturityDate

etc,) pls?

P.S.

If, at some point, Refinitiv could make these available to dev people, say, via intellisense, that would be great.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.3k 76 11 27

The list of search fields (or in the terminology of the Search Service on RDP the properties of the search views) is way too long for it to be practical to be exposed through IntelliSense. In addition, exposing it through IntelliSense would require an update to RDP Library every time there's any modification to the metadata for the Search service, which wouldn't be practical either. Instead, programmatic access to the metadata is provided. You can retrieve all properties available for a Search view using get_search_metadata method of RDP Library (or by sending HTTP GET to https://api.refinitiv.com/search/beta1/metadata/views/{View}, if you're using RDP REST API). For more details see the section titled "Properties / Metadata" in the article I referenced in my previous response. Or, if you prefer to use RDP REST API rather than RDP Library, refer to the concise documentation for the above endpoint as well as the extensive Reference guide for the Search service (/search/beta1) on API Playground.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
16 1 5 6

Many thanks for the info. This returns nothing on my side:

df = rdp.get_search_metadata(view = rdp.SearchViews.GovCorpInstruments)
df

The link you shared gives :

{"error":{"id":"ae057e24-9214-441e-9a90-3c0aa13a1ef2","code":"400","message":"Validation error","status":"Bad Request","errors":[{"key":"view","reason":"validation failure list:\nview in path should be one of [BondFutOptQuotes CdsInstruments CdsQuotes CmoInstruments CmoQuotes CommodityQuotes DealsMergersAndAcquisitions DerivativeInstruments DerivativeQuotes EquityDerivativeInstruments EquityDerivativeQuotes EquityInstruments EquityQuotes FixedIncomeInstruments FixedIncomeQuotes FundQuotes GovCorpInstruments GovCorpQuotes IndexInstruments IndexQuotes IndicatorQuotes Instruments IRDQuotes LoanInstruments LoanQuotes MoneyQuotes MortgageInstruments MortQuotes MunicipalInstruments MunicipalQuotes Organisations People PhysicalAssets Quotes QuotesAndSTIRs SearchAll STIRs VesselPhysicalAssets YieldCurveContQuotes]"}]}}
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
16 1 5 6

Was going too fast previously (apologies): ran the request to get error below. Would still prefer the RDP lib version to work. Thanks

import requests
response = requests.get("https://api.refinitiv.com/search/beta1/metadata/views/GovCorpInstruments")

raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.refinitiv.com', port=443): Max retries exceeded with url: /search/beta1/metadata/views/GovCorpInstruments (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000000005036AF60>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.3k 76 11 27

@grigorios.mamalis

I'm confused. Is the error

{"error":{"id":"ae057e24-9214-441e-9a90-3c0aa13a1ef2","code":"400","message":"Validation error","status":"Bad Request","errors":[{"key":"view","reason":"validation failure list:\nview in path should be one of [BondFutOptQuotes CdsInstruments CdsQuotes CmoInstruments CmoQuotes CommodityQuotes DealsMergersAndAcquisitions DerivativeInstruments DerivativeQuotes EquityDerivativeInstruments EquityDerivativeQuotes EquityInstruments EquityQuotes FixedIncomeInstruments FixedIncomeQuotes FundQuotes GovCorpInstruments GovCorpQuotes IndexInstruments IndexQuotes IndicatorQuotes Instruments IRDQuotes LoanInstruments LoanQuotes MoneyQuotes MortgageInstruments MortQuotes MunicipalInstruments MunicipalQuotes Organisations People PhysicalAssets Quotes QuotesAndSTIRs SearchAll STIRs VesselPhysicalAssets YieldCurveContQuotes]"}]}}

related to rdp.get_search_metadata call? Or is it related to something else? Does

rdp.get_search_metadata(view = rdp.SearchViews.GovCorpInstruments)

call simply return None without raising any exceptions?

Did you open RDP session (with rdp.open_desktop_session('APP_KEY') if you're using Eikon or Refinitiv Workspace, or with rdp.open_platform_session('APP_KEY', rdp.GrantPassword( username = 'RDP_LOGIN', password = 'RDP_PASSWORD')) if you're using RDP Platform account) before executing rdp.get_search_metadata call?

Could you also check the version of RDP Library you've got (rdp.__version__)? Currently the latest version of RDP Library on PyPI is 1.0.0.a7.post7. If you have a lower version, could you try updating the library?

The error you receive when using requests library to send GET request to https://api.refinitiv.com/search/beta1/metadata/views/GovCorpInstruments is not expected either. Since you're not managing the session in your code, I would expect this call to return

{"error":{"id":"73c51860-e344-4158-8c05-fd39402e3487","code":"401","message":"Authorization header is missing","status":"Unauthorized"}}

In your case though, judging by "getaddrinfo failed" error, it looks like you're not able to access api.refinitiv.com host at all through your network. On the other hand you received "Bad request" error with the list of search views, which comes from the same host. All of this is quite confusing I must say. Did you perhaps run these tests on different machines or through different network connections? Are you able to access https://api.refinitiv.com in a browser? Or ping api.refinitiv.com? To avoid the confusion let's try to straighten the test scenario and the test result as much as possible. And to narrow down the path, could you specify which Refinitiv product or service you're using? Is it Eikon or Refinitiv Workspace? Or do you have RDP Platform account?

I appreciate this is a mouthful of questions. Perhaps it's best not to answer them all at once. Maybe it's best to start with what product you're using and with narrowing the test scenario to using RDP Library as opposed to RDP REST API.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
16 1 5 6

Hi, many thanks for the detailed answer. Let me give you some info:

a) I first launched the EIKON box and then tried to have a look at the forum. I tried to log in and it did not let me.

b) I closed the EIKON box and tried to log in to the forum. As you see, I managed.

c) when I tried to access the https://api.refinitiv.com via brower I got a:

"You (... ) are already signed in to Refinitiv products elsewhere."

d) I did a "ping api.refinitiv.com" on cmd prompt but this returned a "Ping request could not find host .." message

e) here is what I get on IntelliJ Ultimate (am using rdp.open_desktop_session ) :


import refinitiv.dataplatform as rdp
rdp.open_desktop_session('..................................')

print(rdp.__version__)
1.0.0a7.post7
df = rdp.get_search_metadata(view = rdp.SearchViews.GovCorpInstruments)
2021-04-14 09:20:33,963 - Session session - Thread 15532 | MainThread
ERROR!!! An error occured while requesting URL('http://127.0.0.1:9000/api/rdp/search/beta1/metadata/views/GovCorpInstruments').
File "P:\Dev\env1\lib\site-packages\httpx\_exceptions.py", line 359, in map_exceptions

raise mapped_exc(message, **kwargs) from exc  # type: ignore

httpx.ConnectError: [Errno 10061] Connect call failed ('127.0.0.1', 9000)

Then:

import requests
response = requests.get("https://api.refinitiv.com/search/beta1/metadata/views/GovCorpInstruments") 
File "P:\Dev\env1\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.refinitiv.com', port=443): Max retries exceeded with url: /search/beta1/metadata/views/GovCorpInstruments (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000000000AB79F98>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "P:\Dev\env1\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-4-a63a8935545b>", line 2, in <module>
response = requests.get("https://api.refinitiv.com/search/beta1/metadata/views/GovCorpInstruments")
File "P:\Dev\env1\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "P:\Dev\env1\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)

I still get results from things like:

rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=basestring, top=GroupSize, select=srchfields)

further down.

I am running everything solely on one (Windows) machine.

Hope this info helps

Thanks

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Before doing the "refinitiv.dataplatform as rdp", I do a

import eikon as ek
ek.set_app_key('.......')
Upvotes
16 1 5 6

@Alex Putkov. hi see my comments above

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.3k 76 11 27

OK. Let's focus on RDP Library and forget about using requests library, as with Eikon you cannot use RDP REST API. I still find it very confusing that ping api.refinitiv.com can't find the host for you, yet you get a response to some HTTP requests sent to the host. But let's put it aside.
You should be able to run Eikon and log in to Refinitiv Developer Portal at the same time using the same credentials. You must run Eikon desktop application and be logged in to be able to utilize RDP Library. Let's try a clean test as follows.

  1. Start Eikon desktop application and sign in. Keep Eikon application running and signed in.
  2. Run the following code.
import refinitiv.dataplatform as rdp
import refinitiv.dataplatform.eikon as ek
rdp.logging.basicConfig(level=1)
rdp_session = rdp.open_desktop_session('APP_KEY')
rdp.get_search_metadata(view = rdp.SearchViews.GovCorpInstruments)

This will produce a very verbose log file named refinitiv-dataplatform.YYYYMMDD.HH-MM-SS.log. Could you zip the log file and post it on this thread? And could you also check the version of Eikon application you're running? You can get it from the main Eikon menu - Help - About Refinitiv Eikon.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
16 1 5 6

refinitiv-dataplatform.20210414.18-34-09.log.txt

Many thanks for the neat approach suggested. Attached the log file. EIKON version is 4.0.50046 . Many thanks.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @grigorios.mamalis

1. Eikon Desktop 4.0.50046 is quite old (more than 13 months old).

And there are several changes to the API Proxy compare to the current version, 4.0.53072

So my first suggestion is to update Eikon Desktop version to the latest.

I think there is an "update" button on the Eikon Desktop help menu (I cannot see it)

Also update RDP Lib (Python) as well.

You can use this command:

pip install --upgrade refinitiv.dataplatform

Then restart the Eikon Desktop and Python kernel and try again.


2. It may be possible that your company might have a network policy / firewal / proxy which blocks the communication from APIProxy to the server-side.

If this is the case, you can contact your Refinitiv Customer Success Manager and make sure that the network is certified.

This is network guide PDF file.


Upvotes
39.3k 76 11 27

@grigorios.mamalis

Thank you for the log. I can see that RDP session is established successfully. And then that the request for Search service metadata fails. Unfortunately the log does not say why this request fails. Enabling logging in Eikon, reproducing the problem and getting SxS log as described in section titled "Verify that Eikon Desktop is running properly and APIPROXY service is enabled" in the article "Eikon Data API(Python) Troubleshooting" may provide additional color. However, I concur with the 1st recommendation by @chavalit.jintamalit. I suggest you check with your market data department if they can upgrade the version of Eikon for you. If this resolves the problem, great. If not, then we'll need to start tracing failed request through the network. At that point we'll need to open a case with Refinitiv Support, and we may need to involve your market data folks and/or your IT support in troubleshooting.
Please keep us posted on this thread.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
16 1 5 6

@Alex.Putkov12

Hi, many thanks for the hints. I will check all this. Just wanted to share with you (see attachments)one more piece of evidence which shows thatEIKONlog_rdp_gm.txt the response breaks at some point and shows as if there is binary content associated to some stuff returned (especially past the "EOMPriceReturn" ..).

Thanks


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.3k 76 11 27

@grigorios.mamalis
This is very interesting. I've not seen this before. Up until now you were getting an error in response to the request for Search metadata. Now you're getting a response with HTTP status 200. What changed?
I'm not sure what could be causing this unexpected payload in the HTTP response. I cannot imagine that it comes from RDP. Like I said, I've never seen it, and I can't reproduce it. I suspect that the response gets jumbled in flight somewhere on the way from RDP backend to your desktop. Do you have an Internet proxy on your network that inspects HTTPS traffic, that could possibly be doing that?
One thing that would be interesting is to capture the HTTPS request from your machine to api.refinitiv.com/search/beta1/metadata/views/GovCorpInstruments endpoint using Fiddler. This is to isolate the issue to the HTTPS request going on the wire from your machine, and to definitively eliminate the desktop software (Eikon API Proxy and RDP Library) from the list of suspects.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.