Access data from "Crystal Structure" section using mp_api

I would like to access the data in the “Wyckoff” field in the “Crystal Structure” section of any given material (example material page: mp-113) – also obtainable by clicking the “Export Materials Details” button just above the Crystal Structure section.
Is there a way to do this using the mp_api Python library (i.e. for large numbers of materials)? I have looked through the results for likely-sounding endpoints (as below), but haven’t found, for instance, the 2c that appears under “Wyckoff” on the example page. Have I missed it in a subdocument in these results, maybe? – or am I looking in the wrong places?

with MPRester(api_key="...") as mpr:
    mp_mat = mpr.materials.search(material_ids=["mp-113"])

    mp_crys = mpr.materials.robocrys.search_docs(material_ids=["mp-113"])

    mp_core = mpr.materials.core.search(material_ids=["mp-113"]) # Is this deprecated now?

    e_struct = mpr.materials.electronic_structure.search(material_ids=["mp-113"])

mp_api version 0.41.2

Thanks for reaching out. The data for the “Atomic Positions” table is from the /chemenv endpoint, i.e. mpr.materials.chemenv.search(...). HTH.

Thank you! Yes, I see the Wyckoff field at the materials.chemenv endpoint now.
A followup question: there are some returned materials that show an empty list for wyckoff_positions when queried by MPRester, though their web page shows values under ‘Wyckoff’; for example, mp-12734, which has 1a, 2c, 3g on its materials page. Do you know where the web page data is coming from in those cases?

hello @mole
The wyckoff data you see on the web page is processed via the SpaceGroupAnalyzer of pymatgen, see the code snippet below:

from pymatgen.symmetry.analyzer import SpacegroupAnalyzer

sga = SpacegroupAnalyzer(structure, symprec=0.1)
symm_data = dict()
symm_data["Crystal System"] = sga.get_crystal_system().title()
symm_data["Lattice System"] = sga.get_lattice_type().title()
symm_data["Hall Number"] = sga.get_hall()
symm_data["International Number"] = sga.get_space_group_number()
symm_data["Symbol"] = unicodeify_spacegroup(sga.get_space_group_symbol())
symm_data["Point Group"] = unicodeify_spacegroup(sga.get_point_group_symbol())

sym_struct = sga.get_symmetrized_structure()

wyckoff_data = sorted(
    zip(sym_struct.wyckoff_symbols, sym_struct.equivalent_sites),
    key=lambda x: "".join(filter(str.isalpha, x[0])),
)

You can use the structure object returned by the api here.

Hope it helps.
Ruoxi