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 1

Hello I'm not sure if I'm a hitting some sort of API Limit in EIKON when running my for loop for each 'RIC' needed using python.

here is my original for loop that i am limiting to only 50 Rics and still not getting the correct data set.

API_Key = ek.set_app_key('hidden')

fields=['Timestamp','Value']

start1 = (date.today()-timedelta(days=20*365)).strftime('2020-01-01')

end1 = date.today().strftime('%Y-%m-%d')


rng = pd.date_range(start= start1 ,end=end1 ,freq='D')

Calendar= pd.DataFrame({ 'Date': rng})

TR1_50_Rics=["TD-ABM-CPT","TD-ABM-DUR","TD-ABM-HOU","TD-ABM-INC","TD-ABM-JGA","TD-ABM-LAV","TD-ABM-LIT","TD-ABM-PHL","TD-ABM-RDM","TD-ABM-SIN","TD-ABM-FAW","TD-ABM-FAW2","TD-ABM-FAW3","TD-ABM-LIV","TD-ABM-LIV2","TD-ABM-LIV3","TD-ABM-RDM2","TD-ABM-RDM3","TD-ABM-VNT","TD-ABM-VNT2","TD-ABM-VNT3","TD-ABM-TLL","TD-ABM-TLL2","TD-ABM-TLL3","TD-ABM-BRB","TD-ABM-AUG","TD-ABM-AUG2","TD-ABM-AUG3","TD-ABM-LAV2","TD-ABM-CHI","TD-ABM-CHI2","TD-ABM-CHI3","TD-ABM-KIK","TD-ABM-KIK2","TD-ABM-KIK3","TD-ABM-YPG","TD-ABM-YPG2","TD-ABM-YPG3","TD-ABM-NGB","TD-ABM-NGB2","TD-ABM-NGB3","TD-ABM-TNJ","TD-ABM-TNJ2","TD-ABM-TNJ3","TD-ABM-SIN2","TD-ABM-SIN3","TD-ABM-SRI","TD-ABM-SRI2","TD-ABM-SRI3","TD-ABM-MTP"]


Transport_df_1 = []

for TR1_50_Ric in TR1_50_Rics:

Temp_Prod_df_1 = ek.get_timeseries(TR1_50_Rics,

fields,

start1,

end1,

normalize=True)

Temp_Prod_df_1= Calendar.merge(Temp_Prod_df_1,on='Date',how='left')

Temp_Prod_df_1['Weekday'] = Temp_Prod_df_1.apply(lambda x :x.Date.weekday(), axis=1)

Temp_Prod_df_1= Temp_Prod_df_1.rename(columns={'Security' : 'EIKON_RIC','Value' : 'Close'})

Temp_Prod_df_1 = Temp_Prod_df_1[['Date', 'EIKON_RIC','Close','Weekday']]

Temp_Prod_df_1['Close'] = Temp_Prod_df_1.Close[Temp_Prod_df_1.Weekday <= 5].fillna(method='pad')

Temp_Prod_df_1['Close'] = Temp_Prod_df_1.Close[~Temp_Prod_df_1.Weekday <= 5].fillna(method='bfill')

Temp_Prod_df_1['EIKON_RIC'] = Temp_Prod_df_1.EIKON_RIC[Temp_Prod_df_1.Weekday <= 5].fillna(method='pad')

Temp_Prod_df_1['EIKON_RIC'] = Temp_Prod_df_1.EIKON_RIC[~Temp_Prod_df_1.Weekday <= 5].fillna(method='bfill')

Transport_df_1.append(Temp_Prod_df_1)

Final_Transport_df = pd.concat(Transport_df_1)

Final_Transport_df= Final_Transport_df[['Date', 'EIKON_RIC','Close']]

Final_Transport_df=Final_Transport_df.drop_duplicates().dropna()

Here is my test to see if the data is coming back correctly.

xx = ek.get_timeseries(["TD-ABM-CPT","TD-ABM-DUR","TD-ABM-HOU","TD-ABM-INC","TD-ABM-JGA","TD-RDM2-SIN"],

fields,

start1,

end1,

normalize=True)


Thank you.


api-limits
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
Accepted
80k 257 52 75

@daniel.burns

From the code, you need to use TR1_50_RIC instead of TR1_50_Rics when calling the get_timeseries method.

Transport_df_1 = []

for TR1_50_Ric in TR1_50_Rics:
    Temp_Prod_df_1 = ek.get_timeseries(TR1_50_Ric, fields, start1, end1, normalize=True)
...
    
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
10.3k 18 6 9

@daniel.burns This is returning for me fine:

fields=['Timestamp','Value']
start1 = datetime(2020,1,1).strftime('%Y-%m-%d')
end1 = datetime.today().strftime('%Y-%m-%d')


xx = ek.get_timeseries(['TD-ABM-CPT','TD-ABM-DUR','TD-ABM-HOU','TD-ABM-INC','TD-ABM-JGA','TD-RDM2-SIN'],fields,start1,end1,normalize=True)
xx

Are you able to run this code and get the same result?

Screenshot 2021-10-01 at 16.57.21.png


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
1 0 0 1

Yes i am getting the same results...but the problem is happening in my for loop. the screen shot you shared was my testing the results of my for loop

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.