question

Upvotes
Accepted
7 1 0 1

Batch Request for Historical Pricing | RDP

Hi Team,

Since the client encountered problems using the RDP Python library for their solution, particularly with accessing historical prices, they have opted to use the Python requests library (with examples provided in the API Playground) to retrieve data. Here is a sample request for historical prices:

url = f"https://api.refinitiv.com/data/historical-pricing/v1/views/interday-summaries/{ticker}"

response = requests.get(
    url,
    headers=headers,
    params={
        'start': start_date,
        'end': end_date,
        'adjustments': 'exchangeCorrection,RPO',
        'qos': 'delayed'
    }
)


I am wondering if it is possible to retrieve batch data using the requests library for Historical Pricing. I came across this article: https://community.developers.refinitiv.com/questions/90817/requesting-large-data-amounts-in-batches-via-rdp-a.html, but it appears to use the RDP Python library.

Additionally, is there a way to parallelize the requests for historical pricing data retrieval?

Thanks!

#technologyrdp-apibatch-requestparallel-run
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
Accepted
84.6k 287 53 77

@mohamed.noohaboo

Thank you for reaching out to us.

These questions look similar to the questions on this dicussion. Are you posting questions on behalf of that client?

The client can use the /views/interday-summaries with the HTTP POST method and specify multiple items in the request's body. Please check the API docs of the historical pricing for more inforamation.

1720687426639.png

Yes, in Python, the client can send concurrent HTTP requests by using ThreadPoolExecutor. However, the number of requests should not exceed the limit mentioned on the Reference page of the historical pricing endpoint.


1720687426639.png (63.2 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.

Upvotes
27k 65 17 14

Hello @mohamed.noohaboo

Based on the API Playground page, the Historical Pricing API supports the batch subscription via an HTTP Post message. Did you or the client check the API Playground page yet?

interday-summaries.png

interday-summaries-2.png


About the parallelize the requests for historical pricing data, the client can use Python threading or asyncio feature to send an HTTP request to RDP in concurrent.

We do not have the exact example code that the client needs, but there a lot of example code over internet such as:

I hope this information helps.


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
7 1 0 1

thanks for the detailed explanation, @wasin.w and @Jirapongse! I shall pass on the information to the client.

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.