How to use get_data with RIC, date combinations?

Hi all,

I imported a dataframe with RICs and dates. Now I would like to use get_data to retrieve market capitalization for all RICs at the specific dates. Is that possible with python eikon api?

Dataframe looks like this:

image

I tried the following :

idfy = pd.read_csv(\distcompfy.csv', encoding='utf-8')
mc, err =ek.get_data(list(idfy['RIC']), fields = ['TR.CompanyMarketCap.date', 'TR.CompanyMarketCap.value' ] , parameters={'Scale': 6, 'Curn': 'USD', 'SDate': list(idfy['date'])})

But Python returns: "Error code 400 | Backend error. 400 Bad Request"

Is there a way to retrieve the data?

Best

Simon

Best Answer

  • chavalit-jintamalit
    Answer ✓

    Hi @sile

    The problem is on the list of date in parameters.

    You cannot make a request with SDate as a list.

    If you want a range of date, you can follow this request.

    image

    But if you want a specific date not in range, you have to separate your request.

Answers