How to get the 2D material data of material project

Hello everyone, how can I get all material data in the database whose dimension is 2D? I read through similar threads on this forum asking how to query 2D material data, but the best answer was a workaround for an older version. The new mp-api cannot quickly screen all 2D material data, no matter through any of its internal classes, I sincerely hope that some technical personnel can help me solve this problem.

1 Like

I got the same question.

We plan to have the dimensionality information incorporated into the summary data in the next release. That being said, you can pull dimensionality data from the robocrys endpoint. The endpoint is being updated to have its own proper generic search method, but the more barebones _search method can be used for now. I would recommend pulling all of the data, and filtering on dimensionality within condensed_structure locally:

with MPRester("your_api_key") as mpr:
    docs = mpr.robocrys._search(fields=["material_id", "condensed_structure"])

– Jason