How to retrieve deprecated materials?


According to the V2019.05 update in the release log, deprecated materials are accessible via API. Can anyone post an example of how this is done?

The API documentation doesn’t appear to talk about this case, but I went ahead and tried adding “deprecated”: True to a pymatgen MPRester query a handful of ways:
.query(criteria={"material_id": {"$in": idlist}}, properties=proplist, deprecated=True)
.query(criteria={"material_id": {"$in": idlist}}, properties=proplist, deprecated="true")
.query(criteria={"material_id": {"$in": idlist}, "deprecated":True}, properties=proplist)
.query(criteria={"material_id": {"$in": idlist}, "deprecated":true}, properties=proplist)
where the first two return unexpected keyword errors for deprecated, and the last two don’t retrieve any of the deprecated materials in my list.

I also tried using the command-line method with “curl” by adding an additional flag -F deprecated=true or -F deprecated="true" but neither request returns the deprecated materials.

1 Like

Hi @guevarra,

Sorry for the trouble. It seems the “material_id” key was not properly registered as a pass-through for retrieving deprecated materials. This key is an alias for the canonical task id selected from a material document’s “task_ids” list. If you use “task_ids” instead of “material_id” in your query, you will get results for all IDs even if they correspond to deprecated materials. There is no need to pass a deprecated flag in any way to the query criteria or to the query method.

I’ll try to update “material_id” to work as well, but in the meantime use e.g.

{"task_ids": {"$in": idlist}}

in your criteria argument to MPRester.query.


1 Like

It worked! Thanks Donny!