question

Upvotes
Accepted
3 0 0 2

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

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


rdp-apirefinitiv-data-platform
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.

@gabriel.borrageiro.20

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 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
79.2k 251 52 74

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

thanks, that appears to work.

any idea as to how one can specify an ending date / time?


this did work with rdp.HistoricalPricing.get_summaries():
end=datetime.utcnow()

it doesn't appear to work with the code you supplied.

I get an error message:

response.status

Out[12]:

{'http_status_code': 400,

'http_reason': 'Bad Request',

'error': {'id': 'bf914859-de80-476e-810c-5ab748c6b9a8',

'code': 'TS.Intraday.UserRequestError.90004',

'status': '400',

'message': 'Request Validation Error',

'errors': [{'key': 'end',

'reason': 'The request parameter validation failed. end is invalid format.',

'invalidValues': ['2021-04-14T11:43:57.132911']}]}}


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.