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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
1 0 0 0

Trying to access asset type of an asset using ISIN, tried using the code from an answer but getting errors.

Everything is being done in the Refinitiv Codebook through Jupyter Notebooks

Code:

import eikon

eikon.get_data(['US0378331005','US345370CS72','F5YUSAX=R', '.SPX'],

['TR.AssetCategoryCode','TR.AssetCategory'])

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_107/42610158.py in <module>
      1 import eikon
----> 2 eikon.get_data(['US0378331005','US345370CS72','F5YUSAX=R', '.SPX'],
      3             ['TR.AssetCategoryCode','TR.AssetCategory']) 
/opt/conda/lib/python3.8/site-packages/eikon/data_grid.py in get_data(instruments, fields, parameters, field_name, raw_output, debug)
    188         payload = {
  'requests': [payload]}
    189 --> 190     result = eikon.json_requests.send_json_request(_endpoint, payload, debug=debug)
    191     192     if result.get('responses'):

/opt/conda/lib/python3.8/site-packages/eikon/json_requests.py in send_json_request(entity, payload, debug)
     86             udf_request = {
  'Entity': {
  'E': entity, 'W': data} }
     87             logger.debug('Request:{}'.format(udf_request))
---> 88             response = profile._desktop_session.http_request(url=profile.get_url(),
     89                                                              method="POST",
     90                                                              headers={'Content-Type': 'application/json', 
AttributeError: 'NoneType' object has no attribute 'http_request'
eikon-data-api
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
23k 22 9 14

Hello @carlos.bonilla ,

Run a quick test on my side- the code included runs as expected on my side in CodeBook, so can confirm no issue with the code:

assetcategory.gif

I suspect this is due to permissioning.

So I would suggest to verify with Refinitiv Eikon support via My Refinitiv -> Get Support (Refinitiv Helpdesk Online) if your Eikon user account has permissions to this content via API.

If it does not, and you require to request via ISIN, would suggest to contact your Refinitiv account team to discuss the requirement.


assetcategory.gif (40.0 KiB)
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
1 0 0 0

Sorry yeah forgot to setup my key, functioning normally now.

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