Get available choices values by metada fields to use as RSearch filter criteria

Hi
i'm wondering if it's possible to get programatically all available choices values for each item usable as Search criteria when setting RDP search function(ex:IssuerCountry, AssetStatus, AssetTypeDescription...).
As we can get available fields to be used for filtering by families (meta = rdp.get_search_metadata(view=SearchViews.FixedIncomeInstruments), can you confirme me if such stuff can be done for available values choices.
Regards
Tagged:

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hello @anass.yazane.1 ,

    If I understand your question correctly, I can suggest a quick way, that may not be necessarily the best way, RDP API, direct call, rather then RDP API Library:

    GET https://{{RDP_HOST}}/discovery/search/v1/metadata/views/FixedIncomeInstruments

    Should result in all available metadata for FixedIncomeInstruments as json:

    fixedincodeinstruments.gif


    However, if this is what you are looking for, you would not usually run this request often, programmatically, you likely would expect to run it once, to pinpoint your requirements within the available properties. If you only need this information once, to properly design your integration, you may just collect this info via API Playground -> Search -> Metadata/Views as well.

    Hope this information helps.


Answers

  • Hi @anass.yazane.1 ,

    I addition to what Zoya already suggested, you can take advantage of Navigators which groups values by showing value name and the count. Here is an example of using Navigator on AssetCategoryName along with the output.

    response = rdp.Search.search(
    view = rdp.SearchViews.FixedIncomeInstruments,
    navigators = "AssetCategoryName",
    )
    response.data.raw["Navigators"]["AssetCategoryName"]

    1639563197076.png


    However, it should be noted, that you can do this only for Navigable properties. Whether the property is Navigable or not you can find in RDP API Library (as suggested by Zoya) or from the output of rdp.get_search_metadata(view=SearchViews.FixedIncomeInstruments). For the non-Navigable items, you may find this article useful which simplifies the challenges of discovering financial properties and the values when programmatically building Search.