question

Upvotes
Accepted
2 4 3 1

How do I retrieve index constituents in RDP/Python

I'm looking for the canonical (best) way to retrieve the set of index constituents as of a specific date, using the refinitiv.dataplatform API in Python. Assume for the purpose of discussion that I'm interested in constituents in .TRAFWLT1 or .TRXFLDUSP as of 2020-09-30. Ideally, I'd like to get back a data frame where I can also have some columns of constituent-specific data (e.g., free float market cap, dividend yield, P/E, P/Book, etc.), but if I can't do that in a single call...my follow-up question is how would I retrieve this constituent level data, once I have the constituent set.

I apologize if this seems like a basic question, but I've searched in the API Playground as well as in the API samples and if the information is there, I'm not seeing it.

pythonrdp-apirefinitiv-data-platformrefinitiv-data-platform-libraries
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
Accepted
32.2k 40 11 20

Hello @jeff.kenyon,

Agree with @Gurpreet,and do not believe at this time this level of historical reference data is exposed via RDP. RDP is an actively evolving and improving API, highly strategic API, so this can well become included (for ids pemissioned to historical reference) in the future.

In general, historical reference data is exposed via Datascope reference product and via Refinitiv Workspace/Eikon product, from what I know.

Via Eikon Data API Python:

ek.get_data('.DJI', ['TR.IndexConstituentRIC' , 'TR.IndexConstituentName'], {'SDate':'20200930'})

And DSS REST API

{ {protocol}}{ {host}}{ {api}}Search/HistoricalChainResolution

{
  "Request": {
          "ChainRics": ["0#.DJI"],
      "Range": {
          "Start": "2020-09-30T00:00:00.000Z",
          "End": "2020-09-30T00:00:00.000Z"
      }
  }
}

For these instruments you list, however, I would start with content inquiry, and consult with Starmine content experts directly, via Refinitiv Content Helpdesk Online or over the phone, to learn how the specific content you are looking for, is made available in general, via which product, and what permissions are required to access, and then look into API access of the content.

Hope this info helps

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
22.1k 59 14 21

Hello @jeff.kenyon,

I don't think this functionality is available in RDP yet. There is a pre-released API endpoint which can expand chain RIC, but it is unable to expand the starmine indicies that you have provided. Even then, it is unable to provide the chain contituents on a particular date.

Here is what the endpoint looks like:

GET https://api.refinitiv.com/data/pricing/beta3/views/chains?universe=.AV.O

{
 "universe": {
  "ric": ".AV.O",
  "displayName": "TOP 25 BY VOLUME",
  "serviceName": "ELEKTRON_DD"
 },
 "data": {
  "constituents": [
   "MDGS.O",
   "AAPL.O",
   "NAKD.O",
   "EARS.O",...

once you have chain rics, you can use Datagrid endpoint (in beta currently) to get the data points:

POST https://api.refinitiv.com/data/datagrid/beta1/

{
 "universe": [
  "AAPL.O"
 ],
 "fields": [
  "TR.DividendYield",
  "TR.PE",
  "TR.PriceToBVPerShare"
 ]
}

response:
...
"data": [
 [
  "AAPL.O",
  0.6290192926,
  37.8194818974192,
  29.4912709446062
 ]
],
...

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.