Extremely slow and inconsistent API

rd.get_data(batch,["TR.RIC","TR.ISIN","TR.PriceClose(SDate=0M,Curn=INR)","TR.CLOSEPRICE(SDate=0M,FILL=PREVIOUS,Adjusted=0,Curn=INR)","TR.SharesOutstanding(SDate=0M)",'TR.GICSSector','TR.GICSIndustry','TR.GICSSubIndustry','TR.AssetCategory'])

I have a variable ric_list which contains approx 2k RICs.
In the above code, I try to fetch the RICs in batches with each batch being split in sets of 100 or 200 using a for loop implementation.
After a while I keep on facing timeout issues.

For instance the first three batches get executed in say 1.5 minutes, but later the code gets stuck and there is no response at all for approx 15-20 mins. It might run after that or it might fail.

Also it randomly returns Blank Values for cases even where there is a retrievable value.

I have also noticed that for some reason the InstrumentID gets returned with Capital on. e.g. BRKb.OQ becomes BRKB.OQ. Is there a way to fix this please/

Would appreciate the help as it is affecting my workflow.


Answers

  • Hello,

    As per my knowledge, To address the timeout and blank value problems, you could try introducing a delay between batch requests to avoid hitting any rate limits. You might also want to check if there are any specific API limits on the number of requests or data volume per minute.

    For the issue with InstrumentID capitalization, you can try applying a case conversion function after the data retrieval to standardize the format. This might help maintain consistency.

    I hope this will help you!


    Thanks!