Hi there,
I have a problem with extracting data from Tick History
I specified the range in the report request but couldn't retrieve all data. How can I retrieve all data I wrote in the code below? Any help would be appreciated.
Thank you,
body_data = json.dumps({
"ExtractionRequest": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest",
"ContentFieldNames":[
"Quote - Bid Price",
"Quote - Bid Size",
"Quote - Ask Price",
"Quote - Ask Size"
],
"IdentifierList": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [ { "Identifier": "JNIc1", "IdentifierType": "Ric" } ],
"ValidationOptions": None,
"UseUserPreferencesForValidationOptions": False
},
"Condition": {
"MessageTimeStampIn": "",
"ReportDateRangeType": "Range",
"QueryStartDate":"2017-01-03T23:45:00.000Z",
"QueryEndDate": "2017-01-06T20:30:00.000Z",
"DisplaySourceRIC": True
}
}
})
responseGet = requests.post( "https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractRaw",
data = body_data,
headers = header2)
res_json = responseGet.json()
job_id = res_json['JobId']
response_obj = requests.get( "https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/RawExtractionResults('{0}')/$value".format(job_id),
headers = header2, stream=True)
gzip_file = "jnic1.csv"
with open(gzip_file, 'wb') as f:
for data in response_obj.raw.stream(decode_content=True):
f.write(data)