REST API Tutorial 16: Search by Instrument

Last update Dec 2023
Environment Any
Language Any HTTP is supported
Compilers None
Prerequisites DSS login, internet access
Source code Below

Tutorial purpose

This tutorial explains how to make a search request, using as criteria the instrument code.

Two examples are shown, you can extend these to other instrument codes:

  • Search using the RIC.
  • Search using the Organisation Id (OrgId).

Such a call can also be used to validate a list of instruments (as illustrated by the first example).

You can choose to have results in a different instrument code type (as illustrated by the second example).

Important note: contrary to the historical search capabilities described in the previous tutorials, this search capability (and the following ones) only returns instruments that are currently active, it will not include historical instruments.

 

Table of contents


Search by RIC - HTTP request

Notes:

  • You can search for more than one RIC, by simply separating them with commas.
  • You can use the "*" character as a wildcard in the RIC: "IBM*".
  • An invalid RIC will not be included in the returned results. This can be used to validate a list of RICs.
  • You can filter results by instrument type group.
  • For all requests we need to include a user token in the header of our request. This was retrieved in Tutorial 1.

The body of the request contains several parts:

  • The identifier type (Cusip, Isin, Ric, etc., more than 30 are available). In the example below we use RIC. More information on them can be found by browsing in the API Reference Tree or searching in the help in the DSS web GUI:
  • The list of identifiers.
  • The instrument type groups, to filter results (all possible groups are included in the request below).
  • The preferred identifier type for the returned results.

The following request searches for four RICs (one of which is invalid), accross all instrument type groups.

URL:   

    	
            https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/InstrumentSearch
        
        
    

Method:          POST

Headers:

    	
            

Prefer: respond-async

Content-Type: application/json

Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061

Body:

    	
            

{

  "SearchRequest": {

    "InstrumentTypeGroups": [

      "CollatetizedMortgageObligations",

      "Commodities",

      "Equities",

      "FuturesAndOptions",

      "GovCorp",

      "MortgageBackedSecurities",

      "Money",

      "Municipals",

      "Funds"

    ],

    "IdentifierType": "Ric",

    "Identifier": "US10YT=RRPS,JPY=,IBM.N, INVALID.RIC",

    "PreferredIdentifierType": "Ric"

  }

}

 

Search by RIC - HTTP response

Status:                        200 OK

Relevant headers:

    	
            Content-Type: application/json; charset=utf-8
        
        
    

Body:

    	
            

{

  "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#Collection(DataScope.Select.Api.Content.ValidatedInstrument)",

  "value": [

    {

      "Identifier": "IBM.N",

      "IdentifierType": "Ric",

      "Source": "NYS",

      "Key": "VjF8MHgwMDAzZGQwMDEzNzlkNDYwfDB4MDAwM2RjMDA0YTAyNGZkOHxOWVN8RVFRVXxFUVRZfE9EU0h8RXx8SUJNLk58MDA3Nw",

      "Description": "INTERNATIONAL BUSINESS MACHINES ORD",

      "InstrumentType": "EquityQuote",

      "Status": "Valid"

    },

    {

      "Identifier": "JPY=",

      "IdentifierType": "Ric",

      "Source": "RCT",

      "Key": "VjF8MHgwMDEwMGIwMDAzMGE5MDEyfDB4MDAwM2RjMDAzNDcyZjc2ZXxSQ1R8TU5RVXxNT05ZfE1PTll8WXx8SlBZPXwwMTQz",

      "Description": "US Dollar/Japanese Yen FX Spot Rate",

      "InstrumentType": "MoneyMarketQuote",

      "Status": "Valid"

    },

    {

      "Identifier": "US10YT=RRPS",

      "IdentifierType": "Ric",

      "Source": "EJV",

      "Key": "VjF8MHgwMDEwMmNiOWE0OTAxZmFlfDB4MDAxMDJjNTc4NGJiMWY0YnxFSlZ8R0NCRHxHT1ZUfEdCTkR8R3xOfFVTMTBZVD1SUlBTfEdPUlA",

      "Description": "UST  1.500 02/15/30",

      "InstrumentType": "GovCorpBond",

      "Status": "Valid"

    }

  ]

}

Note there are only 3 results, because there is no data for the invalid RIC. This is how we validated our input list.

 

 

Search by ORG ID - HTTP request

Notes:

  • This is very similar to the search by RIC, using a different identifier type.
  • In this example we set the preferred identifier type to a different value from the input list, because we would like results as RICs.

The following request searches for two ORG IDs, across all instrument type groups.

URL:               

    	
            https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/InstrumentSearch
        
        
    

Method:          POST

Headers:

    	
            

Prefer: respond-async

Content-Type: application/json

Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061

Body:

    	
            

{

  "SearchRequest": {

    "InstrumentTypeGroups": [

      "CollatetizedMortgageObligations",

      "Commodities",

      "Equities",

      "FuturesAndOptions",

      "GovCorp",

      "MortgageBackedSecurities",

      "Money",

      "Municipals",

      "Funds"

    ],

    "IdentifierType": "OrgId",

    "Identifier": "18175,18174",

    "PreferredIdentifierType": "Ric"

  }

}

 

 

Search by ORG ID - HTTP response

Status:                        200 OK

Relevant headers:

    	
            Content-Type: application/json; charset=utf-8
        
        
    

Body:

Note that in a few cases there is no available result with the preferred identifier type, so a different identifier type is returned (in this case a Cusip).

There are more than 150 values in the response. Here is the beginning of the response:

    	
            

{

  "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#Collection(DataScope.Select.Api.Content.ValidatedInstrument)",

  "value": [

    {

      "Identifier": "ZUCI.MI",

      "IdentifierType": "Ric",

      "Source": "MIL",

      "Key": "VjF8MHgwMDAzZGQwMDE2NzNmYjQwfDB4MDAwM2RjMDA0NjI5N2JjYnxNSUx8RVFRVXxFUVRZfE9EU0h8RXx8WlVDSS5NSXwwMTI4",

      "Description": "VINCENZO ZUCCHI ORD",

      "InstrumentType": "EquityQuote",

      "Status": "Valid"

    },

    {

      "Identifier": "0DFFmi.TRE",

      "IdentifierType": "Ric",

      "Source": "LSE",

      "Key": "VjF8MHgwMDAzZGQwMDE2NzNmYjQwfDB4MDAwM2Y4MDExOWYyMTcwNnxMU0V8RVFRVXxFUVRZfE9EU0h8RXx8MERGRm1pLlRSRXwzODg2",

      "Description": "VINCENZO ZUCCHI ORD",

      "InstrumentType": "EquityQuote",

      "Status": "Valid"

    },

    {

      "Identifier": "ZUCm.CHI",

      "IdentifierType": "Ric",

      "Source": "CHI",

      "Key": "VjF8MHgwMDAzZGQwMDE2NzNmYjQwfDB4MDAwM2Y4MDM4YmFlNzVhOHxDSEl8RVFRVXxFUVRZfE9EU0h8RXx8WlVDbS5DSEl8MTM1OQ",

      "Description": "VINCENZO ZUCCHI ORD",

      "InstrumentType": "EquityQuote",

      "Status": "Valid"

    },

    {

      "Identifier": "ZUCm.BS",

      "IdentifierType": "Ric",

      "Source": "BTE",

      "Key": "VjF8MHgwMDAzZGQwMDE2NzNmYjQwfDB4MDAwM2Y4MDM4ZjkyYjA1NXxCVEV8RVFRVXxFUVRZfE9EU0h8RXx8WlVDbS5CU3wxNjg2",

      "Description": "VINCENZO ZUCCHI ORD",

      "InstrumentType": "EquityQuote",

      "Status": "Valid"

    },

    {

      "Identifier": "ZUCIEUR.xbo",

      "IdentifierType": "Ric",

      "Source": "XBO",

      "Key": "VjF8MHgwMDAzZGQwMDE2NzNmYjQwfDB4MDAwM2Y4MDNiMTNhOTllYXxYQk98RVFRVXxFUVRZfE9EU0h8RXx8WlVDSUVVUi54Ym98MTU4Nw",

      "Description": "VINCENZO ZUCCHI ORD",

      "InstrumentType": "EquityQuote",

      "Status": "Valid"

    },

This goes on with all the other available fields. Here is the last part:

    	
            

    {

      "Identifier": "USU0242AAD47=JPNR",

      "IdentifierType": "Ric",

      "Source": "JP9",

      "Key": "VjF8MHgwMDEwMmNlOGNkZTcxZmUxfDB4MDAxMDJjZDdkMzJjMjAzNHxKUDl8R0NCRHxDT1JQfENJTkR8R3xFfFVTVTAyNDJBQUQ0Nz1KUE5SfA",

      "Description": "AALX   3.750 03/01/25",

      "InstrumentType": "GovCorpBond",

      "Status": "Valid"

    },

    {

      "Identifier": "USU0242AAD47=ENp",

      "IdentifierType": "Ric",

      "Source": "EN2",

      "Key": "VjF8MHgwMDEwMmNlOGNkZTcxZmUxfDB4MDAxMDJjZGU0YjEwMjE5OHxFTjJ8R0NCRHxDT1JQfENJTkR8R3xFfFVTVTAyNDJBQUQ0Nz1FTnB8",

      "Description": "AALX   3.750 03/01/25",

      "InstrumentType": "GovCorpBond",

      "Status": "Valid"

    },

    {

      "Identifier": "USU0242AAD47=TWEO",

      "IdentifierType": "Ric",

      "Source": "TT1",

      "Key": "VjF8MHgwMDEwMmNlOGNkZTcxZmUxfDB4MDAxMDJjZTJjNTJlMjExNHxUVDF8R0NCRHxDT1JQfENJTkR8R3xFfFVTVTAyNDJBQUQ0Nz1UV0VPfA",

      "Description": "AALX   3.750 03/01/25",

      "InstrumentType": "GovCorpBond",

      "Status": "Valid"

    }

  ]

}