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
16 1 1 1

Retrieve list of Oil Refinery RIC's

I would need something like ek.get_rics(oil refineries, region="world") which would output a list of rics of all oil refineries in the world.


I tried using the interactive oil map, made a layer on refineries and export that to excel. Yes, you get a list of tickers, but only those currently zoomed on the map. And if you zoom out to get the world, you get a summarizing table containing the # of OR's per continent/country.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiapiricsenergy
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
10.1k 18 6 9

Hi @ana.ramirezcervera Thanks for your question. You need to use the search API endpoint from the Refinitiv Data Platform - which is accessible using your eikon appkey - or from within the codebook app.

import refinitiv.dataplatform as rdp
rdp.open_desktop_session('YOUR APP KEY HERE')
import eikon as ek
ek.set_app_key('YOUR APP KEY HERE')
dfRic = rdp.search(
    view = rdp.SearchViews.PhysicalAssets,
    filter = "RCSAssetTypeLeaf eq 'oil refinery'", #and RCSRegionLeaf eq 'United States'
    top=10000
)
display(dfRic)

You could then take that list and get other pertinent information eg:

df, err = ek.get_data(instruments = dfRic['RIC'].astype(str).values.tolist(),fields =["TR.AssetName","TR.AssetLocation","TR.AssetLongitude","TR.AssetLatitude"])

df

I hope this can help.


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
16 1 1 1

Thanks for you answer.


When running the above code, I get the following error.

Session session - Thread 20140 | MainThread Error: no proxy address identified. Check if Desktop is running.

Desktop application is running (Eikon package works perfectly)


Python version: 3.8.3

RDP version:

1.0.0a6
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
16 1 1 1

When I try making connection directly to the Refinitiv Data Platform (as described on https://pypi.org/project/refinitiv-dataplatform/) I get the following error.


2020-10-15 10:07:25,980 - Session session.platform - Thread 20140 | MainThread EDP Authentication failed. Error code -1 | AttributeError("'Request' object has no attribute 'prepare'")
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.

Upvote
16 1 1 1

Changing version using pip install httpx==0.14.2 worked for me :)

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.