Retrieving TickHistoryRaw data for economic series via DSS REST API

nelson.lam
nelson.lam Newcomer

I'm trying to retrieve TickHistoryRaw data for economic series like USNFAR=ECI via DSS REST API in Python. I followed the tutorial example and posted a TickHistoryRawExtractionRequest successfully. I got a status_code 200 immediately but there's no data in the response body.

Here's the Condition arguments that I sent:

"MessageTimeStampIn": "GmtUtc",

"ReportDateRangeType": "Range",

"QueryStartDate": "2006-01-01T00:00:00.000Z",

"QueryEndDate": "2010-01-01T00:00:00.000Z",

"ExtractBy": "Ric",

"SortBy": "SingleByRic",

"DomainCode": "MarketPrice",

"DisplaySourceRIC": True

I expect this request to return all FIDs. I checked on DSS GUI and confirmed there was data for the series since May 2005.

Best Answer

  • Christiaan Meihsl
    Answer ✓

    @nelson.lam,

    I just tested your query, this is what it returns:

    {
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#RawExtractionResults/$entity",
    "JobId": "0x06983b877610786a",
    "Notes": [
    "All identifiers were invalid. No extraction performed."
    ],
    "IdentifierValidationErrors": [
    {
    "Identifier": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Content.InstrumentIdentifier",
    "Identifier": "USNFAR=ECI",
    "IdentifierType": "Ric",
    "Source": ""
    },
    "Message": "Not found"
    }
    ]
    }

    The extraction notes are key to understand issues; this is why I always recommend logging them. Experimenting in Postman is one of my favorite tools, as it automatically displays error messages and such, which helps a great deal.

    In this particular case, the issue is that the instrument was Not found. This is because it is currently no longer quoted. For the instrument validation to succeed on an old instrument, you need to specify that it is a historical instrument, by allowing historical instruments in the ValidationOptions, and overriding the user preferences, using the following 2 lines after the InstrumentIdentifiers object:

    {
    "ExtractionRequest": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryRawExtractionRequest",
    "IdentifierList": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
    "InstrumentIdentifiers": [ { "Identifier": "USNFAR=ECI", "IdentifierType": "Ric" } ],
    "ValidationOptions": {"AllowHistoricalInstruments": true},
    "UseUserPreferencesForValidationOptions": false
    },
    "Condition": {
    "MessageTimeStampIn": "GmtUtc",
    "ReportDateRangeType": "Range",
    "QueryStartDate": "2006-01-01T00:00:00.000Z",
    "QueryEndDate": "2010-01-01T00:00:00.000Z",
    "ExtractBy": "Ric",
    "SortBy": "SingleByRic",
    "DomainCode": "MarketPrice",
    "DisplaySourceRIC": true
    }
    }
    }

    This request will deliver an HTTP status 202, and a location URL in the response headers.

    After polling the location URL you will get a JobId and extraction notes that clearly state when the instrument was active (2006-2009):

    Manifest: #RIC,Domain,Start,End,Status,Count\nManifest: USNFAR=ECI,Market Price,2006-01-03T14:01:24.175993000Z,2009-12-27T00:54:07.885198000Z,Active,16993

    Using the JobId you can retrieve the data (222896 lines).

Answers