Certain materials seem to be unavailable

Hi! If this isn’t the right place to post this, please redirect me and I’ll be happy to ask elsewhere.

I’ve been trying to access the page for some materials (in order to download their POSCAR files) for a few weeks now, but some of them are perpetually unavailable. Using Firefox it yields a purely white/blank page, while using Chrome yields a link error message. Although a few months ago those pages were available.

Is the problem on the client side or on the server side? How can I avoid it to be able to use the platform to its fullest? Thanks a lot.

Should you want to see for yourself, here’s a link to one such page, one of the two Al3Zr structures in the database. Note however that Al3Zr compound can be loaded if you want to replicate it further.

Thanks a lot!

Hi @Antoine_Rincent2,

We’re going through a transition to a new website right now exactly for reasons like this where our current, older, website code has accrued some technical debt and is getting difficult to maintain.

You can view this material on our new website by visiting this link Materials Project - /materials/mp-395/, unfortunately we don’t have the download button on there just yet, however you can also get this data via pymatgen and the MPRester, e.g.

from pymatgen.ext.matproj import MPRester

with MPRester() as mpr:
    struct = mpr.get_structure_by_material_id('mp-395')

struct.to(filename="POSCAR")

This second method requires some familiarity with Python.

We will try and solve this issue ASAP, but I hope this info is useful in the meantime.

Best,

Matt

Hi! Thank you very much for your answer and how fast you were to answer. I’m relatively familiar with Python and upon reading the documentation for the pymatgen library, I tried using the code you sent, however I used

with MPRester(api_key="myapikey") as mpr:

However I get the following error message :

raise MPRestError("REST query returned with error status code {}".format(response.status_code)) 
pymatgen.ext.matproj.MPRestError: REST query returned with error status code 503
Content: b'The Materials Project API is currently unavailable.'

Is this indicative of a problem on the Materials Project side of things, or is my API key incompatible/non functionnal for some reason?

Thanks again for your much appreciated help.

Hi @Antoine_Rincent2, that’s because we actually just this second are having an unplanned outage. Bad timing!

The instructions I gave above are for our old API, coming with the new website we also have a new API available: Materials Project API - Swagger UI with API key available at Materials Project - /dashboard Instructions and method calls should be fairly similar, except the import would change to from mp_api.matproj import MPRester.

Hopefully our current website and API will be back online when the service that hosts us is back online within the next hour or so.

Ok, we’re back online. Sorry about that.

Thanks again for your answers and your help, I’ve been able to download the structure with this import change and the new API. However, the output to POSCAR doesn’t seem to work, using :

struct.to(filename="POSCAR")

I get the follow error message :

AttributeError("'MaterialsDoc' object has no attribute 'to'")

I’m guessing it’s another change with the newer API/library, but couldn’t find the right method by browsing the documentation or the struct object. Is it still possible to export it to POSCAR?

Thanks again! :slight_smile:

Hi @Antoine_Rincent2, looks like your struct is actually referring to the complete MaterialsDoc object. You should be able to fix this by calling struct.structure.to(filename="POSCAR") assuming you requested the structure data.

This is due to a change with the new materials endpoint providing MaterialsDoc objects which have attributes corresponding to different data like structure or material_id.

– Jason

Thank you so much, that does it, thanks a bunch! :slight_smile: