question

Upvotes
Accepted
17 5 6 11

Getting CUSIP/ISIN for stock RIC code

Hi Team,


I have a list of RIC codes and I'm trying to get the corresponding CUSIP/ISIN and the dates for which the mapping is valid using RTH Python. I use the following code, but the CUSIP field always returns a null value. Not sure about the corresponding field for the Bloomberg ticker.


instrument_list = [{'Identifier': '3412583.XD', 'IdentifierType': 'Ric'},
                   {'Identifier': 'A.N', 'IdentifierType': 'Ric'},
                   {'Identifier': 'AA.N', 'IdentifierType': 'Ric'},
                   {'Identifier': 'AAL.N', 'IdentifierType': 'Ric'},
                   {'Identifier': 'AAL.OQ', 'IdentifierType': 'Ric'}]
requestBody = {
 'ExtractionRequest': {
   '@odata.type': '#DataScope.Select.Api.Extractions.ExtractionRequests.HistoricalReferenceExtractionRequest',
   'ContentFieldNames': [ "Company Name", "Currency Code", "CUSIP", "ISIN", "Start date", "Change Date",],
   'IdentifierList': {
     '@odata.type': '#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList',  
     'InstrumentIdentifiers':  instrument_list,
        'ValidationOptions': {'AllowHistoricalInstruments': 'true', 'AllowInactiveInstruments' : 'true'},
        "UseUserPreferencesForValidationOptions": 'false'
   },
    "Condition": {"ReportDateRangeType": "Range", "QueryStartDate": "2010-01-01", "QueryEndDate": "2015-09-09"}
 } 
}

requestUrl = 'https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractWithNotes'

requestHeaders_extraction = {
   'Prefer':'respond-async',
   'Content-Type':'application/json',
   'Authorization': 'token ' + auth_token
}

extraction_response = requests.post(requestUrl, json = requestBody, headers = requestHeaders_extraction)


can you please help me with the correct 'ContentFieldNames'/quert?

Thanks.

pythondatascope-selecttick-history-rest-api#contentricsextraction
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.

1 Answer

· Write an Answer
Upvote
Accepted
22.6k 59 14 21

Hi @ns3481,

CUSIP is a fee liable data and can be retrieved only if you have appropriate permission for it. I tried the same query and can get CUSIP information successfully. Please talk to your Refinitiv account manager, if you need access to it as well.


{
  "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#DataScope.Select.Api.Extractions.ExtractionRequests.ExtractionResult",
  "Contents": [{
      "IdentifierType": "Ric",
      "Identifier": "A.N",
      "Company Name": "Agilent Technologies Inc",
      "Currency Code": "USD",
      "CUSIP": "00846U101",
      "ISIN": "US00846U1016",
      "Start date": null,
      "Change Date": "2010-01-01"
    }, 
...


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.

Thanks Gurpreet. That must be it.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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