Query molecules with MPRester

Dear all,

After following the MP tutorials, I struggle to see if it is possible to query the database for molecules using the MPRester client? My first guess would be something like mp.summary.search(molecule_ids=[‘’]) but that didnt work. Inspecting the search method in summary.py doesn’t reveal anything about molecules either.

I am importing the wrong classes or is this not possbile?


mpr.molecules.search() should give you access to what you need.

with MPRester(API_KEY) as mpr:
MPRestError: HTTPSConnectionPool(host='api.materialsproject.org', port=443):
Max retries exceeded with url: /molecules/core/?_limit=1000&_fields=smiles%2CIE%2CEA&_skip=113000
(Caused by ReadTimeoutError("HTTPSConnectionPool(host='api.materialsproject.org', port=443): Read timed out. (read timeout=20)"))

Hi @mario_Chiaparini, thank you for reporting this. We are working on fixing the timeout issue @munrojm. FYI, the mpr.molecules is a brand new and much larger dataset released last Monday. The legacy dataset is accessible via mpr.molecules.jcesr until fully incorporated with the new dataset.

1 Like

@mario_Chiaparini, let me know if you are getting the same timeout issues with mpr.molecules.jcesr. The data you are trying to access has moved there.

– Jason

1 Like

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