question

Upvotes
Accepted
5 1 1 3

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 512.0 KiB each and 1.0 MiB total.

@john.k.ferraro

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
11.3k 25 9 14

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 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.