How can i retrieve band gap of a specific structure(eg: cubic perovskite) of a material. Which api can be used

How can i retrieve band gap of a specific structure(eg: cubic perovskite) of a material. Which api can be used. I tried to pass crystal_structure as attribute using MPRester package. But not sure which API to use. Is there any documentation to find these?
I found materials API which has couple of endpoints which is expecting task_id.

I appreciate your support!

Please refer to our documentation at Using the API | Materials Project Documentation. Thanks!


I’ve tried doing it this way using the api. Can you please let me know if I’m going in wrong direction ?

@Yuva_Sri_Vemulapalli this will do it.

with MPRester(your_api_key) as mpr:
    docs = mpr.materials.summary.search(material_ids=[material_id], fields=["band_gap"])
    band_gap = docs[0].band_gap

– Jason