from mp_api.client import MPRester
with MPRester("your_api_key_here") as mpr:
docs = mpr.summary.search(material_ids=["mp-149"], fields=["structure"])
structure = docs[0].structure
# -- Shortcut for a single Materials Project ID:
structure = mpr.get_structure_by_material_id("mp-149")
MPRestError: REST query returned with error status code 403 on URL https://api.materialsproject.org/materials/core/mp-620652/?_limit=1&_fields=structure with message:
Response {“error”: “You are using deprecated API endpoints. Please read our documentation (https://docs.materialsproject.org) and upgrade to the latest version of the mp-api client (mp-api · PyPI).”, “version”: “blocked”}
I have tried to upgrade to: pymatgen 2024.2.8
and mp-api 0.39.5
Anyone has an idea? Thanks a lot!