An issue has been encountered while using the LSEG Python library to retrieve news data. Although the expected daily request limit is 10,000, the number of successful requests appears to be limited to approximately 2,000 to 3,000 per day.
def refinitiv_get_news_body(row):
if row['status'] == "COMPLETED":
#print("body found locally")
return row["body"], "COMPLETED"
print(f"Requesting body for headling: {row['storyId']}")
return ld.news.get_story(row["storyId"]), “COMPLETED”
ld.open_session()
df_body = df_input.copy()
try:
for idx, row in df_body.iterrows():
body, status = refinitiv_get_news_body(row)
df_body.loc[idx, "body"] = body
df_body.loc[idx, "status"] = status
except Exception as e:
logger. Error(f"Error: {e}”)