Can I get more than 60000 points tick data data thru API?

Best Answer

  • Yes, you can, but not in a single request. get_timeseries method returns a max of 50K rows for a single request. If you need more than 50K ticks you need to submit several requests using for example the timestamp on the earliest tick received in response to the first request as input for the value of end_date parameter of the next request.
    The max depth of tick history available through Eikon is 90 days.
    Here's an example of code retrieving 149,997 latest ticks in a loop using 3 requests. Each request returns 50K ticks, but one tick needs to be dropped to avoid duplicates in the resulting dataframe.

    import eikon as ek
    import pandas as pd
    import datetime as dt
    ek.set_app_key(<your_app_key_here>)
    ric = 'EUR='
    end_date = dt.datetime.utcnow()
    df = pd.DataFrame()
    for i in range(3):
    try:
    tmp_df = ek.get_timeseries(ric, interval = 'tick',
    start_date = end_date + dt.timedelta(-100), end_date = end_date)
    end_date = tmp_df.index[0].to_pydatetime()
    tmp_df = tmp_df.drop(tmp_df.index[0])
    df = tmp_df.append(df)
    if len(tmp_df) < 49999:
    print('No more tick history available for RIC ' + ric)
    break
    except ek.EikonError as err:
    print(err)
    break
    df

Answers

  • Thank you Alex... for some reason I thought one time I pulled a large series, but I must be mistaken... they have certainly not gone out of their way to provide a robust interface for pulling recent ticks....