My research group is using the materials project for accessing structures for a project and have had a working piece of code for several months that is suddenly having a new error.
We have been performing the query below without issue until recently.
with MPRester(api_key=api_key) as mpr:
docs = mpr.query(
criteria=criteria,
properties=[“material_id”, “structure”]
)
using
from pymatgen.ext.matproj import MPRester
This is the new error we are seeing.
MPRestError: REST query returned with error status code 403. Content: b’{“valid_response”: false, “error”: “Invalid request method.”, “version”: {“db”: “2020_09_08”, “pymatgen”: “2022.0.8”, “rest”: “2.0”}, “created_at”: “2023-06-21T08:58:30.680393”}’
Does anyone have any insight into this issue? Let me know if providing more information would be useful.
I think you just need to update the versions of the mp-api, pymatgen, etc. packages. If this is the issue I’m thinking it is, then it was caused by a recent version change.