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

Upvote
Accepted
16 4 3 4

Why does this get_data script fail?

Why does this script fail? x is a list with 200 RICs and attributes contains 22 fields. It even fails with chunksize=1.

chunksize = 5
i=0
w,err=ek.get_data(x[i:i+chunksize], attributes, { 'SDate': 0, 'EDate': -5, 'FRQ': 'FY', 'Curn': 'EUR'})    
with open('SAMPLE.csv', 'a') as f:
        w.to_csv(f, sep=';',decimal=',')
for i in range (chunksize, len(x), chunksize):
    print(i)
    w,err=ek.get_data(x[i:i+chunksize], attributes, { 'SDate': 0, 'EDate': -5, 'FRQ': 'FY', 'Curn': 'EUR'})
    with open('SAMPLE.csv', 'a') as f:
        w.to_csv(f,  sep=';',decimal=',',header=False)

returns

5
10
15
20
Backend error. 400 Bad Request

Looking forward to your comments.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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.

@mbp

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the most appropriate reply.

If you have already known an answer, please share your answer, and then accept it. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
18.2k 21 13 21

Hi @mbp

Please refer to this guideline.

And read "What happens when a limit is reached?" section.

Basically, I believe that you are sending request too often.

You should add some delay between each requests.

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.

Upvotes
16 4 3 4

I know why. The time-out occurs at no. 21. Do you know how to make an exception handler, so it continues through the list?

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.

Upvotes
39.4k 77 11 27

@mbp
If you randomly experience an issue with data requests returning "Backend error. 400 Bad Request", first see my answer on this thread.
For the answer about how to catch exceptions when using get_data method see this thread.

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.