question

Upvotes
Accepted
1 0 0 1

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 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
38.1k 69 35 53

@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 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 1
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 5.0 MiB each and 10.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.

Click below to post an Idea Post Idea