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
3 0 1 5

How to download data for all the mines in the world (all Countries) using python call?

I want to download data for all the mines in the world. I am using a python call:


mines = rd.discovery.search_templates["Mines"]
df = mines.search(commodity="Gold", region="Australia")

but i want to ask for all commodities in all countries. is this possible?

#productapi#content
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.

Hello @jeremiemae.celajes

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 next to 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
78.9k 250 52 74

@jeremiemae.celajes

You can use the mines.search() method but the output will be limited to 10,000 entries, as mentioned by my colleague.

Therefore, you may need to use the search.Definition() directly with an appropriate filter. For example, I sent two requests. The first request gets all coal mines and the second request gets all mines except coal mines.

The request for all coal mines looks like this:

coal = search.Definition(
    view=search.Views.PHYSICAL_ASSETS,
    select="RIC,RCSRegionLeaf,RCSCommodityTypeLeaf,DTSubjectName,PhysicalAssetStatus,Latitude,Longitude", 
    filter="RCSAssetTypeLeaf eq 'Mine' and RCSCommodityTypeLeaf eq 'Coal'",
    top=10000
).get_data()
coal.data.df

The output is:

1674610933882.png

The request for all mines except coal mines looks like this:

others = search.Definition(
    view=search.Views.PHYSICAL_ASSETS,
    select="RIC,RCSRegionLeaf,RCSCommodityTypeLeaf,DTSubjectName,PhysicalAssetStatus,Latitude,Longitude", 
    filter="RCSAssetTypeLeaf eq 'Mine' and not(RCSCommodityTypeLeaf eq 'Coal')",
    top=10000
).get_data()
others.data.df

1674610987736.png

Totally, you will get 10,253 entries.


1674610933882.png (64.5 KiB)
1674610987736.png (65.1 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.

Upvotes
3 0 1 5

Any assistance is greatly appreciated

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
10.2k 18 6 9

@jeremiemae.celajes So the technology underlying the search templates is the RDP Search API -which has a result per call limit of 10,000. Thus were you to include all facilities in all regions for all commodities you might have a result set greater than 10,000. So for such larger queries you can try to use the Search API directly and this article and this article can help you with such queries. There are many samples in the accompanying notebooks. I think you would still need to narrow the search down by larger geographic regions. I hope this is of use.

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.