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)