question

Upvotes
Accepted
1 1 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.

@filip.shu

Thank you for your participation in the forum.


Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the reply that best answers your question.

This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.


Thanks,

-AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 250 52 74

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