question

Upvotes
Accepted
5 0 1 1

API returns empty result

Hello,

I am trying to run a TRTH intraday pull using the following parameters (code depends on json and requests modules):

data_json = json.dumps({
"ExtractionRequest": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest",
"ContentFieldNames": ['Close Bid', 'No. Trades'],
"IdentifierList": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [
{"Identifier": 'SCNY', "IdentifierType": "Ric"}
],
"ValidationOptions" : {"AllowOpenAccessInstruments": True, "AllowHistoricalInstruments": True},
"UseUserPreferencesForValidationOptions" : False

},

"Condition": {
"ReportDateRangeType": "Range",
"QueryStartDate": "2017-01-01",
"QueryEndDate": "2017-01-31",
"SummaryInterval": "OneHour",
"MessageTimeStampIn": "GmtUtc"
}
}
})

The header I use at this stage is

header_dict = {'Prefer': 'respond-async, wait=5', 'Content-Type': 'application/json; odata=minimalmetadata',
'Accept-Charset': 'UTF-8', 'Authorization': 'Token ' + token}

I am able to submit this for a valid JobId, but when I go to retrieve the results, they end up containing no data:

Empty DataFrame
Columns: [#RIC, Domain, Date-Time, GMT Offset, Type, No. Trades, Close Bid]
Index: []

My header when trying to retrieve results is

pull_header_dict = {'Prefer': 'respond-async', 'Content-Type': 'Accept-Encoding: gzip, deflate',
'Authorization': 'Token ' + token}

Could someone explain why the data is coming back empty? I receive Status 200 from every request along the way, including the last one, and this pull has been run previously by another user (so there should be data). Despite being empty data-wise, the final output does include accurate column names, so I believe the request is being interpreted correctly. Thank you in advance.

tick-history-rest-api
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.

1 Answer

Upvotes
Accepted
11.3k 25 8 13

Hi @john.k.ferraro,

I have tried the request and got the same result. Anyway, the Notes information, provided when the job is completed, indicates that there is no data available for the extraction. This seems to be related to data content of the RIC in TRTH. If you need more information, please contact TRTH Content support via MyRefinitiv Product and Content support.

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#RawExtractionResults/$entity",
    "JobId": "...",
    "Notes": [
        "...Manifest: SCNY,Market Price,,,Inactive,0\n"
    ]
}
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.

Click below to post an Idea Post Idea