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 2 3

get_data with ISIN as identidier

I am using Eikon with python on a Windows machine. (First day using codebook)

I would like to receive for example CF_ASK and ASKSIZE for Google on the Exchange Tradegate. With "ABEA.TG" as the identifier it is working properly. But I would like to use the get_date function with an ISIN as identifier.

import eikon as ek
ek.set_app_key('my_key_here')
df, err = ek.get_data(['GOOG.O', 'ABEA.TG', 'US02079K3059', 'US02079K3059.TB'], ['CF_ASK', 'ASKSIZE'])
df

The ISINS are just showing <NA>.

get-datat.png


How can I use an ISIN as identifiere here?

pythonpython api
get-datat.png (6.3 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.

hi @Bjorn8

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text on the left side of the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvotes
Accepted
25.3k 87 12 25

Hi @Bjorn8

It may be worth speaking to your sales contact again. It could well be that they showed you the RD Library inside Codebook - rather than the Eikon Data API?

When you run Codebook and refer to the Examples -> 01. Data Retrieval->01.01 Refinitiv Data Library folder where you can find Content Symbology example.

For example, you could do something like:

response = symbol_conversion.Definition(
    symbols=["US02079K3059","LU0100938306"],
    from_symbol_type=symbol_conversion.SymbolTypes.ISIN,
    to_symbol_types=[
        symbol_conversion.SymbolTypes.RIC
    ],
).get_data()


rics = response.data.df['RIC'].tolist()
df = rd.get_data(rics, ['CF_ASK', 'ASKSIZE'])

Which is taking a couple of ISINs, and converting them to RICs before calling get_data()

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.

Thanks, that was really helpfull. Any change to set teh exchange as well? RIC is different for Google in USA and Google in Germany. May I add Exchange "TG" for Trtadegate for example?



This is what I was looking for:

# retrieve RIC from ISIN

DATA, err = ek.get_data(['DE0006083405'], ['TR.RIC'])

# convert RICs to list to be used

ric_lists = DATA['RIC'].to_list()

# get data

df, err = ek.get_data(ric_lists, ['CF_NAME','CF_BID', 'CF_ASK', 'BIDSIZE', 'ASKSIZE', 'CF_EXCHNG'])

display(df)

Upvote
22k 58 14 21

Hi @Bjorn8,

You can print the error object to see the message returned from the server.


[{'code': 251658243,
  'col': 1,
  'message': "'The record could not be found' for the instrument 'US02079K3059'",
  'row': 2},
 {'code': 251658243,
  'col': 2,
  'message': "'The record could not be found' for the instrument 'US02079K3059'",
  'row': 2},
 {'code': 251658243,
  'col': 1,
  'message': "'The record could not be found' for the instrument 'US02079K3059.TB'",
  'row': 3},
 {'code': 251658243,
  'col': 2,
  'message': "'The record could not be found' for the instrument 'US02079K3059.TB'",
  'row': 3}]


It seems only RIC's are supported for getting the real time data fields. You can try the following query and use the non-real time fields:

df, err = ek.get_data(['GOOG.O', 'ABEA.TG', 'US02079K3059'], ['TR.ASKPRICE', 'TR.PriceClose'])

The last ISIN code seems to be invalid.

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.

Thanks for your answer. But it has to be possible. The „sales“ team showed me that it is possible with an ISIN before I signed the contract. But now they are just referring to the QA Section here.
We, the moderators on these forums can help with API, but are not content experts. I would recommend that you open a service ticket with my.refinitiv.com and directly speak with a content expert. They can advise you on this authoritatively.


Upvotes
5.7k 21 2 6

Hi @Bjorn8,


you can programmatically find the RICs you are after using the symbology converter in Python, then continue using the code you already have. Does that answer your question?

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.

Thank you this is really helpful. But is itpossible to add an exchange as well? RIC for the same ISIN is different for Tradegate and NASD for example.
Upvotes
25.3k 87 12 25

Hi @Bjorn8

I can do the above using the Symbology API - e.g.

{
  "from": [
    {
      "values": [
        {
          "RDNExchangeCode": "TDG",
          "Isin": "US02079K3059"
        },
        {
          "RDNExchangeCode": "NSQ",
          "Isin": "US02079K3059"
        }
      ]
    }
  ],
  "to": [
    {
      "identifierTypes": [
        "RIC"
      ],
      "objectTypes": [
        "EdfQuote"
      ]
    }
  ],
  "type": "predefined",
  "route": "IsinVenueToQuote"
}

gives:

 [{'input': [{'value': 'US02079K3059', 'identifierType': 'Isin'},
    {'value': 'NSQ', 'identifierType': 'RDNExchangeCode'}],
   'output': [{'value': 'GOOGL.O', 'identifierType': 'RIC'}]},
  {'input': [{'value': 'US02079K3059', 'identifierType': 'Isin'},
    {'value': 'TDG', 'identifierType': 'RDNExchangeCode'}],
   'output': [{'value': 'ABEA.TG', 'identifierType': 'RIC'}]}]

This would require using the Endpoint interface of the RD Library (as the symbol_conversion uses a different API at the moment)

You can see an example of the Symbology API being used with the Endpoint interface at Example.DataLibrary.Python/EX-3.01.01-Endpoint.ipynb - if you refer to the Body Parameter: example towards bottom of that notebook.

As you will note, you can provide multiple input values in a single request.

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.