question

Upvotes
Accepted
1 0 0 2

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

1 Answer

Upvotes
Accepted
38.1k 71 35 53

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

Click below to post an Idea Post Idea