question

Upvotes
Accepted
1 0 5 5

How can I get hourly data via python RDP api?

Hi,

I am trying to gather the hourly ask/bid price for JPYUSD using code below, but all I can get is data by minutes. Seems like it does not support intervals other than daily and one minutes.

Thanks

rdp-apirefinitiv-data-platformrefinitiv-data-platform-libraries
1614132998557.png (53.3 KiB)
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.

1 Answer

· Write an Answer
Upvotes
Accepted
78.1k 246 52 72

@filip.shu

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

The workaround, for now, is using the endpoint to make a request.

endpoint = rdp.Endpoint(
    session = rdp.get_default_session(), # Optionnal
    url = "/data/historical-pricing/v1/views/intraday-summaries/JPY=")
response = endpoint.send_request(
    method = rdp.Endpoint.RequestMethod.GET,
    query_parameters={
        'interval': 'PT1H',        
        'start': '2021-02-01T00:00:00.00000000Z',
        'end': '2021-02-24T00:00:00.000000000Z',
        '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)

The output is:


1614229034470.png (25.9 KiB)
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.

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.