Download Symmetrized cif files using MP_API

Using MP_API, how can we download Symmetrized cif files given Material IDs? I could get cif files but not sure how I can do for Symmetrized ones.

Would pymatgen’s SpacegroupAnalyzer help with this?

I haven’t checked if SpacegroupAnalyzer can give the symmetrized cif files, but CifWriter class seems to give symmetrized cif:

CifWriter(struct=cosi_structure, symprec=1e-5).write_file(join(cif_folder, f'mp-7577.cif'))

Here, my next question: is the symmetrized cif file generated by the line above always correspond with the symmetrized cif, which we can download from Materials Project website?

That depends on the value chosen for symprec which is currently set to 0.1 for the website. HTH.