Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

Requesting large amount of data

I am using Eikon API to get daily data on an index constituents over a large period of time (10-20 years), but I keep receiving "Backend error. 400 Bad Request". I think it might be because of a request limit, since the code works smoothly for small data ranges. This is the part of code where it fails:

RIC = '.OEX'



def get_tickers_by_date(RIC, date):

    data, _ = ek.get_data(f"0#{RIC}({date})", ["TR.CompanyName"])

    all_tickers = list(data.Instrument)

    return all_tickers



#start and end date

start_date = str(20100101)

end_date = str(20230531)



dates = [str(i).split(' ')[0] for i in pd.date_range(start_date, end_date)]



all_data = {}

for i, date in enumerate(dates):   

    all_data[date] = get_tickers_by_date(RIC, date)

    if i % 100 == 0: 

        print(f"Processed date {date}, iteration {i}")


Is there a more efficient way of getting the desired data over a long data range?

eikon-data-apipython#technology
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
5.5k 18 2 7

Hi @Matej.Balazovic ,


That is perhaps related to the API overload. My colleague @jason.ramchandani01 is suggesting a workflow to overcome the issue in this thread. You may want to have a look and see if that can be applied to your case.


Best regards,

Haykaz

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.