How to get magnetic moment using the Materials Project API?


Dear users and developers,

I’d like to get magnetic properties, “Final magnetic moment” in material details using the Materials Project API.

However, when I see the document about API,

magnetic properties are not indicated in “basic properties”

Is there any way to gather magnetic properties of materials?

Thanks a lot


Hi, the property “total_magnetization” from the API should correspond to the value listed as “Final magnetic moment” on the website. Thanks for bringing this to our attention, we’ll update the docs accordingly.


mpr = MPRester(YOUR_API_KEY)
mag = mpr.get_data(MP_ID)[0]['total_magnetization']


We should also be adding additional magnetic properties (for example, atomic magnetic moments in addition to the overall magnetic moment) to the API early next year.

Please get in touch if you have specific requests or applications in mind, since this will help prioritise features.