For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
2 0 0 3

API Not retreiveng the same data as TR in excel

Hi, Happy friday to all.

Im currently having this issue that i don´t understand why it´s happening, im obtaining the contituents of a Fund and from excel With the same formula im using in Python Im just getting a limited amounb of 10 instrumenst per run however in excel everytime and day i´ve actualized thesheet I Get the correct whole data, the fund´s name is LP68443548, so for this question's case: Nameseq['Equity Funds'][0] =LP68443548.

The code of my spyder is as it follows:

import eikon as ek

import numpy as np

import pandas as pd

import matplotlib

import pandas_datareader as dr

ek.set_app_key('KEY') #real key would go here


Nameseq = pd.read_excel('fundsrics.xlsx',sheet_name='Equity')

Namesfi = pd.read_excel('fundsrics.xlsx',sheet_name='Fixed Income')

dfequ,e=ek.get_data(Nameseq['Equity Funds'][0],['AVAIL(TR.ETPConstituentRIC,TR.FundHoldingRIC);AVAIL(TR.ETPConstituentName,TR.FundHoldingName);AVAIL(TR.ETPConstituentWeightPercent/100,TR.FundPercentageOfFundAssets/100)'])


Also in Refinitiv's Codebook happens this problem, just getting 10 of the 32 correct number of instuments as excel does by inputting the following code in your CODEBK:

df,e= ek.get_data(

instruments = ['LP68443548'],

fields = ['AVAIL(TR.ETPConstituentRIC,TR.FundHoldingRIC)']

)


I´ve tried putting Screenshots but i dont know why this platform is not letting me.

Thanks in advance!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikon
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
707 2 1 1

Hi @mherrerag,

I may not fully understand your situation, but I checked that sample fund is a mutual fund, not an ETP (Exchanged Traded Products such as ETFs). So I doubt your code should use TR.ETPxxxx functions to get the holdings. Generally, I believe TR.ETPxxxx functions only works for ETP. But Lipper's TR.Fundxxxx functions should work for all type of funds, including ETFs.

For using TR.Fundxxxx functions in Python to get the holdings data, I believe the default is only return the top-10 holdings, and you need to specify the max. amount of items returned. The code below should work as long as the full holdings does not have more than 1,000 items:


df,e = ek.get_data('LP68443548', ['TR.FundHoldingRIC','TR.FundHoldingName',
        'TR.FundPercentageOfFundAssets',
        'TR.FundNumberOfShares',
        'TR.FundNumberOfSharesChanged'],
        {'Endnum':'1000'})

I guess you just need to specified the 'Endnum' in your code for you to get more than 10 items.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
2 0 0 3

Thank you so much, this worked perfectly!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea