Issues pulling historical MSCI data in Eikon API

I have an issue pulling in data from MSCI World and MSCI North America from 1969 and forward.

I can easily get the data from 2016 till today, but I need the entire history


If I use the ek.get_timeseries() function it seems that I am limited in the amount of data I can retrieve.

If I on the other hand use the ek.get_data() function, I get no data from 1969 even though the Datastream Navigator says that there should be data dating back to 31/12/1969.

Are you able to assist on this?


1647521854814.png

1647510341740.png

Tagged:

Best Answer

  • raksina.samasiri
    Answer ✓

    hi @sami01 ,

    According to Eikon Data API Usage and Limits Guideline, call-based limit of get_timeseries is 3,000 data points (rows) for interday intervals. This limit applies to the whole request, whatever the number of the requested instruments.

    So for 2 instruments, the limit of get_timeseries is 1500 (from 3000/2) rows per call. You may call the get_timeseries function as a batch of the 1500 dates per call. The code below can be used to generate the date-ranges between start and end dates

    days = 1500
    start_date = datetime.datetime.strptime('1969-12-31', '%Y-%m-%d')
    end_date = datetime.datetime.strptime('2000-01-01', '%Y-%m-%d')

    date_list = []
    start_range = start_date
    while start_range < end_date:
    end_range = start_range + datetime.timedelta(days=days)
    if end_range > end_date:
    end_range = end_date
    start_end = [start_range.strftime('%Y-%m-%d'), (end_range).strftime('%Y-%m-%d')]
    date_list.append(start_end)
    start_range += datetime.timedelta(days=days + 1)
    date_list

    1647528806600.png

    Then you can call get_timeseries for each date range, for example,

    import numpy as np

    columns = ['Date']
    for ric in rics:
    columns.append(ric)
    dfs = pd.DataFrame(columns = columns).set_index('Date')
    dfs.columns.name = 'CLOSE'
    for dates in date_list:
    df = ek.get_timeseries(rics, fields='CLOSE',start_date=dates[0], end_date=dates[1])
    # if .dMINA00000PUS' have no data on the requested date range, restructure the dataframe so it can be appended properly
    if len(df.columns) == 1:
    df = df.rename(columns={'CLOSE':df.columns.name})
    df.columns.name = 'CLOSE'
    df['.dMINA00000PUS'] = np.nan
    dfs = dfs.append(df)

    display(dfs)

    1647529449428.png

    Hope this could help

Answers

  • Hi @sami01,

    About the null value of instrument .dMINA00000PUS's close price between dates 12/31/1969 and 6/5/1998, it is a content question. This forum is not the best place to ask content questions. The moderators here do not have deep expertise in every type of content available through Eikon.

    For an authoritative answer to any content questions, the best resource is the Refinitiv Content Helpdesk, which can be reached using any method below

    However, case number 11049931 was raised on behalf of you and the content support team is going to contact you regarding this soon.

  • as a reference, below is an answer from case number 11049931

    Please be informed, we have sourced the values for “MSCI North America” <.dMINA00000PUS> from 08th June 1998 to our system ,so we don’t have the data prior to 1998 June on our product.