question

Upvotes
Accepted
45 12 21 14

How do I get a list of the current consituents of an index using the DSS REST API

I should retrieve on a monthly basis the list of the securities that constitute some of the populat indexes, over the DSS REST API, with a .Net application. Any idea how to do that ?

I can't find any mention of index anywhere, and the chains search (which could be one answer) in the DSS GUI does not find such a thing as the .DJI or ^DJI, although the latter is supposed to be the RIC code of the Dow Jones index, and the chains search want to have a RIC code...

Any help very welcome !

Regards

Bernard

dss-rest-apidssdatascope-selectindex
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
11.3k 26 9 14

@BTh

Hi Bernard,

Normally, there could be Chain RIC which provides list of constituent RICs. You can use the Chain RIC to retrieve list of constituent RICs with TermsAndConditions extraction. Below is the example code. As far as I know, the Chain RIC for .DJI is 0#.DJI.

For Chain RICs of other index, please contact Content support via MyRefinitiv.

    var extractionsContext = new ExtractionsContext(new Uri("https://hosted.datascopeapi.reuters.com/RestApi/v1/"), dssUserName, dssUserPassword);
    TermsAndConditionsExtractionRequest extractionRequest = new TermsAndConditionsExtractionRequest
    {
        IdentifierList = InstrumentIdentifierList.Create(
            new[] { new InstrumentIdentifier { Identifier = "0#.DJI", IdentifierType = IdentifierType.ChainRIC } }, null, false),
        ContentFieldNames = { "RIC" },
        Condition = new TermsAndConditionsCondition
        {
            IssuerAssetClassType = IssuerAssetClassType.AllSupportedAssets,
            ExcludeWarrants = false,
            //StartDate = new DateTimeOffset(DateTime.Now)
        }
    };

    var extractionResult = extractionsContext.ExtractWithNotes(extractionRequest);
    var extractedRows = extractionResult.Contents;

    //Output
    if (!extractedRows.Any())
        Console.WriteLine("No rows returned");
    else
    {
        foreach (var row in extractedRows)
            Console.WriteLine(
                row.Identifier + " (" + row.IdentifierType + ") " +
                String.Join(", ", row.DynamicProperties.Select(dp => dp.Key + "=" + dp.Value)));
    }
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.

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.