Inquiry over the "elements" criteria - number of atoms


I’ve been successfully using MaterialsProject in Python via MPDataRetrieval, and have generally found it very intuitive.

This may be a very stupid question. However, I cannot find the answer to my question despite searches and hence must ask it here.

If one wanted to search for materials containing sodium, phosphorus, and oxygen, the criteria could be defined as

"elements": {"$all": ["Na","P","O"]

However, what if you wanted exactly 4 oxygen atoms in your results? How would you specify that?

Thank you


Use the reduced_cell_formula field:

{"elements": {"$all": ["Na","P","O"]}, "reduced_cell_formula.O": 4}



Hi Donny

Thank you for the rapid reply

I used the following criteria
“elements”: {"$all": [“Na”,“P”,“O”]},
“reduced_cell_formula”: {“O”:4},

But the resulting csv is completely empty. Have I missed out something?