Querying elements to include one wildcard element (ex, A-*-B)


I am wondering how to query data from the Materials Project API to not only include elements I call for, but limit to only one wildcard element? In other words, if I am to call for elements= “In”, “O”, it will return materials that include 1 to 4 different elements in addition to In and O (i.e. Na2Al2In2SiS5O24, BaNbInSnO6, Cs3InO3), so I am wondering how I can limit this to just 1? In the MP search bar on the website, this is done by typing "A--B for one wildcard element, or A--*-B for two wildcard elements, and so forth. However, this syntax does not work with the API obviously.

Thank you so much,

Hi Kikin,
It works the same way as the search bar:

from mp_api.client import MPRester
with MPRester('api-key') as mpr:
    data = mpr.summary.search(chemsys='In-O-*', fields=['material_id',  'structure'])

Best regards,

Thread closed due to inactivity, please open a new thread to address related issues.