Infront Desktop API for Python

Instructions for retrieval of time series: GetHistory()

Import the Infront library

In [1]:
from InfrontConnect import infront

Insert your login credentials: your terminal user and password

In [3]:
infront.InfrontConnect(user = "myuser",password = "mypassword")
 Connected to Infront Desktop API for Python 3.

**Disclaimer** 
 End-User agrees not to redistribute any such Information and to comply with any 
 restrictions placed on such information by the providers thereof, hereunder but 
 not limited to acceptance of and compliance with Data Providers’ and/or other 
 third party license agreements. 
 Customer agrees to indemnify and keep indemnified Infront and its affiliates harmless 
 from and against any loss, damage, liability, cost, charges and expenses, including 
 reasonable legal fees, arising out of any breach on part of Customer with respect to 
 its obligations to obtain prior approvals from appropriate Data Providers and to 
 comply with any applicable, conditions, restrictions, or limitations imposed by such 
 Data Providers. 

Use GetHistory() to fetch historical time series. The output is a dictionary that contain Pandas DataFrames.

Formats

tickers: A list containing strings in the format "FEED:TICKER", i.e. tickers = ["NYS:BLK","NYS:CAT"]

fields: A list containing valid strings, i.e. fields = ["last","bid","ask","volume","turnover"]

start_date: A string with the date in a YYYY-MM-DD format, i.e. "2017-06-06"

end_date: A string with the date in a YYYY-MM-DD format, i.e. "2017-06-06"

In [4]:
MySymbols = infront.GetHistory(tickers = ["NYS:BP","NYS:BRK.B"], fields = ["bid","ask","turnover","volume","last"],start_date = "2017-06-21", end_date = "2017-05-22")
In [6]:
MySymbols['BP']
Out[6]:
ask bid last turnover volume
date
2017-05-22 36.95 36.82 36.960 2.332507e+08 6302869.0
2017-05-23 36.93 36.80 36.930 1.575259e+08 4258443.0
2017-05-24 37.16 36.85 36.895 2.035401e+08 5507565.0
2017-05-25 36.49 36.40 36.395 3.148840e+08 8605443.0
2017-05-26 36.46 36.41 36.410 1.223791e+08 3362022.0
2017-05-30 36.50 36.27 36.280 4.703852e+08 7053589.0
2017-05-31 36.41 36.16 36.150 2.815436e+08 7775964.0
2017-06-01 36.26 36.25 36.240 2.269039e+08 6252619.0
2017-06-02 35.92 35.87 35.910 2.158363e+08 6019583.0
2017-06-05 36.07 35.93 36.075 1.443149e+08 4006303.0
2017-06-06 36.20 36.00 36.240 1.559371e+08 4328494.0
2017-06-07 35.42 35.37 35.440 3.097888e+08 8703641.0
2017-06-08 35.20 35.00 35.410 2.279749e+08 6433782.0
2017-06-09 35.86 35.63 35.821 2.024137e+08 5671667.0
2017-06-12 36.03 35.81 35.800 1.458350e+08 4067397.0
2017-06-13 36.05 35.92 36.030 1.464208e+08 4073558.0
2017-06-14 35.35 35.32 35.340 1.871305e+08 5275829.0
2017-06-15 35.25 35.18 35.230 2.233121e+08 6352614.0
2017-06-16 36.02 35.80 36.000 1.757794e+08 4909793.0
2017-06-19 36.10 35.96 36.030 2.031372e+08 5620654.0
2017-06-20 35.09 34.97 34.990 2.969246e+08 8499186.0
2017-06-21 34.65 34.57 34.630 2.296686e+08 6617025.0
In [ ]: