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

Data turns to NA while extending time series request

Hi all, I am trying to retrieve some data but when I try to extend the time series (from 2019 to 2020 or more), I am loosing the data for some series... Do you know why? how to fix this issue? Ideally I would like to retrieve data up to today.

Clémence

1678109990652.png1678109957995.png


eikon-data-api#producttime-series
1678109957995.png (19.6 KiB)
1678109990652.png (22.6 KiB)
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.

Upvote
Accepted
10.5k 19 6 9

@ClemenceD Thanks for your question - so this is because you are probably coming up against some API Limits detailed here. In your case you have probably reached this limit of 3000 data rows per call :

  • get_timeseries: The current limit value (10-Oct-2019) is 3,000 data points (rows) for interday intervals and 50,000 data points for intraday intervals. This limit applies to the whole request, whatever the number of requested instrument.

So you could just loop for each RIC yourself then concatenate - this code does this with some error handling:

import time
instruments = ['CAD=','US2YT=RR','CA2YT=RR']
s = '2012-01-06'
e = '2023-03-01'
inv = 'daily'
data1 = pd.DataFrame()

for i in instruments:
    succeed = False
    while succeed == False:
        try:
            df1 = ek.get_timeseries(i,  # RICs
                fields=['CLOSE'],  # fields to be retrieved
                start_date=s,  # start time
                end_date=e,  # end time
                interval=inv)
            df1.rename(columns = {'CLOSE': i}, inplace = True)
            if len(data1):
                data1 = pd.concat([data1, df1], axis=1)
            else:
                data1 = df1
            succeed = True
        except:
            time.sleep(0.1)
        else:
            break
    else:
        var = "p"
data1

1678114814019.png

I hope this can help.


1678114814019.png (132.7 KiB)
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 1 1 1

Very useful, thank you! What if we need would like to extend the time series over 3000 observations to get earlier data, say from 2000, for all series?

Many thanks

Clémence

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.