question

Upvotes
Accepted
1 0 0 0

Batch Retrieval and Parallel Requests for Fundamentals and Historical Pricing Data

Hello,

I am trying to utilize the following RDP API endpoints by utilizing Python requests library:

  • Company Fundamentals:
    • data/company-fundamentals/v1/financial-statements/global/balance-sheet
  • Historical Pricing:
    • v1/views/interday-summaries/

I need to retrieve data in parallel and as batches, if possible. I need to build a pipeline where data is going to be retrieved daily.

My questions are as follows:

Fundamentals:

  1. Batch Retrieval: Is there a way to retrieve fundamentals data as a batch?
  2. Parallel Requests: Is there a way to parallelize the requests for fundamental data retrieval?
  3. Next Earnings Date: What is the best way to determine the next earnings date for a ticker?
  4. Currency Consistency: Is it possible to retrieve fundamental data only in USD for companies using different currencies?

Historical Pricing:

  1. Macroeconomic Indicators: Is there a way to retrieve macroeconomic indicators (RIC codes ending with =ECIX) and company pricing history as a batch?
  2. Parallel Requests: Is there a way to parallelize the requests for historical pricing data retrieval?
  3. Corresponding Currency: Is there a way to retrieve macroeconomic values (RIC codes ending with =ECIX) with their corresponding currency? Currently, from interday summaries, it only returns date and value.
  4. Next Release Date: What is the best way to determine the next release date for a macroeconomic indicator (RIC codes ending with =ECIX)?

An example snippet looks like following (similar approach is being used for company-fundamentals endpoint):

url = f"https://api.refinitiv.com/data/historical-pricing/v1/views/interday-summaries/USADP=ECIX"
response = requests.get(
            url,
            headers=headers,
            params={
                'start': start_date,
                'end': end_date,
                'adjustments': 'exchangeCorrection,RPO',
                'qos': 'delayed'
            }
        )

Thanks in advance.

python#technology#productrdp-apibatch-request
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
27k 65 17 14

Hello @efe.sen

You can find more information about RDP Authentication rate limitation and other detail from the following resources:

The Python example code is available on the RDP API - Download page. It saves an access token to a file and then the data-request example gets an access token from that file.


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

I can answer some questions only. Please see my answers below.

Question 1: Company Fundamentals: Batch Retrieval: Is there a way to retrieve fundamentals data as a batch?

Answer: I checked the https://apidocs.refinitiv.com/Apps/ApiDocs page, the Reference section shows that it supports multiple universes requests as follows:

fundamental.png

I did a quick test on the API Playground page, and it works fine.

fundamental-2.png

Question 2: Company Fundamentals: Parallel Requests: Is there a way to parallelize the requests for fundamental data retrieval?

Answer: You 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:


fundamental.png (39.2 KiB)
fundamental-2.png (62.5 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

Question 3: Historical Pricing: Macroeconomic Indicators: Is there a way to retrieve macroeconomic indicators (RIC codes ending with =ECIX) and company pricing history as a batch?

Answer: I am not sure about the Macroeconomic Indicators, but the Historical Pricing API supports the batch subscription via an HTTP Post message. I strongly suggest you try it on the API Playground page (https://apidocs.refinitiv.com/Apps)

interday-summaries.png

Question 4: Historical Pricing: Macroeconomic Indicators: Parallel Requests: Is there a way to parallelize the requests for historical pricing data retrieval?

Answer: About the parallelize the requests for historical pricing data, you 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:

Please note that the number of requests should not exceed the limit mentioned on the Reference page of the historical pricing endpoint.

About the rest of questions, I strongly suggest you check the Reference page of that API endpoint on the API Playground page for more detail.


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

Hi, thanks for your answers. Here is my update:

About Answer 1: So, at max I can retrieve 5 RIC codes at a time from company-fundamentals.

About Answer 2: I checked the reference page of company-fundamentals, but could not see any limitation regarding to the throttling, I was wondering if there is maximum limit of concurrent sessions.
Also, is it possible to use the same access token with parallel sessions? Let's say throttle rate is 5 (most of the time I saw that number in the different API references), do I need to get access for each individual sessions, or get token once and use it in concurrent sessions?

About Answer 3: I have also tried to use /data/historical-pricing/v1/views/interday-summaries endpoint with multiple macroeconomic indicators, but got the following error:screenshot-18.png

Answer 4: Probably going to use the same solution (if my assumptions are correct) as answer 2.


I am still wondering if it is possible to retrieve data with currency (for both fundamental and macroeconomic indicators), also which endpoint that I can utilize to check next earnings & release date for both fundamental and macroeconomic indicators.

Thanks in advance!


screenshot-18.png (58.8 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 @efe.sen

### company-fundamentals ###

I have checked with the Online Solution team; the team confirms that the endpoint supports maximum 5 RIC code per request.

### The API Limit ###

There is a API generic throttling limits information on the RDP API General Guidelines document as follows.

limit-1.png

I cannot find the limit information on the /data/company-fundamentals/v1/financial-statements/global/balance-sheet endpoint reference page, but there is a limit information on the /data/historical-pricing/v1/views/interday-summaries/{universe} endpoint reference page as shown below.

limit2.png

### is it possible to use the same access token with parallel sessions? ###

If the parallel requests are made by the same application/session, an application can use the same access token with a concurrent HTTP request messages to RDP.

However, if you have multiple applications, it is advisable to use multiple Machine-IDs to avoid the session stolen issue when refresh an access token.


limit-1.png (105.5 KiB)
limit2.png (62.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.

Upvotes
27k 65 17 14

Hello @efe.sen

Please see my answers (continue).

### /data/historical-pricing/v1/views/interday-summaries with Economic Indicator RIC ###

I re-checked the endpoint reference page on the https://apidocs.refinitiv.com/Apps/ApiDoc website. It says the endpoint supports Economic data request via the HTTP GET operation only. That means an application can request a single Economic RIC per request.

1720767508256.png

I did a quick test, but I do not have a permission to request this kind of RIC.

pricing.png

### About the Currency and Date information ###

The questions are involved both RDP technical and content side which I am not have a knowledge. I strongly suggest you contact the RDP support team directly. You can contact the team via https://myaccount.lseg.com/en/productsupport website.

I hope this information helps.


1720767508256.png (36.6 KiB)
pricing.png (57.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.

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.