Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
REFINITIV
Question by tnksnsk314 · Feb 20, 2020 at 12:34 AM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikondatahistorical

Historical data : MarketCap of all listed companies in Japan.

I'm struggling with combining ① wiht ②. I'd greatly appreciate any suggestions you might have.


① I can get all listed companies in Japan with the below.

universe='SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/),IN(TR.ExchangeCountryCode,"JP"), IN(TR.InstrumentTypeCode,"ORD"), CURN=JPY)'

data, err = ek.get_data(instruments=universe, fields=['TR.CommonName'])

data.head()

② I can get the historical data of some companies' MarketCap like this.

data= ek.get_data(['2195.T','3639.T','3640.T','3641.T'], ['TR.CompanyMarketCap'],

{'SDate': '2019-8-31', 'EDate':'2015-9-30', 'Period':'FQ0','FRQ': 'M','Scale': 6})

print(data)

by @tnksnsk314

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by chavalit-jintamalit · Feb 20, 2020 at 02:19 AM

Hi @Shinsuke.Tanaka

I would suggest you to split the call into 2 calls.

1. Get RIC list first

universe='SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/),IN(TR.ExchangeCountryCode,"JP"), IN(TR.InstrumentTypeCode,"ORD"), CURN=JPY)'
df,e = ek.get_data(universe, ['TR.RIC'])
ric_list = df['Instrument'].tolist()

#split the list into a smaller list (to avoid hitting limit)
ric_list1 = ric_list[0:1000]
ric_list2 = ric_list[1000:2000]
ric_list3 = ric_list[2000:3000]
ric_list4 = ric_list[3000:]


2. Get MarketCap and MarketCap date from the RIC list

data1, err = ek.get_data(ric_list1,['TR.CompanyMarketCap.Date','TR.CompanyMarketCap'],
                  {'SDate': '2015-9-30', 'EDate':'2019-8-31', 'Period':'FQ0','FRQ': 'M','Scale': 6})
data1.head()

Here is sample output:


I was able to get the data back from the whole list at once, but this is not suggested.


ahs.png (29.7 KiB)
ahs2.png (26.5 KiB)
Comment
tnksnsk314

People who like this

1 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
tnksnsk314 · Feb 20, 2020 at 03:44 AM 0
Share

@chavalit.jintamalit

I understood. I will do it and show my client. Thank you! regards, Shinsuke

avatar image
REFINITIV
Answer by nick.zincone · Feb 20, 2020 at 01:13 AM

Hi @Shinsuke.Tanaka,

You didn't provide the details of what happens when you combine ① with ②. I'll assume you received output such as this (Note: I also echoed the err value to the screen):

I have not seen this error before but my suspicions are that you have exceeded a data limit. The data range you specified includes 48 different periods between each instrument. Limiting your date range will actually return a valid result.

For example:


ahs.png (17.4 KiB)
ahs.png (10.3 KiB)
Comment
tnksnsk314

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by tnksnsk314 · Feb 20, 2020 at 01:38 AM

I appreciate your suggetion. I'd like to have the result along with date like 2019/8/31, 2019/7/31. Which field should I put in the program?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by nick.zincone · Feb 20, 2020 at 02:12 AM

You can apply the TR.CompanyMarketCap.Date field to your fields list. Refer to the DIB (Data Item Browser) within Eikon for a list of available fields/parameters.

Note: Because a new field is added, this will further reduce the date range as the new field contributes to the size of the data set. I would suggest you break down your universe if you want a specific date range as part of your result.


ahs.png (13.7 KiB)
Comment
tnksnsk314

People who like this

1 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
tnksnsk314 · Feb 20, 2020 at 03:41 AM 0
Share

@Nick.Sincone.1

Thank you! I didn't notice the field in DIB. regards, Shinsuke

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

Trying to fetch Close Bid Price for CMO tranche from Python

Request Intraday Forex Data using Python API.

Get EPS historical data for stocks

Merging historical and forecast dataframe yields duplicates

Eikon Script API(EAP) want to get specific terms of news

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges