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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 1 1 1

historical bond prices via DSS Python (REST) API

I want to extract historical bond prices (clean, and dirty), yields and bpv for US treasury bonds, (example RIC='9128286H8=') via the DSS Python API - using the Elektron Time Series template:

"https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/GetValidContentFieldTypes(ReportTemplateType=ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ReportTemplateTypes'ElektronTimeseries')

I have browsed through the different fields, and tried: "Ask", "Bid", "Universal Ask", "Universal Bid", "Yield", "Close Yield", "Last". But all these fields returns None.

Question 1: Is it possible to extract historical bond prices (clean, and dirty), yields and bpv for US treasury bonds via DSS Python API?

Question 2: If yes, which fields do I need to request?

Question 3:If no, can I use another DSS template to obtain these data?

pythonelektron-sdkdss-rest-apidatascope-selectdsshistoricalbonds
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.

Hello @lhougaard1,

As your question is on DSS, we are moving it to DSS API area, this way it will get visibility with the right group of API experts.

Hello @lhougaard1

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

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
Upvotes
Accepted
32.2k 40 11 20

Hello @lhougaard1,

I have tested ElektronTimeSeries via on-demand request via Postman (quickest to test, but should yield exact same result in Python):

{
   "ExtractionRequest": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ElektronTimeseriesExtractionRequest",
    "ContentFieldNames": [ "RIC", "Ask", "Bid", "Trade Date" ],
    "IdentifierList": {
      "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", 
      "InstrumentIdentifiers": [
        { "Identifier": "9128286H8=", "IdentifierType": "Ric" }
      ]
    },
   "Condition": {
            "ReportDateRangeType": "Range",
            "QueryStartDate": "2020-10-01T00:00:00.000Z",
            "QueryEndDate": "2020-12-02T00:00:00.000Z"
        }
  }
}

My response contained valid data points:

...
{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Ric",
            "Identifier": "9128286H8=",
            "RIC": "9128286H8=",
            "Ask": 103.26953125,
            "Bid": 103.24609375,
            "Trade Date": "2020-10-01"
        },
        {
            "IdentifierType": "Ric",
            "Identifier": "9128286H8=",
            "RIC": "9128286H8=",
            "Ask": 103.24609375,
            "Bid": 103.22265625,
            "Trade Date": "2020-10-02"
        },
...

Yes, using Python you should get the exact same result, if your user id is permissioned to request this template. Please try the above on-demand request, you can download RTH Python Code Examples and replace the request in OnDemand example with this request or your required request.

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.