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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
97 2 4 10

eikon data api bulk data

I tried to obtain constituent data but it only returns 10 records.

For example,

index_ric = "MCHI.OQ";

df, err = ek.get_data([index_ric],['TR.FundHoldingRIC','TR.FundHoldingName','TR.FundCountryOfDomicile','TR.FundPercentageOfFundAssets','TR.FundNumberOfShares','TR.FundNumberOfSharesChanged'])
df.columns=['INDEX_RIC','RIC','NAME','COUNTRY','PctWgt','SHARES','SHARES_CHANGE']

I expect about 300 names.

=TR("MCHI.OQ","TR.FundHoldingRIC;TR.FundHoldingName;TR.FundCountryOfDomicile;TR.FundPercentageOfFundAssets;TR.FundNumberOfShares;TR.FundNumberOfSharesChanged","StartNum=1 EndNum=1000 CH=Fd RH=IN",B2)


apidataconstituents
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
Accepted
39.2k 75 11 27

In =TR function you have StartNum and EndNum parameters, whereas in get_data method they're missing. Add these parameters and you'll get the full result.

ek.get_data('MCHI.OQ',
    ['TR.FundHoldingRIC','TR.FundHoldingName','TR.FundCountryOfDomicile',
     'TR.FundPercentageOfFundAssets','TR.FundNumberOfShares',
     'TR.FundNumberOfSharesChanged'],
    {'StartNum':'1', 'EndNum':'1000'})
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
97 2 4 10

thank you!

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