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:
- Batch Retrieval: Is there a way to retrieve fundamentals data as a batch?
- Parallel Requests: Is there a way to parallelize the requests for fundamental data retrieval?
- Next Earnings Date: What is the best way to determine the next earnings date for a ticker?
- Currency Consistency: Is it possible to retrieve fundamental data only in USD for companies using different currencies?
Historical Pricing:
- Macroeconomic Indicators: Is there a way to retrieve macroeconomic indicators (RIC codes ending with
=ECIX
) and company pricing history as a batch? - Parallel Requests: Is there a way to parallelize the requests for historical pricing data retrieval?
- 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. - 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.
Best Answer
-
Hello @efe.sen
You can find more information about RDP Authentication rate limitation and other detail from the following resources:
- Limitations and Guidelines for the RDP Authentication Service article.
- RDP API - Tutorials: All About Token
- RDP API - Tutorials: Authorization in Python
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.
0
Answers
-
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:
I did a quick test on the API Playground page, and it works fine.
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:
0 -
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)
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:
- Concurrent HTTP requests in Python
- Fastest parallel requests in Python
- Python Requests: Make Concurrent Requests
- Parallel web requests in Python
- How to call multiple API requests concurrently in Python
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.
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: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!0 -
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.
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.
### 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.
0 -
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.
I did a quick test, but I do not have a permission to request this kind of RIC.
### 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.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛