Retrieve some chemistry industry companies' data using API
I want to pull some time series metrics (Revenue, Market Cap, P/E, Interest Costs, Earnings, etc.) for the top 25 chemicals business (by market cap as of Sep 2022) in several different regions. How to get these data through API? Someone helps me to download the data in excel, but load of human Erros. Think if I can use Refinitiv API may ensure the accuracy of data retrieved. Thank you
Best Answer
-
The function returns a Python dataframe so you can save it to a CSV file by using the following code.
rics.to_csv("output.csv")
You can also specify date fields in the field list, as shown below.
rics, err = ek.get_data(screener_exp, fields = ['TR.Revenue.Date','TR.Revenue','TR.PE.Date','TR.PE','EARNINGS'])
The output is:
1
Answers
-
Sorry about the issue that you are facing.
You can use a screener expression with Eikon Data API to get the required RICs. Then, use the retrieved RICS to get the required data.
The code looks like this:
screener_exp = 'SCREEN(U(IN(Equity(active,public,primary))), IN(TR.HeadquartersRegion,"Asia"), IN(TR.GICSIndustryCode,"151010"), TOP(TR.CompanyMarketCap(SDate=2022-09-30), 25, nnumber), CURN=USD)'
rics, err = ek.get_data(instruments=[screener_exp], fields = ['TR.Revenue','TR.PE','EARNINGS'])
ricsThe screener expression gets the top 25 chemicals business (IN(TR.GICSIndustryCode,"151010")) by market cap as of Sep 2022 (TOP(TR.CompanyMarketCap(SDate=2022-09-30)) in Asia (IN(TR.HeadquartersRegion,"Asia")).
Then, use the retrieved items to get TR.Revenue, TR.PE and EARNINGS.
The output is:
You can use the screener app to generate screener expressions and use the Data Item Browser to search for available fields.
I hope that this information is of help
1 -
Thank you so much @Jirapongse on your comments, it really helps. I am not familiar with the platform. Do you know after I get the retrieve data table results, how to save it in the format I want (e.g. csv, excel etc.) and download to my local desktop? And also do you know how to show the date column corresponding to metrics in the data results? Thanks for your time and help in advance!
0 -
Thank you so much for your help! Appreciated.0
-
@Jirapongse thanks for your response to my questions earlier. I'm now want to normalise the timeseries dataset, (get rid of some obvious outliers), do you know is there a function/way I can do that in the codebook or the Refinitiv workplace? Many thanks for your time in advance.0
-
The output is in Pandas Dataframe. You can use the Dataframe functions to manage the data. You can find a lot of examples via Google, such as Remove outliers from Pandas DataFrame.
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 中文论坛