For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 0 1

Correct use of RcsUnderlyingProducts

I am trying to search for commodities by underlying product as documented here:
https://hosted.datascopeapi.reuters.com/RestApi.Help/Context/Operation?ctx=Search&opn=CommoditySearch&sce=Search%20-%20Commodities%20Search%20-%20AND%202%20Fields.primary&stp=1&tab=2


Here is python code for a query that looks for Argus commodities without matching product type:

q = { "SearchRequest": { "IdentifierType": "Ric", "PreferredIdentifierType": "Ric", # "RcsUnderlyingProducts":["*CRUDE*"], # "Description":"CRUDE", "ExchangeCodes":["ARG"], #"ExchangeCodesOperator":"Exclude" } }
q = json.dumps(q)

response_data = requests.post("https://hosted.datascopeapi.reuters.com/RestApi/v1/Search/CommoditySearch", headers = {"Prefer": "respond-async", "Content-Type": "application/json", "Authorization":"Token "+json.loads(response_credentials.text)["value"]},data = q)

This returns 250 results, which is the limit, I guess. Among them, there are many with RcsUnderlyingProduct 'CRUDE OIL.' For example:

{'AssetCategory': 'EFU', 'AssetStatus': 'Inactive', 'CommoditiesUnderlyingAsset': 'NATURAL GAS', 'ContractMonthAndYear': 'MAR2014', 'CurrencyCode': 'RUB', 'CurrencyCodeDescription': 'Russian New Ruble', 'Description': 'URALS SEABORNE M', 'ExchangeCode': 'ARG', 'ExchangeCodeDescription': 'ARGUS (ARG)', 'ExpirationDate': '2014-03-17T00:00:00.000Z', 'FileCode': '6295', 'FileCodeDescription': '(6295) DOBOL Daily', 'FrequencyOfUpdate': '', 'Identifier': 'URLSBRNBKH4^1', 'IdentifierType': 'Ric', 'InstrumentType': 'Commodity', 'Key': 'VjF8MHgwMDEwMGIwMDExYTQyM2QyfDB4MDAxMDBiMDAwZjE1YTAyZnxBUkd8Q09NUXxDT01NfENPTU18T3x8UklDOlVSTFNCUk5CS0g0XjF8NjI5NQ', 'LongDescription': 'DRNR ROOT MAR 2014', 'LotUnits': 'USD', 'PrimaryChainOrTile': '0#URLSBRNBK:', 'RcsUnderlyingProduct': 'CRUDE OIL', 'Source': 'ARG', 'SourceName': 'ARGUS MEDIA LTD', 'SourceType': 'SPLST', 'Status': 'Valid', 'TrClassificationScheme': 'FUT'}


If i perform a search adding a filter for 'RcsUnderlyingProducts' as follows:

q = { "SearchRequest": { "IdentifierType": "Ric", "PreferredIdentifierType": "Ric", "RcsUnderlyingProducts":['CRUDE OIL'], "RcsUnderlyingProductsOperator":"Include", "ExchangeCodes":["ARG"], #"ExchangeCodesOperator":"Exclude" } }
q = json.dumps(q)
response_data = requests.post("https://hosted.datascopeapi.reuters.com/RestApi/v1/Search/CommoditySearch", headers = {"Prefer": "respond-async", "Content-Type": "application/json", "Authorization":"Token "+json.loads(response_credentials.text)["value"]},data = q)

i get an empty result. so the API request is accepted, so i assume it is well formed. but no response. even though clear what i typed was a verbatim match.

are there any worked examples of this functionality in HTTP?

dss-rest-apidatascope-selectdsscommodities
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
11.3k 25 8 13

Hi,

It seems that the RcsUnderlyingProducts is case sensitive. The CommoditySearch returns data once value of the RcsUnderlyingProducts is changed from "CRUDE OIL" to "Crude Oil". You can verify the value with the Commodity Search in DSS GUI.

With regard to the 250 rows limitation of result, this is expected behavior. The CommoditySearch uses the Server-Driven Paging mechanism to deliver data. It will return the first page of results (typically 250 rows) on the initial request. The initial server response will include a nextlink(URI) that, when called, will return the next 250 rows for that result set as well as another nextlink. If there are no more rows, the nextlink will not be returned.


commoditysearch.png (31.2 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea