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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 0 1

How can I get price history for all dats in a range

I have a REST request that uses the price history Extraction request template to return historical price for an asset/ric.

However, it only returns the price for the last date in the range.


This is despite the template setting a start and end date of the range.

Also - I have set the following template fields:


"QueryStartDate": "2015-12-01T00:00:00.000Z",
"QueryEndDate": "2018-12-03T00:00:00.000Z",
"AdjustedPrices": false,
"LastEntityOnly": false,
"ReportDateRangeType": "Range"


How can I get all prices for the date range specified?

P.S. I have also tried 'DaysAgo' = 30 with "ReportDateRangeType": "Delta" - this does exactly the same thing.

I need data for multiple years.

Thanks

Kashif.

dss-rest-apidatascope-selectdss
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
13.7k 26 8 12

This was a Python code issue, solved outside of the community forum. Thanks to Gareth.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
11.3k 25 8 13

Hi @kashif.sherwany,

Could you share your entire request message? I am able to retrieve data for the specific range using your provided condition. Below is my request.

{
  "ExtractionRequest": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.PriceHistoryExtractionRequest",
    "ContentFieldNames": [
      "RIC",
      "Trade Date",
      "Official Close Price",
      "High Price",
      "Low Price",
      "Open Price",
      "Universal Close Price",
      "Exchange Code",
      "Currency Code"          
    ],
    "IdentifierList": {
      "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",  
      "InstrumentIdentifiers": [
          { "Identifier": "IBM.N", "IdentifierType": "Ric" }
      ]
    },
    "Condition": {
      "QueryStartDate": "2015-12-01T00:00:00.000Z",
        "QueryEndDate": "2018-12-03T00:00:00.000Z",
        "AdjustedPrices": false,
        "LastEntityOnly": false,
        "ReportDateRangeType": "Range"
    }
  }
}
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 1

HI @veerapath.rungruengrayubkul My request body is almost exactly as your own:


{
'ExtractionRequest': {
'@odata.type': '#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.PriceHistoryExtractionRequest',
'ContentFieldNames': [
'RIC',
'Trade Date',
'Official Close Price',
'Ask Price',
'Bid Price',
'High Price',
'Low Price',
'Open Price',
'Universal Close Price',
'Exchange Code',
'Currency Code'
],
'IdentifierList': {
'@odata.type': '#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList',
'InstrumentIdentifiers': [
{
'Identifier': 'CARR.PA','IdentifierType': 'Ric'
}
]
},
'Condition': {
'QueryStartDate': '2015-12-01T00:00:00.000Z',
'QueryEndDate': '2018-12-03T00:00:00.000Z',
'AdjustedPrices': False,
'LastEntityOnly': False,
'ReportDateRangeType': 'Range'
}
}
}

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
11.3k 25 8 13

Hi @kashif.sherwany,

With your request body, I am able to receive data using Postman from 2015-12-01. Below is the sample of data. Can you share the application you used to send request?

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Ric",
            "Identifier": "CARR.PA",
            "RIC": "CARR.PA",
            "Trade Date": "2015-12-01",
            "Official Close Price": null,
            "Ask Price": 28.27,
            "Bid Price": 28.26,
...
        },
        {
            "IdentifierType": "Ric",
            "Identifier": "CARR.PA",
            "RIC": "CARR.PA",
            "Trade Date": "2015-12-02",
...
        },
        {
            "IdentifierType": "Ric",
            "Identifier": "CARR.PA",
            "RIC": "CARR.PA",
            "Trade Date": "2015-12-03",
...
        }
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 1

The code is in python and I am using requests library - like this:


requests.post(url, json=json_object, headers=headers, proxies=self.proxy)

where the json_object is the template I pasted above, and the header just has my token info etc..


could this be a permissions issue?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@kashif.sherwany @Christiaan Meihsl

Hi Kashif,

I have modified an example request for Price History in Python and sent via email. Please let us know if the example On Demand Price History (Range) works for you.

Based on an extraction Notes file I think it unlikely to be a permission issue.

Best regards,

Gareth

@Christiaan Meihsl - received confirm of issue has been resolved, please could we mark as closed?

Click below to post an Idea Post Idea