REST error 504


I’m having a hard time extracting data via API, receiving a ‘MPRestError 504 time out’ message. Here is my code:

from pymatgen import MPRester
m = MPRester(MAPI_KEY)
data = m.query(criteria={"e_above_hull":{"$exists":True}},properties=["pretty_formula", "e_above_hull"], chunk_size = 100, max_tries_per_chunk = 3)

This code, even without the ‘chunk_size’ has worked previously (extracting ~126,000 compounds), although now it sometimes only gets through a couple chunks before crashing, and sometimes none at all.

Does anyone know if there is anything I can do on my end to address this, or is it only due to too little RAM available for the request? And if so should I try the request at a time more off-hours?

Thank You!

Having the same issue today and the MP website also seems to be having problems displaying search results. Maybe a temporary server issue? @mkhorton


Yup, we’re going through an upgrade currently. Usually this only takes a few minutes but today it’s taking longer since the upgrade has stalled, which will result in intermittent connection errors. Since it’s the end of the work day here I’ll try and get it into a stable state and we’ll try the update again tomorrow.

1 Like

Ok, this should be resolved now. Thanks @gpeterson and @peterschindler for reporting!