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

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @sarah.liu

    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:

    1667895456174.png

Answers