How to retrieve all entries of a general formula using get_entries_in_chemsys?

Hi, I would like to retrieve all phases from Materials Project with the general formula: LiaMbXc
It includes ‘Li’ + ‘any other element of the periodic table’ + ‘any of the halide elements: F, I, Br or Cl alone or together’

After I have done:

a = MPRester(‘MYAPIKEY’)
entries = a.get_entries_in_chemsys({‘Li’,‘Cl’,‘I’,‘Br’,‘F’})

How can I add ‘any other element of the periodic table’ ?

Thank you for your help !

Hi Yasmine!

Does this give you what you want?

entries = rester.get_entries({"elements":{"$in":["Cl","Br","I","F"],"$all":["Li"]},"nelements":3})

or repeating this for the different haildes:

entries = rester.query("Li-*-Cl",properties=['material_id'])

I suggest also to have a look at the new API and rester:

and try something like this example:

Hope this helps

Hey Francesco ! Thank you so much, I haven’t used pymatgen in a long time, I might have other silly questions :stuck_out_tongue:

I’ll look at the documentation you mentioned, it will be of great help, thank you again !

I hope everything is going well at Berkeley, say hi to Aurelie for me :wink:

1 Like