first time user - please help with the following

I am trying to pull data from Refinitiv using Python via an API key. Normally, I use an Excel add-on, but this time, the data I need requires a lot of iterations, so I had to revert to Python with the help of Chatgpt, although I am not confident using it. As expected, the code generated by Chatgpt doesn't work, and I cannot troubleshoot, even after asking colleagues with an expert knowledge level of Python, because of Refinitiv’s specific concepts.
Let me explain what information I need, and maybe you can point me in the right direction or offer a solution to getting the data. I want to call all the active companies in the public and private universe in Refinitiv. Then, retrieve their ticker (instrument) code, company name, industry, and country(headquarters). Then, in the next columns, I need information on revenue, profitability, and number of employees for now (I will need to add some other variables at later stages) (all historical-time series).
I could successfully write a simple code, see below, and pull data. However, I have a rather ridiculous filter here, I am only calling companies with more than 2mn employees. So, the code worked. But when I tried for all companies, it didn't due to time-out or 7500 identifier limit on Refinitiv side, most probably.
Can I ask how can I change the code below to pull data for all companies in public private universe: "
import os
os.environ["LD_LIB_CONFIG_PATH"] = "Configuration"
import lseg.data as ld
from lseg.data.discovery import Screener
import datetime
from IPython.display import display, clear_output
ld.open_session()
mklist = Screener('U(IN(Equity(active,public,private,primary))/*UNV:PublicPrivate*/), TR.Employees(Period=FY0)>=0,CURN=USD')
print(list(thelist))
mkframe = ld.get_data(thelist,
fields=['TR.Revenue.date','TR.ISINCode','TR.CommonName','TR.HQCountryCode','TR.NAICSSector', 'TR.Revenue', 'TR.TotalAssets', 'TR.Employees', 'TR.OperatingProfit'],
parameters={'SDate':0, 'EDate':-10, 'curn':'usd'})
mkframe.to_csv('todaysdate.csv', index=False)
"
The resulting list is just Walmart Inc, China, People's Republic of (Government), All China Federation of Supply and Marketing Cooperatives, and Gobierno Federal De Los Estados Unidos Mexicanos. I want this same table but for +16000 companies in the Refinitiv universe. However, I am limited by the number of "identifiers"(number of companies in one query)from Refinitiv side. Therefore I need to do this in bathces. The filtering criteria "TR.Employees(Period=FY0)>=2000000" does not serve any function other than limiting the firms pulled in one go, so any other smarter. option would be preferred. Could you help me in accessing this data for my research please?
Thank you,
Melik
Best Answer
-
Thank you for reaching out to us.
You can use the screener or search API to search for items but there are limitations. However, these APIs and libraries are not designed for bulk download.
Requesting a lot of data may load the server and the request can be timeout.
You may contact your LSEG account team or sales team directly to discuss this requirement. We may have other products that are more suitable for this kind of usage.
0
Answers
-
Thank you Jirapongse.
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 33 Data Model Discovery
- 682 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.8K Refinitiv Data Platform
- 622 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 83 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛