NoSuchKey error

@Sancran19 Thanks for reaching out and providing detailed information about your issue.

Everything you’re doing is correct. I can confirm that mp-1104027, for instance, wasn’t found but most should be there. I’ll have to look into why the specific material that is supposed to have a charge density is not found. For now, you’d have to catch the exception and continue downloading the rest:

try:
    mpr.get_charge_density_from_material_id(material_id) ....
except Exception as:
    print(ex)
    continue

You could also go through our AWS OpenData repository directly if you prefer:

The API client uses the same repo behind the scenes to retrieve the charge density data.