How do I get references from API?

When I download all data on a certain material, I can’t find all the information available on the website, like the references, as well as if the material has been experimentally observed or not. How do I obtain these from the API?

There are two places in the API where this kind of metadata is available, summary and provenance:

from mp_api.client import MPRester
mpids = [list of material_ids you're interested in]

with MPRester("your_api_key") as mpr:
    summary_docs = mpr.materials.summary.search(material_ids=mpids)
    provenance_docs = mpr.materials.provenance.search(material_ids=mpids)

Each document in summary_docs has a database_IDs field (ex: summary_docs[0].database_IDs) which has lists of ICSD and Pauling file IDs if the material can be matched to an external database. Similarly, the theoretical field is True if a material is currently hypothetical (hasn’t been reported to be synthesized)

The provenance docs provide a lot more information about the specific references corresponding to entries in the database_IDs field, and more detailed calculation metadata

Hope that helps!

1 Like