Not able to download data shareholders data for 4000 RICs

Aman
Aman Newcomer

I am running the code in my local jupyter notebook. I am trying to download the data for around 4000 tickers. But after some requests I get 400 Bad request error randomly. Can you please help me in resolving it??I have divided the tickers in 20 20 chunks per request. But this issue still persists. My code is below:


df_list= []

ric_list=list(coverage_df['ric'].unique())

# Divide the DataFrame into chunks of 20 rows

chunk_size=20

forstartinrange(0, len(ric_list), chunk_size):

    temp_df=rd.get_data(

        universe=ric_list[start : start+chunk_size],

        fields=[

            "TR.InvestorFullName",

            "TR.PctOfSharesOutHeld",

        ],

    )

    df_list.append(temp_df)

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Aman

    Thank you for reaching out to us.

    When a request fails because the platform is overwhelmed, an HTTP response with status code 400 and the message "Backend error. 400 Bad Request" is returned. Then the Python library raises an EikonError exception with the following message:.

    image.png

    This was mentioned on the Eikon Data API Usage and Limits Guideline. To handle this error, the application can use the try/except block to implement the retry logic, as mentioned on this discussion.