Thank you for the prompt response.
I have been able to install the MoleculesRedoxRester. But, unfortunately still facing difficulty in extracting the data. Here is my code and the error.
Code:
from pymatgen.ext.matproj import MPRester
mpr = MPRester(âAPI KEYâ) # use this line if you set up the configuration file
print(type(mpr)) # should be âmp_api.client.mprester.MPResterâ
#--------
from mp_api.client.routes.molecules.redox import MoleculesRedoxRester
redoxdoc = MoleculesRedoxRester(âAPI KEYâ)
print(type(redoxdoc))
available_fields = redoxdoc.available_fields
print(available_fields)
redoxdata = redoxdoc.search(elements=[âPtâ, âOâ])
dfredoxdata = pd.DataFrame(redoxdata)
print(dfredoxdata)
Results:
<class âmp_api.client.mprester.MPResterâ> <class âmp_api.client.routes.molecules.redox.MoleculesRedoxResterâ> [âbuilder_metaâ, âchargeâ, âspin_multiplicityâ, ânatomsâ, âelementsâ, ânelementsâ, ânelectronsâ, âcompositionâ, âcomposition_reducedâ, âformula_alphabeticalâ, âformula_prettyâ, âformula_anonymousâ, âchemsysâ, âsymmetryâ, âproperty_nameâ, âproperty_idâ, âmolecule_idâ, âdeprecatedâ, âdeprecation_reasonsâ, âlevel_of_theoryâ, âsolventâ, âlot_solventâ, âlast_updatedâ, âoriginsâ, âwarningsâ, âbase_property_idâ, âelectron_affinityâ, âea_task_idâ, âionization_energyâ, âie_task_idâ, âreduction_energyâ, âreduction_free_energyâ, âred_molecule_idâ, âred_property_idâ, âoxidation_energyâ, âoxidation_free_energyâ, âox_molecule_idâ, âox_property_idâ, âreduction_potentialâ, âoxidation_potentialâ]
MPRestError Traceback (most recent call last)
in <cell line: 14>() 12 print(available_fields) 13 â> 14 redoxdata = redoxdoc.search(elements=[âPtâ, âOâ]) 15 dfredoxdata = pd.DataFrame(redoxdata) 16 print(dfredoxdata)
9 frames
/usr/local/lib/python3.10/dist-packages/mp_api/client/core/client.py in _submit_request_and_process(self, url, verify, params, use_document_model, timeout) 1029 message = str(data) 1030 â 1031 raise MPRestError( 1032 f"REST query returned with error status code {response.status_code} " 1033 f"on URL {response.url} with message:\n{message}"
MPRestError: REST query returned with error status code 404 on URL https://api.materialsproject.org/molecules/redox/?elements=Pt%2CO&_all_fields=True&_limit=1000 with message: Not Found
Appreciate your assistance regarding this issue. Thank you.