New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
1 0 0 2

interval parameter doesn't work

Hello.

I want to get weekly or monthly data using historical price summary function, but only I can get daily data.

Should I use another RIC code or function? Please help me. Thanks a lot.

col = ['CMCU3']
start_date = '2019-01-01T00:00:00'
end_date =  '2021-02-01T00:00:00'

df1 = rdp.get_historical_price_summaries(univers = col, interval = rdp.Intervals.WEEKLY, start = start_date, end = end_date)



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

Upvote
Accepted
87.8k 294 53 79

@lsibobe

It could be a bug in the library.

The workaround could be like the following.

col = 'CMCU3'
start_date = '2019-01-01'
end_date =  '2021-02-01'
endpoint = rdp.Endpoint(
    session = rdp.get_default_session(), # Optionnal
    url = "/data/historical-pricing/v1/views/interday-summaries/"+col)

response = endpoint.send_request(
    method = rdp.Endpoint.RequestMethod.GET,
    query_parameters={
        'interval': 'P1W',
        'start': start_date,
        'end': end_date
    }
)
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)

For monthly data, the interval value is P1M.

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.

Upvotes
1 0 0 2
Thanks a lot, it works! Is there any API or references about this codes???
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.

@lsibobe

It demonstrates how to directly connect to the RDP endpoint and retrieve the data. The example code is available on GitHub.

To use the historical endpoint, please refer to the API doc.

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.