Error in Data Retrieval

Thanks for reaching out. I edited your traceback to remove your API key. Please consider using the MP_API_KEY environment variable to avoid accidentally exposing your API key.

Make sure to use the latest material_id for a material and not a task_id. Run your list of task_id/material_ids through a search to get a mapping:

mpr.materials.search(task_ids=[<list of ids>], fields=["material_id"])

Also, see this thread for how to deal with the remaining NoSuchKey errors: NoSuchKey error - #2 by tschaume