How to download the company by NACE through API?

I wanted to download the company by nace and I used this python code import refinitiv.data as rd
rdp.open_desktop_session('19f8a5692b6541da8042ea982f7912f3439c2e45')
import refinitiv.data as ld
ld.open_session()
def get_companies_by_nace(nace_code):
"""Get list of companies for a given NACE code"""
universe_query = f'NACE2.CODE={nace_code}'
companies = rd.get_data(
universe=[universe_query],
fields=['RIC', 'NACE2.CODE', 'NACE2.DESCRIPTION', 'COMPANY_NAME']
)
return companies
However it always return empty companies. Could you please check if I am using the right code

Tagged:

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @chinthanah.m

    Thank you for reaching out to us.

    This forum is dedicated to software developers using LSEG APIs. The moderators on this forum do not have deep expertise in every bit of content available through LSEG products, which is required to answer content questions such as this one.

    The best resource for content questions is the Helpdesk support team, which can be reached by submitting queries through LSEG Support. The support team will either have the required content expertise ready available or can reach out to relevant content experts to get the answer for you.

    You need to ask for the Excel formula, such as =RDP.Data, that can be used to retrieve the required data.

    Otherwise, you can use the Data Item Browser tool to search for fields and parameters.

    Then, we can help you converting that formula to Python code.