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

When running the code for fetching market data, we got the error shown in the screenshot.

Hi Team,

Could you please provide some guidance of data fields and data fetching functions in both Excel and Python API? And sometimes the connection is not stable when fetching a larger amount of stock historical price data when running Python API interface, so it get time out error code when we are running loops for getting stock data. Do you have any suggestions about fetching data more smoothly?


When running the code for fetching market data, we got the error shown in the screenshot. May you please advise the reason? Thank you.

1706772009318.png

Thank you!

eikon-data-api#productpython api
1706772009318.png (93.1 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
5.6k 18 2 7

Hi @Edwin.Kwan ,


Since I don't know what is the API call and library you are using, below I will provide a general workflow for ingesting larger amount of data iteratively. So as shown below you can wrap your code under try except statement and introduce a while loop to retry a couple of times which will help you getting the data you are after more smoothly.

max_steps = 3
step = 0
while step < max_steps:
    try:
        # your API call goes here
        break
 
    except rd.errors.RDError as e: 
        print("RDError code :", e.code) 
        print("RDError message:", e.message)
        step +=1 
        continue

Hope this helps.


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.