Dear all,
I was wondering if there is a solution to get a time series list through the python api. It can easily be computed in Excel but I do not manage get the results in python. Thanks in advance
Dear all,
I was wondering if there is a solution to get a time series list through the python api. It can easily be computed in Excel but I do not manage get the results in python. Thanks in advance
Do you mean the symbol lookup?
You can look up symbols via API by using DS.SYMBOLOOKUP but its feature is quite limited.
df1 = ds.get_data(tickers="MSCI USA - DAILY", fields=["DS.SYMBOLLOOKUP(Count=50)"], kind=0)
The output is:
We suggest clients to use the DataStream website instead to search for items.
After getting a list, you can use the API to retrieve time-series data.
item_list=ds.get_data(tickers="LFTSE1000518|L",fields =["NAME"], kind=0) batch_list = np.array_split(item_list['Instrument'],len(item_list)/20) data = None for batch in batch_list: temp_dat = ds.get_data(tickers=','.join(batch), fields=['P','MV'], start='-3M', end='-1M') #kind=1 if data is None: data = temp_dat else: data = data.join(temp_dat) data
Please explain more about the question.
You can use the Python DatastreamWS API to retrieve time-series.
ds.get_data (tickers='@AAPL, @FB, @GOOGL, @MSFT, U:JPM', fields=['P','MV'], start='-3M', end='-1M')
The output looks like:
Thanks for your answer, I would like the equivalent of (I do not know the list of constituants in advance)