hi , when i use python to get some data from eikon, i got this error
Error code 429 | Client Error: Too Many Requests - Too many requests, please try again later
and this is my code:
import eikon as ek
df = ek.get_timeseries("USCPI=ECI",start_date="2018-01-27",end_date="2019-01-27",interval='monthly')
how can i fix this problem,thx
Let me add a real world experience to Chavalit's answer:
I have some Python code with a loop on 100 items. Inside the loop there is a request (tr.get_news_story). Running my code gave me a 429. After adding a 50 millisecond pause in the loop the error disappeared.
To add the pause I added this to my imports:
And here is the loop:
for i in enumerate(index): ... time.sleep(0.05) ...
You might need to tweak the pause duration to ensure you do not hit the limit. For my code, 30 ms sometimes worked, but sometimes it failed, so I finally settled for 50 ms.
Hope this helps.