Error while attempting to download bulk news data

Xim_O
Xim_O Newcomer

I have a python script to down load news data using this function

response = news.headlines.Definition(ric, date_from=start, date_to=end, count=999999).get_data()

I am attempting to down load bulk data for a list of 600 RICs by passing one RIC at a time into the function above. About 20 RICS in I get the following error.

What is the cause of this and how do I solve for it?

---------------------------------------------------------------------------LDError Traceback (most recent call last)Cell In[3], line 29 26 pbar2.set_postfix({"status": f"querying {year}"}) 27 pbar2.refresh()---> 29 response = news.headlines.Definition(ric, date_from=start, date_to=end, count=999999).get_data() 31 count = 0 33 # Handle both response formatsFile c:\Users\mwu\miniconda3\envs\prodigal_env\Lib\site-packages\lseg\data\content\news\headlines\_definition.py:104, in Definition.get_data(self, session, on_page_response) 72 """ 73 Returns a response from the API to the library 74 (...) 101 >>> response = definition.get_data() 102 """ 103 self._kwargs["on_page_response"] = on_page_response--> 104 return super().get_data(session)File c:\Users\mwu\miniconda3\envs\prodigal_env\Lib\site-packages\lseg\data\content\news\_news_data_provider_layer.py:13, in NewsDataProviderLayer.get_data(self, session) 11 def get_data(self, session: Optional["Session"] = None): 12 session = get_valid_session(session)---> 13 response = super().get_data(session) 14 return response... 29 error = LDError(code=error_code, message=error_message) 31 error.response = response---> 32 raise errorLDError: Error code 429 | Too many requests, please try again later.

Answers