question

Upvotes
Accepted
1 0 0 0

Repeated Failures on TimeSeries Query from Eikon API

Eikon API

Python

Windows

df = ek.get_timeseries(ric, start_date=start_date, end_date=end_date, fields='Close')

This request fails frequently leading to missing data, I either get "Error code 2504 | UDF Core request failed. Gateway Time-out" or "Error code 500 | Backend error. 500 Internal Server Error".

I have tried slowing down the request frequency and also handling the errors to create the request again so that the data doesn't get missed but this does no work.

Passing a list of RIC codes seems to work better but there appears to be a limit on the date range meaning the I cannot get the length of time series I need.

This is the function used and I am passing in a list of RICs for FX rates, gas settlement, Brent settlement, Power settlement and EUA settlement.

def produce_settlement_df(RICs, start_date, end_date):
    for ric in RICs:
        try:
            if RICs.index(ric) == 0:
                df = ek.get_timeseries(ric, start_date=start_date, end_date=end_date, fields='Close')
                df = df.rename(columns={"CLOSE": ric})
            else:
                temp_df = ek.get_timeseries(ric, start_date=start_date, end_date=end_date, fields='Close')
                temp_df = temp_df.rename(columns={"CLOSE": ric})
                df = df.merge(right=temp_df, how='outer', left_index=True, right_index=True)
        except ek.EikonError as e:
            print(e)
            print(ric)
    return df

1711452234279.png

eikoneikon-data-apipythonworkspace#technologyerror
1711452234279.png (143.8 KiB)
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
6.5k 21 3 6

Hi @alexander.tapper,

Defensive code steps were added in the RD Lib. for Python; I would suggest using that to see if it resolves your issue.
To do so, please try get_history.

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.

This function isn't viable for querying many RICs though, as it creates a request per RIC, therefore you breach the 10,000 daily request limit very fast - or at least I do. If you are restricted to using the old Eikon API, like me, is it recommended to just implement staggered retries on the failed requests?

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.