Unable to connect to History Intraday summary

I have a python program download report for History Raw and History intraday from TRTH using the same code base. The program works for History raw but not for history intraday with the following error


requests.exceptions.ConnectionError: HTTPSConnectionPool(host='selectapi.datascope.refinitiv.com', port=443): Max retries exceeded with url: /RestApi/v1/Extractions/ExtractRaw (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000000000B05DFC8>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond')) 

The following is the request sent

@{'ExtractionRequest': {'@odata.type': '#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest', 'ContentFieldNames': ['High Ask', 'High Ask Size', 'High Bid', 'High Bid Size', 'Low Ask', 'Low Ask Size', 'Low Bid', 'Low Bid Size'], 'IdentifierList': {'@odata.type': '#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList', 'InstrumentIdentifiers': [{'Identifier': '3333.HK', 'IdentifierType': 'Ric'}], 'UseUserPreferencesForValidationOptions': 'false'}, 'Condition': {'MessageTimeStampIn': 'LocalExchangeTime', 'ReportDateRangeType': 'Range', 'QueryStartDate': '2021-11-29T10:00:00.000Z', 'QueryEndDate': '2021-11-29T10:15:00.000Z', 'SummaryInterval': '5 Seconds', 'TimebarPersistence': 'true', 'DisplaySourceRIC': 'true', 'DateRangeTimeZone': 'Local Exchange Time Zone'}}}



Tagged:

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hello @KAKIT.LAI ,

    You may find it quick and convenient, to test this request via Postman tool, it results in:

    {
    "error": {
    "message": "Malformed request payload: Error while parsing an enum value: Requested value '5 Seconds' was not found."
    }
    }

    Please try:

    @{"ExtractionRequest": {"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest", "ContentFieldNames": ["High Ask", "High Ask Size", "High Bid", "High Bid Size", "Low Ask", "Low Ask Size", "Low Bid", "Low Bid Size"], "IdentifierList": {"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{"Identifier": "3333.HK", "IdentifierType": "Ric"}], "UseUserPreferencesForValidationOptions": "false"}, "Condition": {"MessageTimeStampIn": "LocalExchangeTime", "ReportDateRangeType": "Range", "QueryStartDate": "2021-11-29T10:00:00.000Z", "QueryEndDate": "2021-11-29T10:15:00.000Z", "SummaryInterval": "FiveSeconds", "TimebarPersistence": "true", "DisplaySourceRIC": "true", "DateRangeTimeZone": "Local Exchange Time Zone"}}}

    For the list of available summary interval enum values, please refer to

    REST API Reference Tree -> Extractions -> On Demand Extractions-> ExtarctRaw->TickHistorySummaryInterval