why do HistoricalPricing.get_summaries() with interval other than minutely or daily, not work?

Options

It appears that when extracting data via refinitiv.dataplatform.HistoricalPricing.get_summaries(), only the minutely interval and the daily interval work. See the example below.


import refinitiv.dataplatform as rdp

grant = rdp.GrantPassword(username=RDP_LOGIN, password=RDP_PASSWORD)
rdp.open_platform_session(APP_KEY, grant)
rdp.logging.disable()

for interval in rdp.Intervals:
response = rdp.HistoricalPricing.get_summaries('GBP=', interval=interval, count=5)
print('\ninterval name=%s value=%s\n%s'
% (interval.name, interval.value, response.data.df[['BID', 'ASK']].head()))

interval name=ONE_MINUTE value=PT1M

BID ASK

2021-03-12 21:56:00 1.3916 1.3921

2021-03-12 21:57:00 1.3919 1.3924

2021-03-12 21:58:00 1.3918 1.3923

2021-03-12 21:59:00 1.3922 1.3927

2021-03-12 22:00:00 1.3922 1.3927


interval name=FIVE_MINUTES value=PT5M

BID ASK

2021-03-12 21:56:00 1.3916 1.3921

2021-03-12 21:57:00 1.3919 1.3924

2021-03-12 21:58:00 1.3918 1.3923

2021-03-12 21:59:00 1.3922 1.3927

2021-03-12 22:00:00 1.3922 1.3927


interval name=TEN_MINUTES value=PT10M

BID ASK

2021-03-12 21:56:00 1.3916 1.3921

2021-03-12 21:57:00 1.3919 1.3924

2021-03-12 21:58:00 1.3918 1.3923

2021-03-12 21:59:00 1.3922 1.3927

2021-03-12 22:00:00 1.3922 1.3927


interval name=THIRTY_MINUTES value=PT30M

BID ASK

2021-03-12 21:56:00 1.3916 1.3921

2021-03-12 21:57:00 1.3919 1.3924

2021-03-12 21:58:00 1.3918 1.3923

2021-03-12 21:59:00 1.3922 1.3927

2021-03-12 22:00:00 1.3922 1.3927


interval name=SIXTY_MINUTES value=PT60M

BID ASK

2021-03-12 21:56:00 1.3916 1.3921

2021-03-12 21:57:00 1.3919 1.3924

2021-03-12 21:58:00 1.3918 1.3923

2021-03-12 21:59:00 1.3922 1.3927

2021-03-12 22:00:00 1.3922 1.3927


interval name=ONE_HOUR value=PT1H

BID ASK

2021-03-12 21:56:00 1.3916 1.3921

2021-03-12 21:57:00 1.3919 1.3924

2021-03-12 21:58:00 1.3918 1.3923

2021-03-12 21:59:00 1.3922 1.3927

2021-03-12 22:00:00 1.3922 1.3927


interval name=DAILY value=P1D

BID ASK

2021-03-08 1.3824 1.3828

2021-03-09 1.3893 1.3896

2021-03-10 1.393 1.3934

2021-03-11 1.399 1.3994

2021-03-12 1.3922 1.3927


interval name=SEVEN_DAYS value=P7D

BID ASK

2021-03-08 1.3824 1.3828

2021-03-09 1.3893 1.3896

2021-03-10 1.393 1.3934

2021-03-11 1.399 1.3994

2021-03-12 1.3922 1.3927


interval name=WEEKLY value=P1W

BID ASK

2021-03-08 1.3824 1.3828

2021-03-09 1.3893 1.3896

2021-03-10 1.393 1.3934

2021-03-11 1.399 1.3994

2021-03-12 1.3922 1.3927


interval name=MONTHLY value=P1M

BID ASK

2021-03-08 1.3824 1.3828

2021-03-09 1.3893 1.3896

2021-03-10 1.393 1.3934

2021-03-11 1.399 1.3994

2021-03-12 1.3922 1.3927


interval name=QUARTERLY value=P3M

BID ASK

2021-03-08 1.3824 1.3828

2021-03-09 1.3893 1.3896

2021-03-10 1.393 1.3934

2021-03-11 1.399 1.3994

2021-03-12 1.3922 1.3927


interval name=TWELVE_MONTHS value=P12M

BID ASK

2021-03-08 1.3824 1.3828

2021-03-09 1.3893 1.3896

2021-03-10 1.393 1.3934

2021-03-11 1.399 1.3994

2021-03-12 1.3922 1.3927


interval name=YEARLY value=P1Y

BID ASK

2021-03-08 1.3824 1.3828

2021-03-09 1.3893 1.3896

2021-03-10 1.393 1.3934

2021-03-11 1.399 1.3994

2021-03-12 1.3922 1.3927


Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @gabriel.borrageiro.20

    It looks like to be a bug as mentioned in this thread.

    The workaround could be like the following.

    endpoint = rdp.Endpoint(
        session = rdp.get_default_session(), # Optional
        url = "/data/historical-pricing/v1/views/intraday-summaries/JPY=")
    response = endpoint.send_request(
        method = rdp.Endpoint.RequestMethod.GET,
        query_parameters={
            'interval': 'PT1H',        
            'count': 5,
            'summaryTimestampLabel': 'endPeriod'
        }
    )
    if response.is_success:
        headers = [h['name'] for h in response.data.raw[0]['headers']]
        df = pd.DataFrame(data=response.data.raw[0]['data'], columns=headers)
        display(df)

Answers