API access to nanoporous materials database

I am trying to access structural and property data from the nanoporous materials database using the API. For example, consider the zeolite with materials ID NMGC-239531. When I try to get data (or structure) I receive the following error:

>>> mg.get_structure_by_material_id('NMGC-239531') 
Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "/usr/local/lib/python2.7/dist-packages/pymatgen/matproj/rest.py", line 381, in get_structure_by_material_id 
return data[0][prop] 
IndexError: list index out of range

Other similar queries seem to imply that these materials are not in the database. Is this correct, or am I simply using the wrong key? Is there any way that I can obtain the data (and especially structures) in an automated way?

1 Like

Thanks for pointing this out. We currently do not have a documented API for the nanoporous materials. However, for any material, you can append “/data” to the URL to get all of the data for that material, serialized in the pymatgen StructureNL format, so that you can load the structures for analysis.

I’ve posted an ipython notebook gist here for example usage (requires the Python requests library installed): https://gist.github.com/dwinston/301d39933ff9e1a85e15

We’ll try to put together a more formal API soon.

1 Like