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.

Hello @alexander.tapper

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

hi @alexander.tapper , Please knote that the answer below was marked as 'Accepted'. Please do let us know if this is not appropriate.

1 Answer

· Write an Answer
Upvotes
Accepted
5.8k 21 2 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.

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.