Download CIF files using MP new API

I’m trying to get CIF files using the API materials.search() and structure.to() and create different files, but I’m getting stuck with it. Can someone help me!
Thank you.

mids=mpr.materials.search(material_ids= ["mp-149", "mp-4163"], fields=["structure"]) 
for i in range(len(mids)):
    structure=mids[i].structure
    structure.to(filename="cif"%i)

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