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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 0 1

SingleHistoricalPriceExtractionRequest Code Sample

Looking for a sample that uses this API.

dss-rest-apidatascope-selectdss
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.

@v-gehend

Do you have any specific programming language that you are looking for the code sample (such as C# or plain JSON request-response)?

Hello @v-gehend

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

@v-gehend

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvote
Accepted
79.2k 251 52 74

@v-gehend

If you are using C#, you can download the C# Example Application from https://developers.thomsonreuters.com/datascope-select-dss/datascope-select-rest-api/downloads.

The sample for SingleHistoricalPriceExtractionRequest is under On Demand Extractions -> Create: Single Historical Price (Pricing Data) without Notes.

The snippet code is:

var ExtractionsContext = new ExtractionsContext(new Uri("https://hosted.datascopeapi.reuters.com/RestApi/v1/"), "<your user id>", "<your password>");

var availableFields = ExtractionsContext.GetValidContentFieldTypes(ReportTemplateTypes.TimeseriesPricing);

//Create a new end of day report template
var extractionRequest = new SingleHistoricalPriceExtractionRequest
{
    IdentifierList = InstrumentIdentifierList.Create(
        new[] { new InstrumentIdentifier { Identifier = "IBM.N", IdentifierType = IdentifierType.Ric } }, null, false),
    ContentFieldNames = new[] {
        "Close Price", "Bid Price", "Ask Price", "Trade Date", "CUSIP", "RIC", "Security Description",
        "Alternate Close Price", "Low Price", "High Price", "Mid Price", "Open Price", "Instrument ID"},
    Condition = new SingleHistoricalPriceCondition
    {
        LookBackPeriod = LookbackType.OneMonth,
        PriceDate = DateTime.UtcNow
    }
};

//Output
if (!extractedRows.Any())
    Debug.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.