Searching for Materials With Direct Band Gaps

Hi all,
I’m new to MatSci and pymatgen. I was wondering if there is a way that I can use the API to query for materials with direct band gaps. If not, is there a way that I can check to see if a material has a direct band gap? An example would be nice but isn’t necessary!
Thanks so much in advance!

Hi Adam,
For a single material, I expect it’s simple to use MPRester’s get_bandstructure_by_material_id() to grab the bandstructure, assuming it has one, then calling the bandstructure’s get_vbm() and get_cbm(). This will return two dicts, and comparing the values for their ‘kpoint_index’ key should tell you if the band gap is direct.
I don’t know if there’s a way to do this for many materials at once - looping through many materials id’s would put a big strain on the API. I’m about to write a separate question about that topic.

Thanks so much Steven! This was exactly what I was looking for. Too bad there isn’t a way to add direct band gaps to query criteria. I’ll look for your post to come.